Error with setup_circle_ci [RESOLVED]


#1

Hi,

i’ve being integrating iOS deployment, and faced a problem apparently connected with setup_circle_ci procedure

My Fastfile
# fastlane/Fastfile
default_platform :ios

platform :ios do
  before_all do
    setup_circle_ci
  end

  desc "Runs all the tests"
  lane :test do
    scan
  end

  desc "Ad-hoc build"
  lane :adhoc do
    match(type: "adhoc")
    gym(export_method: "ad-hoc")
  end
end
My circle.yml
version: 2
jobs:
  build:
    docker:
      - image: circleci/ruby:2.5.1
    macos:
      xcode: "9.3.1"
    environment:
      MATCH_PASSWORD: [password]
    steps:
      - checkout
      - run: bundle install
      - run:
          name: Fastlane
          command: bundle exec fastlane adhoc --verbose

And eventually i get this:

Circle build report
#!/bin/bash -eo pipefail
bundle exec fastlane adhoc --verbose
[⠋] 🚀 [⠙] 🚀 [⠹] 🚀 [⠸] 🚀 [⠼] 🚀 [⠴] 🚀 [⠦] 🚀 [✔] 🚀 
DEBUG [2018-06-26 16:46:48.37]: Checking if there are any plugins that should be loaded...
INFO [2018-06-26 16:46:48.39]: ------------------------------
INFO [2018-06-26 16:46:48.39]: --- Step: default_platform ---
INFO [2018-06-26 16:46:48.39]: ------------------------------
INFO [2018-06-26 16:46:48.39]: Driving the lane 'ios adhoc' 🚀
INFO [2018-06-26 16:46:48.40]: -----------------------------
INFO [2018-06-26 16:46:48.40]: --- Step: setup_circle_ci ---
INFO [2018-06-26 16:46:48.40]: -----------------------------
INFO [2018-06-26 16:46:48.40]: Creating temporary keychain: "fastlane_tmp_keychain".
WARN [2018-06-26 16:46:48.40]: Lane Context:
INFO [2018-06-26 16:46:48.40]: {:DEFAULT_PLATFORM=>:ios, :PLATFORM_NAME=>:ios, :LANE_NAME=>"ios adhoc"}
ERROR [2018-06-26 16:46:48.40]: Shell command exited with exit status 127 instead of 0.
INFO [2018-06-26 16:46:48.40]: Successfully generated documentation at path '/home/circleci/project/fastlane/README.md'

+------+------------------+-------------+
|           fastlane summary            |
+------+------------------+-------------+
| Step | Action           | Time (in s) |
+------+------------------+-------------+
| 1    | default_platform | 0           |
| 💥   | setup_circle_ci  | 0           |
+------+------------------+-------------+

ERROR [2018-06-26 16:46:48.41]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...
Search query: Shell command exited with exit status 127 instead of 0.

URL: https://api.github.com/search/issues?q=Shell%20command%20exited%20with%20exit%20status%20127%20instead%20of%200.+repo:fastlane/fastlane
➡️  Increment build number
    https://github.com/fastlane/fastlane/pull/127 [closed] 2 💬
    04 Feb 2017

➡️  Can't upload Android app to Crashlytics Beta
    https://github.com/fastlane/fastlane/issues/9389 [closed] 25 💬
    5 weeks ago

➡️  Shell command exited with exit status 1 instead of 0. with crashlytics
    https://github.com/fastlane/fastlane/issues/4347 [closed] 15 💬
    06 Dec 2016

and 6 more at: https://github.com/fastlane/fastlane/search?q=Shell%20command%20exited%20with%20exit%20status%20127%20instead%20of%200.&type=Issues&utf8=✓

bundler: failed to load command: fastlane (/usr/local/bundle/bin/fastlane)
FastlaneCore::Interface::FastlaneShellError: [!] Shell command exited with exit status 127 instead of 0.
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane_core/lib/fastlane_core/ui/interface.rb:153:in `shell_error!'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/helper/sh_helper.rb:80:in `sh_control_output'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/helper/sh_helper.rb:12:in `sh'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/actions/create_keychain.rb:25:in `run'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/actions/setup_circle_ci.rb:38:in `setup_keychain'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/actions/setup_circle_ci.rb:10:in `run'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/runner.rb:257:in `block (2 levels) in execute_action'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/runner.rb:236:in `block in execute_action'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/runner.rb:231:in `chdir'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/runner.rb:231:in `execute_action'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/fast_file.rb:149:in `method_missing'
  Fastfile:6:in `block (2 levels) in parsing_binding'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/runner.rb:289:in `execute_flow_block'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/runner.rb:46:in `block in execute'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/lane_manager.rb:59:in `cruise_lane'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/commands_generator.rb:107:in `block (2 levels) in run'
  /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
  /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
  /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:75:in `run!'
  /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/commands_generator.rb:332:in `run'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
  /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/cli_tools_distributor.rb:108:in `take_off'
  /usr/local/bundle/gems/fastlane-2.98.0/bin/fastlane:20:in `<top (required)>'
  /usr/local/bundle/bin/fastlane:23:in `load'
  /usr/local/bundle/bin/fastlane:23:in `<top (required)>'
Exited with code 1

Error briefly:

