Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Crash similar to PEM issue #12

Closed
alistra opened this issue Dec 2, 2014 · 9 comments
Closed

Crash similar to PEM issue #12

alistra opened this issue Dec 2, 2014 · 9 comments

Comments

@alistra
Copy link

alistra commented Dec 2, 2014

Similar crash fastlane-old/pem#13

INFO [2014-12-02 13:33:04.43]: Login into iOS Developer Center
INFO [2014-12-02 13:33:17.48]: Login successful
INFO [2014-12-02 13:33:18.34]: Fetching all available provisioning profiles...
INFO [2014-12-02 13:33:19.30]: Checking if profile is available. (73 profiles found)
INFO [2014-12-02 13:33:22.26]: Downloading profile...
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:223:in `open_loop': redirection forbidden: https://developer.apple.com/account/ios/profile/profileContentDownload.action?displayId=SPMF4U75DG -> http://developer.apple.com/account/selectTeam.action (RuntimeError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:149:in `open_uri'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:689:in `open'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:34:in `open'
    from /Library/Ruby/Gems/2.0.0/gems/sigh-0.1.1/lib/sigh/developer_center.rb:363:in `download_file'
    from /Library/Ruby/Gems/2.0.0/gems/sigh-0.1.1/lib/sigh/developer_center.rb:290:in `download_profile'
    from /Library/Ruby/Gems/2.0.0/gems/sigh-0.1.1/lib/sigh/developer_center.rb:188:in `block in maintain_app_certificate'
    from /Library/Ruby/Gems/2.0.0/gems/sigh-0.1.1/lib/sigh/developer_center.rb:172:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/sigh-0.1.1/lib/sigh/developer_center.rb:172:in `maintain_app_certificate'
    from /Library/Ruby/Gems/2.0.0/gems/sigh-0.1.1/lib/sigh/developer_center.rb:146:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/sigh-0.1.1/bin/sigh:45:in `block (2 levels) in <top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.2.0/lib/commander/command.rb:180:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.2.0/lib/commander/command.rb:180:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.2.0/lib/commander/command.rb:155:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.2.0/lib/commander/runner.rb:421:in `run_active_command'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.2.0/lib/commander/runner.rb:81:in `run!'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.2.0/lib/commander/delegates.rb:8:in `run!'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.2.0/lib/commander/import.rb:10:in `block in <top (required)>'
@alistra
Copy link
Author

alistra commented Dec 2, 2014

Tested both on ruby 2.0.0 and 2.1.5

@alistra
Copy link
Author

alistra commented Dec 13, 2014

@KrauseFx is there any new info on this? This probably happens if you have two teams to choose from.

@KrauseFx
Copy link
Collaborator

Sorry, haven't had time to look into it.

This seems to be related to: https://bugs.ruby-lang.org/issues/859

There is a patch available: https://github.com/open-uri-redirections/open_uri_redirections

Since I don't have this problem on my accounts I need you to test it:

  • Add gem 'open_uri_redirections' to the Gemfile
  • sudo bundle install
  • add require 'open_uri_redirections' on the top of developer_center.rb
  • Update the line data = open(url, {'Cookie' => "myacinfo=#{myacinfo}"}).read to `data = open(url, {:allow_redirections => :safe, 'Cookie' => "myacinfo=#{myacinfo}"}).read``

Please let me know if that fixes the issue, if yes, you can submit a pull request.

@alistra
Copy link
Author

alistra commented Dec 17, 2014

Not really and I dont think this fixes the root cause, because it looks like the redirect shouldn't happen. It should redirect to the file instead of switchTeam page.

Maybe you should pass all the cookies to the download method, not just one

@KrauseFx
Copy link
Collaborator

Oh, that's a very good point! I'll look into this!

@KrauseFx
Copy link
Collaborator

I'm in multiple teams now and get the team selection. I tried running `sigh`` and it's working flawlessly for me.
The available cookies are:

  • adssuv
  • myacinfo (which is basically the session)
  • dslang (the locale)
  • dslang
  • JSESSIONID (my value was 7115C6F3CEFA3B77CEB400B617C7F648.worker2)

Maybe the JSESSIONID must be passed as well, to send the request to the same server again. This might be the reason it has only failed 11 out of 60 times when you tried it.

@KrauseFx
Copy link
Collaborator

To test it, you can modify developer_center.rb to

session_id = page.driver.cookies['JSESSIONID'].value
data = open(url, {'Cookie' => "myacinfo=#{myacinfo}; JSESSIONID=#{session_id}"}).read

You can easily extend it to copy any of those values. Unfortunately I can't reproduce the problem for my accounts.

@KrauseFx
Copy link
Collaborator

This is fixed with the latest version of sigh. Thanks for your help 👍

@fastlanebot
Copy link

This issue was migrated to fastlane/fastlane#3017. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo 🚀

@fastlane-old fastlane-old locked and limited conversation to collaborators Mar 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants