fastlane: undefined method `[]' for nil:NilClass during Match

New Issue Checklist

Issue Description

Over the weekend, interacting with the dev center using match errors out. After drilling down, it looks like the providers for the supplied developer account are nil/null and the terms aren’t accepted. I vaguely remember there was a warning in fastlane that new terms were needed to be accepted on the Developer Center. However, on the Dev Center there’s no new terms update, and I can do all normal functions on the dev center with this account (regen/create provisioning profiles, add/remove team members, make new bundle ID’s).

The JSON Blob printed out in the output is the body of the request to https://olympus.itunes.apple.com/v1/session made in fetch_olympus_session

(please excuse the mess of output, it’s taken from Bamboo who maims fastlane’s output)

Complete output when running fastlane, including the stack trace and command used

INFO [2017-11-20 14:26:15.65]: ------------------- INFO [2017-11-20 14:26:15.65]: — Step: match — INFO [2017-11-20 14:26:15.65]: ------------------- INFO [2017-11-20 14:26:15.65]: Successfully loaded ‘/Users/buildserver/Documents/bamboo-home/bamboo_agent_5.11.1.1/xml-data/build-dir/HHUS-CIQE315-JOB1/ios/Fastlane/Matchfile’ ?

±--------±---------------------------------------------------------------------------------------+ | Detected Values from ‘./Fastlane/Matchfile’ | ±--------±---------------------------------------------------------------------------------------+ | git_url | [[redacted]] | | type | enterprise | ±--------±---------------------------------------------------------------------------------------+

±----------------------±---------------------------------------------------------------------------------------+ | Summary for match 2.65.0 | ±----------------------±---------------------------------------------------------------------------------------+ | type | enterprise | | force | true | | git_url | [[redacted]] | | git_branch | master | | template_name | [[Redacted]] | | verbose | true | | app_identifier | [[redacted]] | | username | [[redacted]] | | keychain_name | login.keychain | | readonly | false | | team_id | [[redacted]] | | skip_confirmation | false | | shallow_clone | false | | clone_branch_directly | false | | force_for_new_devices | false | | skip_docs | false | | platform | ios | ±----------------------±---------------------------------------------------------------------------------------+

INFO [2017-11-20 14:26:15.66]: Cloning remote git repo… INFO [2017-11-20 14:26:15.66]: If cloning the repo takes too long, you can use the clone_branch_directly option in match. INFO [2017-11-20 14:26:15.66]: $ GIT_TERMINAL_PROMPT=0 git clone ‘[[redacted]]’ '/var/folders/vh/1_pfckjs5sv8h58swn9v2_pm0000gn/T/d20171120-93078-9ir0fx’ INFO [2017-11-20 14:26:15.67]: ? Cloning into ‘/var/folders/vh/1_pfckjs5sv8h58swn9v2_pm0000gn/T/d20171120-93078-9ir0fx’… INFO [2017-11-20 14:26:16.98]: ? remote: Counting objects: 27587, done. INFO [2017-11-20 14:26:17.05]: ? remote: Compressing objects: 100% (25325/25325), done. INFO [2017-11-20 14:26:25.62]: ? remote: Total 27587 (delta 2257), reused 27477 (delta 2203) INFO [2017-11-20 14:26:25.62]: ? Receiving objects: 100% (27587/27587), 128.55 MiB | 15.01 MiB/s, done. INFO [2017-11-20 14:26:25.70]: ? Resolving deltas: 100% (2257/2257), done. INFO [2017-11-20 14:26:25.90]: ? Decrypted ‘[[Redacted]].cer’ INFO [2017-11-20 14:26:26.31]: ? [[Decrypts all profiles in repo]] INFO [2017-11-20 14:26:26.31]: ? Successfully decrypted certificates repo INFO [2017-11-20 14:26:26.31]: Verifying that the certificate and profile are still valid on the Dev Portal… {“user”=>{“fullName”=>“[[Redacted]]”, “emailAddress”=>“[[Redacted]]”, “prsId”=>“[[Redacted]]”}, “provider”=>nil, “availableProviders”=>[], “backingType”=>“NONE”, “roles”=>[], “unverifiedRoles”=>[], “featureFlags”=>[], “agreeToTerms”=>false, “modules”=>[{“key”=>“Resources”, “name”=>“ITC.HomePage.Resources.IconText”, “localizedName”=>“Resources and Help”, “url”=>“https://itunespartner.apple.com/”, “iconUrl”=>“https://itunesconnect.apple.com/itc/img/ico_homepage/resourcesAndhelp.png”, “down”=>false, “visible”=>true, “hasNotifications”=>false}], “helpLinks”=>[{“key”=>“All”, “url”=>“https://itunespartner.apple.com”, “localizedText”=>“All Resources and Help”}, {“key”=>“News”, “url”=>“https://itunespartner.apple.com/news/”, “localizedText”=>“News”}, {“key”=>“Videos”, “url”=>“https://itunespartner.apple.com/videos/”, “localizedText”=>“Videos”}, {“key”=>“Guides”, “url”=>“https://itunespartner.apple.com/guides/”, “localizedText”=>“Guides”}, {“key”=>“FAQ”, “url”=>“https://itunespartner.apple.com/faq/”, “localizedText”=>“FAQ”}, {“key”=>“ContactUs”, “url”=>“https://www.apple.com/itunes/go/itunesconnect/contactus”, “localizedText”=>“Contact Us”}], “localizations”=>{“signIn”=>“Sign In”, “personalDetails”=>“Personal Details”, “signOut”=>“Sign Out”}, “pccDto”=>nil} WARN [2017-11-20 14:26:28.72]: Lane Context: INFO [2017-11-20 14:26:28.72]: {:DEFAULT_PLATFORM=>:ios, :ENVIRONMENT=>“mhqaenterprise”, :PLATFORM_NAME=>nil, :LANE_NAME=>“build”, :SIGH_PROFILE_TYPE=>“enterprise”, :MATCH_PROVISIONING_PROFILE_MAPPING=>{“[[redacted]]”=>“match InHouse [[redacted]]”}} ERROR [2017-11-20 14:26:28.72]: undefined method `[]’ for nil:NilClass INFO [2017-11-20 14:26:28.72]: Successfully generated documentation at path '/Users/buildserver/Documents/bamboo-home/bamboo_agent_5.11.1.1/xml-data/build-dir/HHUS-CIQE315-JOB1/ios/fastlane/README.md’

