fastlane: setup_travis fails when run twice
New Issue Checklist
- Updated fastlane to the latest version
- I read the Contribution Guidelines
- I read docs.fastlane.tools
- I searched for existing GitHub issues
Issue Description
I have setup_travis at the top of my Fastfile, but use Fastlane to install dependencies, download certs via match, etc. as part of a before_install step in my .travis.yml. Fastlane is then used to run the tests in the script section.
This means that bundle exec fastlane NAME_OF_LANE is ran multiple times, with different lanes. This causes setup_travis to be ran multiple times, which appears to be failing because it is unable to create another temporary keychain with the same name.
Complete output when running fastlane, including the stack trace and command used
bundle exec fastlane bootstrap±------------------------------------------------±--------±--------------------------------+
| [32mUsed plugins[0m |
±------------------------------------------------±--------±--------------------------------+
| Plugin | Version | Action |
±------------------------------------------------±--------±--------------------------------+
| fastlane-plugin-latest_hockeyapp_version_number | 1.0.0 | latest_hockeyapp_version_number |
| fastlane-plugin-badge | 1.1.0 | add_badge |
±------------------------------------------------±--------±--------------------------------+
[14:52:16]: Sending anonymous analytics information
[14:52:16]: Learn more at https://docs.fastlane.tools/#metrics
[14:52:16]: No personal or sensitive data is sent.
[14:52:16]: You can disable this by adding
opt_out_usageat the top of your Fastfile[14:52:16]: [32m------------------------------[0m
[14:52:16]: [32m— Step: default_platform —[0m
[14:52:16]: [32m------------------------------[0m
[14:52:16]: [32m--------------------------[0m
[14:52:16]: [32m— Step: setup_travis —[0m
[14:52:16]: [32m--------------------------[0m
[14:52:16]: Creating temporary keychain: “fastlane_tmp_keychain”.
[14:52:16]: Enabling readonly mode for Travis
[14:52:16]: [32mDriving the lane ‘ios bootstrap’ 🚀[0m
[14:52:16]: [32m------------------------------------------------------[0m
[14:52:16]: [32m— Step: Switch to ios download_certificates lane —[0m
[14:52:16]: [32m------------------------------------------------------[0m
[14:52:16]: Cruising over to lane ‘ios download_certificates’ 🚖
[14:52:16]: [32m-------------------[0m
[14:52:16]: [32m— Step: match —[0m
[14:52:16]: [32m-------------------[0m
[…]
[14:52:18]: [32m[32mAll required keys, certificates and provisioning profiles are installed 🙌[0m
[14:52:18]: Setting Provisioning Profile type to ‘development’
[14:52:18]: [32m-------------------[0m
[14:52:18]: [32m— Step: match —[0m
[14:52:18]: [32m-------------------[0m
[…]
[14:52:20]: [32m[32mAll required keys, certificates and provisioning profiles are installed 🙌[0m
[14:52:20]: Setting Provisioning Profile type to ‘ad-hoc’
[14:52:20]: Cruising back to lane ‘ios bootstrap’ 🚘
[14:52:20]: [32m-----------------------------------------------------[0m
[14:52:20]: [32m— Step: Switch to ios install_dependencies lane —[0m
[14:52:20]: [32m-----------------------------------------------------[0m
[14:52:20]: Cruising over to lane ‘ios install_dependencies’ 🚖
±-----±--------------------------------------------------------------±------------+
| [32mfastlane summary[0m |
±-----±--------------------------------------------------------------±------------+
| Step | Action | Time (in s) |
±-----±--------------------------------------------------------------±------------+
| 1 | default_platform | 0 |
| 2 | setup_travis | 0 |
| 3 | Switch to ios download_certificates lane | 0 |
| 4 | match | 1 |
| 5 | match | 2 |
| 6 | Switch to ios install_dependencies lane | 0 |
±-----±--------------------------------------------------------------±------------+
[14:52:49]: [32mfastlane.tools finished successfully 🎉[0m
travis_time🔚04c7991f:start=1535986334279365000,finish=1535986369614674000,duration=35335309000 [0Ktravis_fold🔚install.3 [0Ktravis_time:start:2b339880 [0K$ if [ “$TRAVIS_PULL_REQUEST” != “false” ]; then bundle exec fastlane perform_pr_checks; fi
travis_time🔚2b339880:start=1535986369639130000,finish=1535986369656110000,duration=16980000 [0K
[32;1mThe command “if [ “$TRAVIS_PULL_REQUEST” != “false” ]; then bundle exec fastlane perform_pr_checks; fi” exited with 0.[0m
travis_time:start:0e448de0 [0K$ if [ “$TRAVIS_PULL_REQUEST” = “false” ]; then bundle exec fastlane test; fi
±------------------------------------------------±--------±--------------------------------+
| [32mUsed plugins[0m |
±------------------------------------------------±--------±--------------------------------+
| Plugin | Version | Action |
±------------------------------------------------±--------±--------------------------------+
| fastlane-plugin-latest_hockeyapp_version_number | 1.0.0 | latest_hockeyapp_version_number |
| fastlane-plugin-badge | 1.1.0 | add_badge |
±------------------------------------------------±--------±--------------------------------+
[14:52:53]: [32m------------------------------[0m
[14:52:53]: [32m— Step: default_platform —[0m
[14:52:53]: [32m------------------------------[0m
[14:52:53]: [32m--------------------------[0m
[14:52:53]: [32m— Step: setup_travis —[0m
[14:52:53]: [32m--------------------------[0m
[14:52:53]: Creating temporary keychain: “fastlane_tmp_keychain”.
Looking for related GitHub issues on fastlane/fastlane…
➡️ [33mColour codes included in slack message[0m
https://github.com/fastlane/fastlane/issues/48 [[32mclosed[0m] 5 💬 22 Sep 2016➡️ [33mFastlane won’t upload IPA to Crashlytics Beta[0m
https://github.com/fastlane/fastlane/issues/12945 [[32mclosed[0m] 7 💬 a week ago➡️ [33mUnable to upload ipa files to crashlytics[0m
https://github.com/fastlane/fastlane/issues/12602 [[32mclosed[0m] 7 💬 a day agoand 20 more at: https://github.com/fastlane/fastlane/search?q=Shell command exited with exit status 48 instead of 0.&type=Issues&utf8=✓
🔗 You can ⌘ + double-click on links to open them directly in your browser.
/Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `shell_error!': [31m[!] Shell command exited with exit status 48 instead of 0.[0m (FastlaneCore::Interface::FastlaneShellError)
from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/helper/sh_helper.rb:80:in `sh_control_output' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/helper/sh_helper.rb:12:in `sh' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/actions/create_keychain.rb:25:in `run' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/actions/setup_travis.rb:18:in `run' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/runner.rb:253:in `block (2 levels) in execute_action' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/runner.rb:232:in `block in execute_action' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/runner.rb:227:in `chdir' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/runner.rb:227:in `execute_action' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/fast_file.rb:149:in `method_missing' from Fastfile:6:in `parsing_binding' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/fast_file.rb:56:in `eval' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/fast_file.rb:56:in `block in parse' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/fast_file.rb:45:in `chdir' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/fast_file.rb:45:in `parse' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/fast_file.rb:35:in `initialize' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/lane_manager.rb:16:in `new' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/lane_manager.rb:16:in `cruise_lane' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:74:in `run!' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/commands_generator.rb:333:in `run' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/fastlane/lib/fastlane/cli_tools_distributor.rb:108:in `take_off' from /Users/travis/.rvm/gems/ruby-2.4.3/gems/fastlane-2.102.0/bin/fastlane:20:in `<top (required)>' from /Users/travis/.rvm/gems/ruby-2.4.3/bin/fastlane:23:in `load' from /Users/travis/.rvm/gems/ruby-2.4.3/bin/fastlane:23:in `<main>' from /Users/travis/.rvm/gems/ruby-2.4.3/bin/ruby_executable_hooks:15:in `eval' from /Users/travis/.rvm/gems/ruby-2.4.3/bin/ruby_executable_hooks:15:in `<main>'travis_time🔚0e448de0:start=1535986369678325000,finish=1535986374036503000,duration=4358178000 [0K
[31;1mThe command “if [ “$TRAVIS_PULL_REQUEST” = “false” ]; then bundle exec fastlane test; fi” exited with 1.[0m
I have cut down the log a little; I don’t want to leak some of the private URLs because this is for my job, plus the majority is output from successful steps inside the lanes. If the full output is required I will send it privately.
Environment
N/A (Problem on occurs on Travis)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 22 (7 by maintainers)
@Titozzz any updates on this? Case you’re too busy I have the capacity to PR it.
@Pranit-Harekar The related PR is merged, and it has been released with Fastlane version
2.115.0🎉 🍻 This issue can be closed now as it should be fixed 😄This should get merged into fastlane directly, you should open a pull request! ( Or I can if you can’t )
thanks @ojizero you rock
Sorry still had no time to do that
@Titozzz go for it 👍
@RacingWang @JosephDuffy What workarounds were used to resolve this? We’re still experiencing this with the most up to date fastlane.
I had the same problem when running on Microsoft Azure DevOps ( or VSTS as it used to be called). I ended up creating my own action based on
setup_circle_cireplacing thesetup_keychainfunction with something like this:Hope this helps someone.