fastlane: GITLAB CI: Could not retrieve response as fastlane runs in non-interactive mode

New Issue Checklist

Issue Description

fastlane install_plugins script within the gitlab pipeline fails every time due to fastlane asking “Should fastlane modify the Gemfile at path ‘tmp/Gemfile’ for you?” but fastlane is running in non-interactive mode.

The main point of interest is here where the script is expecting an interaction but cannot get one for obvious reasons.

...
Installing plugin dependencies...
WARN [2020-10-05 03:15:52.70]: It looks like fastlane plugins are not yet set up for this project.
WARN [2020-10-05 03:15:52.70]: fastlane will modify your existing Gemfile at path '/tmp/Gemfile'
WARN [2020-10-05 03:15:52.70]: This change is necessary for fastlane plugins to work
WARN [2020-10-05 03:15:52.70]: Should fastlane modify the Gemfile at path '/tmp/Gemfile' for you?
...
Command executed

fastlane install_plugins --verbose

output

$ fastlane install_plugins --verbose
DEBUG [2020-10-05 03:15:52.64]: Checking if there are any plugins that should be loaded...
ERROR [2020-10-05 03:15:52.70]: It seems like you wanted to load some plugins, however they couldn't be loaded
ERROR [2020-10-05 03:15:52.70]: Please follow the troubleshooting guide: https://docs.fastlane.tools/plugins/plugins-troubleshooting/
Successfully loaded Appfile at path '/builds/companyname/frontend/app-name/fastlane/Appfile'
- json_key_file: '../google_play_api_key.json'
- package_name: 'com.companyname.appname'
- app_identifier: 'com.companyname.companynameappname'
- apple_id: 'francis@companyname.com'
-------
Installing plugin dependencies...
WARN [2020-10-05 03:15:52.70]: It looks like fastlane plugins are not yet set up for this project.
WARN [2020-10-05 03:15:52.70]: fastlane will modify your existing Gemfile at path '/tmp/Gemfile'
WARN [2020-10-05 03:15:52.70]: This change is necessary for fastlane plugins to work
WARN [2020-10-05 03:15:52.70]: Should fastlane modify the Gemfile at path '/tmp/Gemfile' for you?
Looking for related GitHub issues on fastlane/fastlane...
Search query: Could not retrieve response as fastlane runs in non-interactive mode
URL: https://api.github.com/search/issues?q=Could%20not%20retrieve%20response%20as%20fastlane%20runs%20in%20non-interactive%20mode+repo:fastlane/fastlane
➡️  Two-Step MFA keeps asking for 6-digit code even when entering latest from SMS
    https://github.com/fastlane/fastlane/issues/16647 [closed] 8 💬
    5 weeks ago
➡️  Fastlane Pilot fails after successfully uploaded and submission due to missing password
    https://github.com/fastlane/fastlane/issues/17069 [closed] 8 💬
    3 weeks ago
➡️  Could not retrieve response as fastlane runs in non-interactive mode
    https://github.com/fastlane/fastlane/issues/15548 [closed] 8 💬
    27 Feb 2020