±-----±------------------------------------±------------+ | fastlane summary | ±-----±------------------------------------±------------+ | Step | Action | Time (in s) | ±-----±------------------------------------±------------+ | 1 | Verifying required fastlane version | 0 | | 2 | default_platform | 0 | | 3 | mkdir -p …/build-post | 0 | | 4 | Switch to update_build_number lane | 0 | | 5 | set_info_plist_value | 0 | | 6 | set_info_plist_value | 0 | | 7 | set_info_plist_value | 0 | | 8 | xcversion | 10 | | 9 | automatic_code_signing | 1 | | 10 | update_info_plist | 0 | | 11 | update_app_identifier | 0 | | 12 | update_project_team | 0 | | 13 | match | 15 | | ? | match | 12 | ±-----±------------------------------------±------------+

DEBUG [2017-11-20 14:26:28.73]: All plugins are up to date ERROR [2017-11-20 14:26:28.73]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane… Search query: undefined method `[]’ for nil

URL: https://api.github.com/search/issues?q=undefined method `[]‘%20for%20nil+repo:fastlane/fastlane ?? `app_store_build_number` fails with `undefined method `current_build_number’ for nil:NilClass (NoMethodError)` https://github.com/fastlane/fastlane/issues/10447 [open] 3 ? 3 hours ago

?? undefined method `to_sym’ for nil:NilClass when running gym https://github.com/fastlane/fastlane/issues/10717 [closed] 11 ? 3 weeks ago

?? Gym Errors Out with: [!] undefined method `each_with_object’ for nil:NilClass https://github.com/fastlane/fastlane/issues/10780 [closed] 8 ? 2 hours ago

and 292 more at: https://github.com/fastlane/fastlane/search?q=undefined method `[]' for nil&type=Issues&utf8=?