ERROR [2018-06-26 16:46:48.40]: Shell command exited with exit status 127 instead of 0.
INFO [2018-06-26 16:46:48.40]: Successfully generated documentation at path '/home/circleci/project/fastlane/README.md'

+------+------------------+-------------+
|           fastlane summary            |
+------+------------------+-------------+
| Step | Action           | Time (in s) |
+------+------------------+-------------+
| 1    | default_platform | 0           |
| 💥   | setup_circle_ci  | 0           |
+------+------------------+-------------+

ERROR [2018-06-26 16:46:48.41]: fastlane finished with errors

It’s absolutely unclear what the problem is, do you have some idea?


#2

If it has some sense, this is what i get doing $fastlane match development --readonly

Error accessing file, this might be due to fastlane's directory handling

Full report
circleci@fba0910e26f1:~/project/fastlane$ fastlane match development --readonly
[✔] 🚀 
development
[13:27:06]: Successfully loaded '/home/circleci/project/fastlane/Matchfile' 📄

+---------+------------------------------------------------------------------------+
|                        Detected Values from './Matchfile'                        |
+---------+------------------------------------------------------------------------+
| git_url | https://test:test@bitbucket.org/test/test
| type    | development                                                            |
+---------+------------------------------------------------------------------------+


+-----------------------+------------------------------------------------------------------------+
|                                    Summary for match 2.98.0                                    |
+-----------------------+------------------------------------------------------------------------+
| readonly              | true                                                                   |
| type                  | development                                                            |
| git_url               | https://test:test@bitbucket.org/test/test.git |
| git_branch            | master                                                                 |
| app_identifier        | ["app.bundle.id"]                                                 |
| username              | mymail@gmail.com                                                       |
| keychain_name         | login.keychain                                                         |
| team_id               | TEADMID                                                             |
| verbose               | false                                                                  |
| force                 | false                                                                  |
| skip_confirmation     | false                                                                  |
| shallow_clone         | false                                                                  |
| clone_branch_directly | false                                                                  |
| force_for_new_devices | false                                                                  |
| skip_docs             | false                                                                  |
| platform              | ios                                                                    |
+-----------------------+------------------------------------------------------------------------+

[13:27:06]: Cloning remote git repo...
[13:27:06]: If cloning the repo takes too long, you can use the `clone_branch_directly` option in match.
[13:27:07]: 🔓  Successfully decrypted certificates repo
[13:27:07]: Installing certificate...

[13:27:07]: Error accessing file, this might be due to fastlane's directory handling
[13:27:07]: Check out https://docs.fastlane.tools/advanced/#directory-behavior for more details

/usr/local/bundle/gems/fastlane-2.98.0/fastlane_core/lib/fastlane_core/helper.rb:259:in ``': No such file or directory - security (Errno::ENOENT)
	from /usr/local/bundle/gems/fastlane-2.98.0/fastlane_core/lib/fastlane_core/helper.rb:259:in `backticks'
	from /usr/local/bundle/gems/fastlane-2.98.0/fastlane_core/lib/fastlane_core/cert_checker.rb:98:in `block in wwdr_keychain'
	from /usr/local/bundle/gems/fastlane-2.98.0/fastlane_core/lib/fastlane_core/cert_checker.rb:97:in `each'
	from /usr/local/bundle/gems/fastlane-2.98.0/fastlane_core/lib/fastlane_core/cert_checker.rb:97:in `wwdr_keychain'
	from /usr/local/bundle/gems/fastlane-2.98.0/fastlane_core/lib/fastlane_core/cert_checker.rb:58:in `wwdr_certificate_installed?'
	from /usr/local/bundle/gems/fastlane-2.98.0/fastlane_core/lib/fastlane_core/cert_checker.rb:24:in `installed_identies'
	from /usr/local/bundle/gems/fastlane-2.98.0/fastlane_core/lib/fastlane_core/cert_checker.rb:12:in `installed?'
	from /usr/local/bundle/gems/fastlane-2.98.0/match/lib/match/runner.rb:113:in `fetch_certificate'
	from /usr/local/bundle/gems/fastlane-2.98.0/match/lib/match/runner.rb:57:in `run'
	from /usr/local/bundle/gems/fastlane-2.98.0/match/lib/match/commands_generator.rb:61:in `block (3 levels) in run'
	from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
	from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
	from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
	from /usr/local/bundle/gems/fastlane-2.98.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:75:in `run!'
	from /usr/local/bundle/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
	from /usr/local/bundle/gems/fastlane-2.98.0/match/lib/match/commands_generator.rb:146:in `run'
	from /usr/local/bundle/gems/fastlane-2.98.0/match/lib/match/commands_generator.rb:19:in `start'
	from /usr/local/bundle/gems/fastlane-2.98.0/fastlane/lib/fastlane/cli_tools_distributor.rb:100:in `take_off'
	from /usr/local/bundle/gems/fastlane-2.98.0/bin/fastlane:20:in `<top (required)>'
	from /usr/local/bundle/bin/fastlane:17:in `load'
	from /usr/local/bundle/bin/fastlane:17:in `<main>'

#3

It turned out that

docker:
      - image: circleci/ruby:2.5.1

in some way drives to Linux OS, wtf. Also, one should explicitly set

- run:
          name: Set Ruby Version
          command:  echo "ruby-2.3" > ~/.ruby-version

in order to work with gems fetching


#4

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