Bundler: failed to load command: fastlane (/Users/vagrant/.rbenv/versions/2.6.3/bin/fastlane)

Bitrise Build Issue Report template

Description of the issue

For a fastlane lane as below : -

private_lane :retrieve_fastlane_session do
# runs shell
spaceauth_output = bundle exec fastlane spaceauth
# regex the output for the value we need
fastlane_session_regex = %r{Pass the following via the FASTLANE_SESSION environment variable:\n(?.+)\n\n\nExample:\n.+}
new_session = nil
if match = spaceauth_output.match(fastlane_session_regex)
# Strip out the fancy formatting
new_session = match[:session].gsub("\e[4m\e[36m", “”).gsub("\e[0m\e[0m", “”)
end

# Yell and quit if unable to parse out session from spaceauth output
if new_session.nil?
  puts "Unable to obtain new session via fastlane spaceauth"
  exit 1
else
  new_session
end

end

I am getting a new error - bundler: failed to load command: fastlane (/Users/vagrant/.rbenv/versions/2.6.3/bin/fastlane)

This was working previously - Bitrise - Mobile Continuous Integration and Delivery - iOS & Android Build Automation
But is failing now - Bitrise - Mobile Continuous Integration and Delivery - iOS & Android Build Automation

Environment:

Where did the issue happen?

Default (Xcode 11.1.x, on macOS 10.14.6 (Mojave))

Which build Step causes the issue and which version of the step?

fastlane 2.7.0 - IOS

Reproducibility

  • _Does a “Rebuild” help? NO
  • _Does a rebuild without caches help? NO
  • Does the issue happen sporadically, or every time? : Was working a day before, now not working.
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? : Today

Local reproduction

Locally the fastlane lane is working on MAC.

Local reproduction: Linux / Android (docker based) stack builds

Locally the fastlane lane is working on MAC.

Build log

Fastlane version
$ bundle “2.1.2” “exec” “fastlane” “–version”
fastlane installation at path:
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/bin/fastlane

fastlane 2.141.0
Run Fastlane
$ bundle “2.1.2” “exec” “fastlane” “internal”
[15:12:30]: Sending anonymous analytics information
[15:12:30]: Learn more at fastlane docs
[15:12:30]: No personal or sensitive data is sent.
[15:12:30]: You can disable this by adding opt_out_usage at the top of your Fastfile
[15:12:30]: ------------------------------
[15:12:30]: — Step: default_platform —
[15:12:30]: ------------------------------
[15:12:30]: Driving the lane ‘ios internal’ :rocket:
[15:12:30]: ----------------------------------------------------------
[15:12:30]: — Step: Switch to ios retrieve_fastlane_session lane —
[15:12:30]: ----------------------------------------------------------
[15:12:30]: Cruising over to lane ‘ios retrieve_fastlane_session’ :oncoming_taxi:
bundler: failed to load command: fastlane (/Users/vagrant/.rbenv/versions/2.6.3/bin/fastlane)
NoMethodError: [!] undefined method strip' for nil:NilClass Did you mean? String /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/highline-1.7.10/lib/highline/question.rb:413:in remove_whitespace’
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/highline-1.7.10/lib/highline.rb:873:in get_line' /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/highline-1.7.10/lib/highline.rb:891:in get_response’
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/highline-1.7.10/lib/highline.rb:264:in ask' /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/2.6.0/forwardable.rb:230:in ask’
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/spaceship/lib/spaceship/two_step_or_factor_client.rb:196:in ask_for_2fa_code' /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/spaceship/lib/spaceship/two_step_or_factor_client.rb:145:in handle_two_factor’
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/spaceship/lib/spaceship/two_step_or_factor_client.rb:20:in handle_two_step_or_factor' /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/spaceship/lib/spaceship/client.rb:494:in send_shared_login_request’
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/spaceship/lib/spaceship/tunes/tunes_client.rb:127:in send_login_request' /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/spaceship/lib/spaceship/client.rb:775:in do_login’
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/spaceship/lib/spaceship/client.rb:384:in login' /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/spaceship/lib/spaceship/client.rb:346:in login’
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/spaceship/lib/spaceship/tunes/spaceship.rb:24:in login' /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/spaceship/lib/spaceship/spaceauth_runner.rb:18:in run’
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/spaceship/lib/spaceship/commands_generator.rb:43:in block (2 levels) in run' /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in call’
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in run' /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in run_active_command’
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in run!' /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in run!’
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/spaceship/lib/spaceship/commands_generator.rb:49:in run' /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/spaceship/lib/spaceship/commands_generator.rb:14:in start’
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/fastlane/lib/fastlane/cli_tools_distributor.rb:111:in take_off' /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/fastlane-2.141.0/bin/fastlane:23:in <top (required)>’
/Users/vagrant/.rbenv/versions/2.6.3/bin/fastlane:23:in load' /Users/vagrant/.rbenv/versions/2.6.3/bin/fastlane:23:in <top (required)>’
[15:12:33]: Unable to obtain new session via fastlane spaceauth
±-----------------±-------------+
| Lane Context |
±-----------------±-------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios internal |
±-----------------±-------------+
[15:12:33]: Error in your Fastfile at line 105
[15:12:33]: 103: if new_session.nil?
[15:12:33]: 104: puts “Unable to obtain new session via fastlane spaceauth”
[15:12:33]: => 105: exit 1
[15:12:33]: 106: else
[15:12:33]: 107: new_session
±-----±---------------------------------------------±------------+
| fastlane summary |
±-----±---------------------------------------------±------------+
| Step | Action | Time (in s) |
±-----±---------------------------------------------±------------+
| 1 | default_platform | 0 |
| 2 | Switch to ios retrieve_fastlane_session lane | 0 |
±-----±---------------------------------------------±------------+
[15:12:33]: fastlane finished with errors
Fastlane command: (bundle “2.1.2” “exec” “fastlane” “internal”) failed
If you want to send an issue report to fastlane (Sign in to GitHub · GitHub), you can find the output of fastlane env in the following log file:
/Users/vagrant/deploy/fastlane_env.log
Command failed, error: exit status 1
| |
±–±--------------------------------------------------------------±---------+
| x | fastlane@2.6.0 (exit code: 1) | 50.28 sec|
±–±--------------------------------------------------------------±---------+
| Update available: 2.6.0 → 2.7.0 |
| Issue tracker: Issues · bitrise-steplib/steps-fastlane · GitHub |
| Source: GitHub - bitrise-steplib/steps-fastlane |
±–±--------------------------------------------------------------±---------+

Waiting for some help from the Bitrise team…

Hi @navisnmobilecicd,

The log would indicate that this is an issue with establishing a 2FA session with Apple via spaceauth.

Here are some general guidelines for avoiding these issues:

  1. Set an app-specific password.
  2. Make sure you’ve connected your Apple Developer account to Bitrise.

Further information on fastlane + CI + 2FA can be found here: https://docs.fastlane.tools/best-practices/continuous-integration/

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.