? You can ? + double-click on links to open them directly in your browser. DEBUG [2017-11-20 14:26:29.24]: All plugins are up to date /Users/buildserver/fastlaneSource/spaceship/lib/spaceship/provider.rb:8:in initialize': [!] undefined method []’ for nil:NilClass (NoMethodError) from /Users/buildserver/fastlaneSource/spaceship/lib/spaceship/client.rb:507:in `new’ from /Users/buildserver/fastlaneSource/spaceship/lib/spaceship/client.rb:507:in `fetch_olympus_session’ from /Users/buildserver/fastlaneSource/spaceship/lib/spaceship/client.rb:472:in `send_shared_login_request’ from /Users/buildserver/fastlaneSource/spaceship/lib/spaceship/portal/portal_client.rb:13:in `send_login_request’ from /Users/buildserver/fastlaneSource/spaceship/lib/spaceship/client.rb:671:in `do_login’ from /Users/buildserver/fastlaneSource/spaceship/lib/spaceship/client.rb:405:in `login’ from /Users/buildserver/fastlaneSource/spaceship/lib/spaceship/client.rb:121:in `login’ from /Users/buildserver/fastlaneSource/spaceship/lib/spaceship/portal/spaceship.rb:22:in `login’ from /Users/buildserver/fastlaneSource/spaceship/lib/spaceship/portal/spaceship.rb:92:in `login’ from /Users/buildserver/fastlaneSource/match/lib/match/spaceship_ensure.rb:19:in `initialize’ from /Users/buildserver/fastlaneSource/match/lib/match/runner.rb:22:in `new’ from /Users/buildserver/fastlaneSource/match/lib/match/runner.rb:22:in `run’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/actions/match.rb:12:in `run’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/runner.rb:253:in `block (2 levels) in execute_action’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/runner.rb:231:in `block in execute_action’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/runner.rb:227:in `chdir’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/runner.rb:227:in `execute_action’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/runner.rb:148:in `trigger_action_by_name’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/fast_file.rb:146:in `method_missing’ from …/fastlane/Fastfile:186:in `block in parsing_binding’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/lane.rb:33:in `call’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/runner.rb:49:in `block in execute’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/runner.rb:45:in `chdir’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/runner.rb:45:in `execute’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/lane_manager.rb:54:in `cruise_lane’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/command_line_handler.rb:30:in `handle’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/commands_generator.rb:104:in `block (2 levels) in run’ from /Users/buildserver/.rvm/gems/ruby-2.3.3/gems/commander-fastlane-4.4.5/lib/commander/command.rb:178:in `call’ from /Users/buildserver/.rvm/gems/ruby-2.3.3/gems/commander-fastlane-4.4.5/lib/commander/command.rb:153:in `run’ from /Users/buildserver/.rvm/gems/ruby-2.3.3/gems/commander-fastlane-4.4.5/lib/commander/runner.rb:476:in `run_active_command’ from /Users/buildserver/fastlaneSource/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:66:in `run!’ from /Users/buildserver/.rvm/gems/ruby-2.3.3/gems/commander-fastlane-4.4.5/lib/commander/delegates.rb:15:in `run!’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/commands_generator.rb:303:in `run’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/commands_generator.rb:42:in `start’ from /Users/buildserver/fastlaneSource/fastlane/lib/fastlane/cli_tools_distributor.rb:66:in `take_off’ from /Users/buildserver/fastlaneSource/bin/fastlane:20:in `<top (required)>’ from /Users/buildserver/.rvm/gems/ruby-2.3.3/bin/fastlane:23:in `load’ from /Users/buildserver/.rvm/gems/ruby-2.3.3/bin/fastlane:23:in `<main>’ from /Users/buildserver/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `eval’ from /Users/buildserver/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `<main>’

Environment

✅ fastlane environment ✅

Stack

Key Value
OS 10.13.1
Ruby 2.3.3
Bundler? true
Git git version 2.13.6 (Apple Git-96)
Installation Source ~/.rvm/gems/ruby-2.3.3/bin/fastlane
Host Mac OS X 10.13.1 (17B48)
Ruby Lib Dir ~/.rvm/rubies/ruby-2.3.3/lib
OpenSSL Version OpenSSL 1.0.2l 25 May 2017
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode-9.1.app/Contents/Developer/
Xcode Version 9.1

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL
LANGUAGE

fastlane gems

