Recommended lane setup_circle_ci for Circle 2.0 iOS always crashes

I am trying to migrate our project to Circle 2.0. Following the guidelines, I added this to the Fastfile: setup_circle_ci

However, our build fails when executing this lane with the last output being:

[20:51:20]: Creating temporary keychain: “fastlane_tmp_keychain”.
[20:51:21]: Sending crash report…
[20:51:21]: The stack trace is sanitized so no personal information is sent.
[20:51:21]: To see what we are sending, look here: /home/circleci/.fastlane/latest_crash.json

Looking at the stack trace (pasted below), I can see that the error is being thrown by this line:
commands << Fastlane::Actions.sh("security create-keychain -p #{escaped_password} #{keychain_path}", log: false)
that can be found here.

This lane doesn’t expect anything from us, so we are kind of clueless of how to proceed to fix the error. Also, if I avoid using setup_circle_ci, the build also fails with the following message:

No such file or directory - security

Stacktrace:

{  
   “eventTime”:“2017-12-20T20:51:20+00:00",
   “serviceContext”:{  
      “service”:“fastlane”,
      “version”:“2.70.0”
   },
   “message”:“[SHELL_ERROR]: [fastlane_path]/fastlane/lib/fastlane/actions/create_keychain.rb:25:in `run'\n[fastlane_path]/fastlane/lib/fastlane/actions/setup_circle_ci.rb:38:in `setup_keychain’\n[fastlane_path]/fastlane/lib/fastlane/actions/setup_circle_ci.rb:10:in `run'\n[fastlane_path]/fastlane/lib/fastlane/runner.rb:253:in `block (2 levels) in execute_action’\n[fastlane_path]/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'\n[fastlane_path]/fastlane/lib/fastlane/runner.rb:231:in `block in execute_action’\n[fastlane_path]/fastlane/lib/fastlane/runner.rb:227:in `chdir'\n[fastlane_path]/fastlane/lib/fastlane/runner.rb:227:in `execute_action’\n[fastlane_path]/fastlane/lib/fastlane/runner.rb:148:in `trigger_action_by_name'\n[fastlane_path]/fastlane/lib/fastlane/fast_file.rb:146:in `method_missing’\nFastfile:30:in `block (2 levels) in parsing_binding'\n[fastlane_path]/fastlane/lib/fastlane/runner.rb:287:in `execute_flow_block’\n[fastlane_path]/fastlane/lib/fastlane/runner.rb:46:in `block in execute'\n[fastlane_path]/fastlane/lib/fastlane/runner.rb:45:in `chdir’\n[fastlane_path]/fastlane/lib/fastlane/runner.rb:45:in `execute'\n[fastlane_path]/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane’\n[fastlane_path]/fastlane/lib/fastlane/command_line_handler.rb:34:in `handle'\n[fastlane_path]/fastlane/lib/fastlane/commands_generator.rb:104:in `block (2 levels) in run’\n[gem_home]/gems/commander-fastlane-4.4.5/lib/commander/command.rb:178:in `call'\n[gem_home]/gems/commander-fastlane-4.4.5/lib/commander/command.rb:153:in `run’\n[gem_home]/gems/commander-fastlane-4.4.5/lib/commander/runner.rb:476:in `run_active_command'\n[fastlane_path]/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:66:in `run!‘\n[gem_home]/gems/commander-fastlane-4.4.5/lib/commander/delegates.rb:15:in `run!'\n[fastlane_path]/fastlane/lib/fastlane/commands_generator.rb:343:in `run’\n[fastlane_path]/fastlane/lib/fastlane/commands_generator.rb:42:in `start'\n[fastlane_path]/fastlane/lib/fastlane/cli_tools_distributor.rb:75:in `take_off’\n[fastlane_path]/bin/fastlane:20:in `<top (required)>'\n[gem_home]/bin/fastlane:21:in `load’\n[gem_home]/bin/fastlane:21:in `<top (required)>'\n/usr/local/lib/ruby/site_ruby/2.3.0/bundler/cli/exec.rb:75:in `load’\n/usr/local/lib/ruby/site_ruby/2.3.0/bundler/cli/exec.rb:75:in `kernel_load'\n/usr/local/lib/ruby/site_ruby/2.3.0/bundler/cli/exec.rb:28:in `run’\n/usr/local/lib/ruby/site_ruby/2.3.0/bundler/cli.rb:424:in `exec'\n/usr/local/lib/ruby/site_ruby/2.3.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run’\n/usr/local/lib/ruby/site_ruby/2.3.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'\n/usr/local/lib/ruby/site_ruby/2.3.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch’\n/usr/local/lib/ruby/site_ruby/2.3.0/bundler/cli.rb:27:in `dispatch'\n/usr/local/lib/ruby/site_ruby/2.3.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start’\n/usr/local/lib/ruby/site_ruby/2.3.0/bundler/cli.rb:18:in `start'\n/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/exe/bundle:30:in `block in <top (required)>‘\n/usr/local/lib/ruby/site_ruby/2.3.0/bundler/friendly_errors.rb:122:in `with_friendly_errors'\n/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.0/exe/bundle:22:in `<top (required)>‘\n[gem_home]/bin/bundle:104:in `load'\n[gem_home]/bin/bundle:104:in `<main>’”
}
1 Like

What platform are you running this on? macOS or Ubuntu/Docker?

This is part of my config.yml:

jobs:
  build:
    macos:
      xcode: "9.2.0"
    docker:
     - image: circleci/ruby:2.3

Seems like a wrong config, there should be either macos or docker.

1 Like