fastlane: "DEPRECATION WARNING: Faraday::Error::ConnectionFailed is deprecated! Use Faraday::ConnectionFailed instead." / Fastlane spaceauth: Could not login to App Store Connect

New Issue Checklist

Issue Description

A weird error appears when trying to login via spaceauth. I am not able to reproduce this locally. The error occurs on our servers. I also tried another server with a fresh IP, this did not resolve the problem.

Command executed

fastlane spaceauth

Complete output when running fastlane, including the stack trace and command used
# fastlane spaceauth
[✔] 🚀
[23:39:03]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
Username: xxx@xxx.xxx
Logging into to App Store Connect (xxx@xxx.xxx)...
-------------------------------------------------------------------------------------
Please provide your Apple Developer Program account credentials
You can also pass the password using the `FASTLANE_PASSWORD` environment variable
-------------------------------------------------------------------------------------
Password (for xxx@xxx.xxx): ***
Two-factor Authentication (6 digits code) is enabled for account 'xxx@xxx.xxx'
More information about Two-factor Authentication: https://support.apple.com/en-us/HT204915

If you're running this in a non-interactive session (e.g. server or CI)
check out https://github.com/fastlane/fastlane/tree/master/spaceship#2-step-verification

(Input `sms` to escape this prompt and select a trusted phone number to send the code as a text message)

(You can also set the environment variable `SPACESHIP_2FA_SMS_DEFAULT_PHONE_NUMBER` to automate this)
(Read more at: https://github.com/fastlane/fastlane/blob/master/spaceship/docs/Authentication.md#auto-select-sms-via-spaceship-2fa-sms-default-phone-number)

Please enter the 6 digit code:
xxxxxx
Requesting session...
DEPRECATION WARNING: Faraday::Error::ConnectionFailed is deprecated! Use Faraday::ConnectionFailed instead.
DEPRECATION WARNING: Faraday::Error::TimeoutError is deprecated! Use Faraday::TimeoutError instead.
Could not login to App Store Connect
Please check your credentials and try again.
This could be an issue with App Store Connect,
Please try unsetting the FASTLANE_SESSION environment variable
(if it is set) and re-run `fastlane spaceauth`

Exception type: RuntimeError

Looking for related GitHub issues on fastlane/fastlane...

➡️  "Can't modify frozen String" error when setting output_name in Gymfile via ENV[...]
    https://github.com/fastlane/fastlane/issues/8548 [closed] 6 💬
    18 Jun 2017

➡️  Exception running gym with ouput_name set to ENV variable
    https://github.com/fastlane/fastlane/issues/5206 [closed] 7 💬
    06 Dec 2016

➡️  Getting Exception on Wildcard App Identifier
    https://github.com/fastlane/fastlane/issues/3063 [closed] 3 💬
    22 Sep 2016

and 1 more at: https://github.com/fastlane/fastlane/search?q=can%27t%20modify%20frozen%20String&type=Issues&utf8=✓

/var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/client.rb:811:in `force_encoding': [!] can't modify frozen String (RuntimeError)
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/client.rb:811:in `log_response'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/client.rb:846:in `block in send_request'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/client.rb:620:in `with_retry'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/client.rb:844:in `send_request'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/client.rb:688:in `request'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/two_step_or_factor_client.rb:290:in `store_session'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/two_step_or_factor_client.rb:189:in `handle_two_factor'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/two_step_or_factor_client.rb:20:in `handle_two_step_or_factor'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/client.rb:494:in `send_shared_login_request'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/tunes/tunes_client.rb:127:in `send_login_request'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/client.rb:770:in `do_login'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/client.rb:384:in `login'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/client.rb:346:in `login'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/tunes/spaceship.rb:24:in `login'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/spaceauth_runner.rb:18:in `run'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/commands_generator.rb:43:in `block (2 levels) in run'
	from /var/lib/gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
	from /var/lib/gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
	from /var/lib/gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
	from /var/lib/gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/commands_generator.rb:49:in `run'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/spaceship/lib/spaceship/commands_generator.rb:14:in `start'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/fastlane/lib/fastlane/cli_tools_distributor.rb:111:in `take_off'
	from /var/lib/gems/2.3.0/gems/fastlane-2.131.0/bin/fastlane:23:in `<top (required)>'
	from /usr/local/bin/fastlane:22:in `load'
	from /usr/local/bin/fastlane:22:in `<main>'

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

I had this issue with ruby 2.7.0, fastlane 2.137.0, faraday v0.17.3 and faraday_middleware 0.13.1.

Downgrading to exactly ruby 2.5.3 and faraday 0.15.4 fixed it.

@janpio your PR will fix it in next release I suppose but for now:

add gem "faraday", "0.15.4" in your Gemfile run bundle install

Downgrade the ruby version to 2.6.5 worked for me.

So you can confirm lostisland/faraday#1039 fixes the problem? Then we can push for that to be 0.16.3 of faraday asap and be all happy again 😉

Yep, confirm that.

I solved it by downgrading faraday to the previous version (0.15.4)

I had this issue with ruby 2.7.0, fastlane 2.137.0, faraday v0.17.3 and faraday_middleware 0.13.1.

Downgrading to exactly ruby 2.5.3 and faraday 0.15.4 fixed it.

Yep - same problems here, but for me (and I assume you?) I needed to downgrade fastlane also to 2.131, b/c otherwise it wanted to use faraday > 0.15.4. So I added two lines to my Gemfile:

gem "fastlane", "2.131.0"
gem "faraday", "0.15.4"

and then ran bundle install.

And in case it helps someone else find this, my problems came about from trying to call fastlane deliver download_metadata in a shell command from inside my Fastfile.

Hi, I tried as @yenda suggest but still got the same error.

$ bundle info faraday
  * faraday (0.15.4)
        Summary: HTTP/REST API client library.
        Homepage: https://github.com/lostisland/faraday
        Path: /Library/Ruby/Gems/2.3.0/gems/faraday-0.15.4

Edit: I have no experiences with rubi before, so I eventually fix this by editing some files in /Library/Ruby/Gems/2.3.0/gems/faraday-0.16.2/ directly, following this https://github.com/lostisland/faraday/pull/1039 Of course this is not an elegant solution, but maybe this help someone.

In case it helps others, I also had success with reversions, but for me I was able to revert to ruby-2.6.3 + fastlane 2.131 and it worked - or I should say it exposed the real problem which is that I was attempting to rebuild certificates without having any devices in my profile (illegal: you must have devices to do a dev cert) and with the reverted versions I got a real error message, while with current-everything I got the frozen string error.

Easy enough workaround, and thanks for fastlane, even researching and doing this workaround was still faster than trying to do all the cert stuff myself 😃. Cheers.