and 48 more at: https://github.com/fastlane/fastlane/search?q=Could%20not%20retrieve%20response%20as%20fastlane%20runs%20in%20non-interactive%20mode&type=Issues&utf8=✓
/var/lib/gems/2.5.0/gems/fastlane-2.162.0/fastlane_core/lib/fastlane_core/ui/interface.rb:129:in `crash!': [!] Could not retrieve response as fastlane runs in non-interactive mode (FastlaneCore::Interface::FastlaneCrash)
	from /var/lib/gems/2.5.0/gems/fastlane-2.162.0/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb:156:in `verify_interactive!'
	from /var/lib/gems/2.5.0/gems/fastlane-2.162.0/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb:134:in `confirm'
	from /var/lib/gems/2.5.0/gems/fastlane-2.162.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
	from /var/lib/gems/2.5.0/gems/fastlane-2.162.0/fastlane/lib/fastlane/plugins/plugin_manager.rb:240:in `setup'
	from /var/lib/gems/2.5.0/gems/fastlane-2.162.0/fastlane/lib/fastlane/plugins/plugin_manager.rb:269:in `ensure_plugins_attached!'
	from /var/lib/gems/2.5.0/gems/fastlane-2.162.0/fastlane/lib/fastlane/plugins/plugin_manager.rb:177:in `install_dependencies!'
	from /var/lib/gems/2.5.0/gems/fastlane-2.162.0/fastlane/lib/fastlane/commands_generator.rb:312:in `block (2 levels) in run'
	from /var/lib/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
	from /var/lib/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
	from /var/lib/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
	from /var/lib/gems/2.5.0/gems/fastlane-2.162.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
	from /var/lib/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
	from /var/lib/gems/2.5.0/gems/fastlane-2.162.0/fastlane/lib/fastlane/commands_generator.rb:352:in `run'
	from /var/lib/gems/2.5.0/gems/fastlane-2.162.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
	from /var/lib/gems/2.5.0/gems/fastlane-2.162.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
	from /var/lib/gems/2.5.0/gems/fastlane-2.162.0/bin/fastlane:23:in `<top (required)>'
	from /usr/local/bin/fastlane:23:in `load'
	from /usr/local/bin/fastlane:23:in `<main>'
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1
.android:
    image: mingc/android-build-box:latest
    artifacts:
        paths:
            - fastlane/logs
    before_script:
        - export GRADLE_USER_HOME=$(pwd)/.gradle
        - export CI=1
        - GITLAB_CI=1
        - bundle install
        - fastlane env
        - fastlane install_plugins --verbose
    cache:
        paths:
            - .gradle/wrapper
            - .gradle/caches

Environment

 | Key                         | Value                                                       |
| --------------------------- | ----------------------------------------------------------- |
| OS                          | debian_based buster/sid                                     |
| Ruby                        | 2.5.1                                                       |
| Bundler?                    | true                                                        |
| Git                         | git version 2.17.1                                          |
| Installation Source         | /usr/local/bin/fastlane                                     |
| Host                        | Ubuntu 18.04.5 LTS debian_based buster/sid (4.19.78-coreos) |
| Ruby Lib Dir                | /usr/lib                                                    |
| OpenSSL Version             | OpenSSL 1.1.1  11 Sep 2018                                  |
| Is contained                | false                                                       |
| Is homebrew                 | false                                                       |
| Is installed via Fabric.app | false                                                       |
### System Locale
| Variable | Value       |   |
| -------- | ----------- | - |
| LANG     | en_US.UTF-8 | ✅ |
| LC_ALL   | en_US.UTF-8 | ✅ |
| LANGUAGE | en_US.UTF-8 | ✅ | 

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 18 (9 by maintainers)

Most upvoted comments

@rogerluan it looks like the Gemfile @ /tmp/Gemfile is used here by the mingc/android-build-box:latest docker image.

My .android yaml now looks like.

.android:
    image: mingc/android-build-box:latest
    artifacts:
        paths:
            - fastlane/logs
    before_script:
        - gem update --system
        - export GRADLE_USER_HOME=$(pwd)/.gradle
        - export BUNDLE_GEMFILE=$(pwd)/Gemfile
        - bundle install
        - fastlane install_plugins --verbose
    cache:
        paths:
            - .gradle/wrapper
            - .gradle/caches

Going to wait and see how that builds…

@rogerluan it looks like the Gemfile @ /tmp/Gemfile is used here by the mingc/android-build-box:latest docker image.

My .android yaml now looks like.

.android:
    image: mingc/android-build-box:latest
    artifacts:
        paths:
            - fastlane/logs
    before_script:
        - gem update --system
        - export GRADLE_USER_HOME=$(pwd)/.gradle
        - export BUNDLE_GEMFILE=$(pwd)/Gemfile
        - bundle install
        - fastlane install_plugins --verbose
    cache:
        paths:
            - .gradle/wrapper
            - .gradle/caches

Going to wait and see how that builds…

This has worked for me, with additional setting. Firebase authentication is required as well, described here. Generate a new Firebase token and set it as environment variable FIREBASE_TOKEN in Gitlab settings.