Gem Version Update-Status
fastlane 2.65.0 ✅ Up-To-Date

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-unzip 1.0.1 ✅ Up-To-Date
fastlane-plugin-update_project_codesigning 0.2.0 ✅ Up-To-Date
fastlane-plugin-appicon 0.10.0 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.0.0
executable-hooks 1.3.2
bundler-unload 1.0.2
rubygems-bundler 1.4.4
bundler 1.16.0
io-console 0.4.5
rake 11.3.0
CFPropertyList 2.3.5
concurrent-ruby 1.0.5
i18n 0.9.1
minitest 5.10.3
thread_safe 0.3.6
tzinfo 1.2.4
activesupport 4.2.10
public_suffix 2.0.5
addressable 2.5.2
ast 2.3.0
babosa 1.0.2
debug_inspector 0.0.3
binding_of_caller 0.7.3
builder 3.2.3
byebug 9.1.0
claide 1.0.2
fuzzy_match 2.0.4
nap 1.1.0
cocoapods-core 1.3.1
cocoapods-deintegrate 1.0.1
cocoapods-downloader 1.1.3
cocoapods-plugins 1.0.0
cocoapods-search 1.0.0
cocoapods-stats 1.0.0
netrc 0.11.0
cocoapods-trunk 1.3.0
cocoapods-try 1.1.0
colored2 3.1.2
escape 0.0.4
fourflusher 2.0.1
gh_inspector 1.0.3
molinillo 0.5.7
ruby-macho 1.1.0
nanaimo 0.2.3
xcodeproj 1.5.3
cocoapods 1.3.1
coderay 1.1.2
colored 1.2
highline 1.7.8
commander-fastlane 4.4.5
json 2.1.0
docile 1.1.5
simplecov-html 0.10.2
simplecov 0.14.1
tins 1.15.1
term-ansicolor 1.6.0
thor 0.19.4
coveralls 0.8.21
safe_yaml 1.0.4
crack 0.4.3
declarative 0.0.10
declarative-option 0.1.0
diff-lcs 1.3
unf_ext 0.0.7.4
unf 0.1.4
domain_name 0.5.20170404
dotenv 2.2.1
excon 0.59.0
fakefs 0.8.1
multipart-post 2.0.0
faraday 0.13.1
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
faraday_middleware 0.12.2
fastimage 2.1.0
jwt 2.1.0
little-plugger 1.1.4
multi_json 1.12.2
logging 2.2.2
memoist 0.16.0
os 0.9.6
signet 0.8.1
googleauth 0.6.2
httpclient 2.8.3
mime-types-data 3.2016.0521
mime-types 3.1
uber 0.1.0
representable 3.0.4
retriable 3.1.1
google-api-client 0.13.6
mini_magick 4.5.1
multi_xml 0.6.0
plist 3.3.0
rubyzip 1.2.1
security 0.1.3
slack-notifier 1.5.1
terminal-notifier 1.8.0
unicode-display_width 1.3.0
terminal-table 1.8.0
tty-screen 0.6.2
word_wrap 1.0.0
rouge 2.0.7
xcpretty 0.2.8
xcpretty-travis-formatter 1.0.0
fastlane-plugin-appicon 0.10.0
fastlane-plugin-unzip 1.0.1
fastlane-plugin-update_project_codesigning 0.2.0
hashdiff 0.3.7
interception 0.5
method_source 0.9.0
parallel 1.12.0
parser 2.4.0.2
powerpack 0.1.1
pry 0.11.3
pry-byebug 3.5.0
pry-rescue 1.4.5
pry-stack_explorer 0.4.9.2
rack 1.6.8
rack-protection 1.5.3
rainbow 2.2.2
rb-readline 0.5.5
rest-client 2.0.2
rspec-support 3.5.0
rspec-core 3.5.4
rspec-expectations 3.5.0
rspec-mocks 3.5.0
rspec 3.5.0
rspec_junit_formatter 0.2.3
ruby-progressbar 1.9.0
rubocop 0.49.1
tilt 2.0.8
sinatra 1.4.8
webmock 2.3.2
xcode-install 2.3.1
yard 0.8.7.6

generated on: 2017-11-20

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 6
  • Comments: 19 (2 by maintainers)

Commits related to this issue

Most upvoted comments

I faced the same issue , temporarily solution is roll back to version 2.64.0. Below code works for me now.

  1. uninstall first gem uninstall fastlane --all --executables
  2. reinstall 2.64.0 gem install fastlane --version 2.64.0 --no-document

It seems like this issue might be related to code signing 🚫

Have you seen our new Code Signing Troubleshooting Guide? It will help you resolve the most common code signing issues 👍

Still present on 2.66.0

Same here. Didn’t occur in 2.64.

Same here. Issue appeared after upgrading from 2.64.0 to 2.65.0

Hello everyone, sorry you’re having issues with this. I believe I’ve already found the culprit in our code so hang tight a little bit longer and we’ll try to fix it!

2.64.1 works for us, too.

If you’re running a CI, you will probably have to force uninstall, since there are some dependent gems:

gem uninstall --force fastlane --all --executables

Same here… on 2.66.0

ruby -v 2.4.0

Same error message with sigh on 2.66.0.