fastlane: Exception type: Spaceship::UnauthorizedAccessError

[✔] 🚀 [04:12:46]: fastlane detected a Gemfile in the current directory [04:12:46]: However, it seems like you didn’t use bundle exec [04:12:46]: To launch fastlane faster, please use [04:12:46]: [04:12:46]: $ bundle exec fastlane spaceauth [04:12:46]: [04:12:46]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile Logging into to App Store Connect (JamesShiporski113@hotmail.com)… Two-factor Authentication (6 digits code) is enabled for account ‘JamesShiporski113@hotmail.com’ 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

Please enter the 6 digit code you received at +86 ••• •••• ••25: 296173 Requesting session… 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: Spaceship::UnauthorizedAccessError

Looking for related GitHub issues on fastlane/fastlane…

➡️ fastlane spaceauth return Unauthorized Access https://github.com/fastlane/fastlane/issues/16197 [closed] 3 💬 26 Mar 2020

➡️ The request could not be completed because: Unauthorized Access https://github.com/fastlane/fastlane/issues/15411 [closed] 22 💬 08 Mar 2020

➡️ fastlane cert got Unauthorized Access error https://github.com/fastlane/fastlane/issues/16108 [closed] 62 💬 5 weeks ago

and 17 more at: https://github.com/fastlane/fastlane/search?q=The request could not be completed because%3A Unauthorized Access&type=Issues&utf8=✓

[!] The request could not be completed because: Unauthorized Access

[✔] 🚀 [04:13:46]: fastlane detected a Gemfile in the current directory [04:13:46]: However, it seems like you didn’t use bundle exec [04:13:46]: To launch fastlane faster, please use [04:13:46]: [04:13:46]: $ bundle exec fastlane env [04:13:46]: [04:13:46]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile [04:13:47]: Generating fastlane environment output, this might take a few seconds…

✅ fastlane environment ✅

Stack

Key Value
OS debian_based buster/sid
Ruby 2.5.1
Bundler? false
Git git version 2.17.1
Installation Source /usr/local/bin/fastlane
Host Ubuntu 18.04.3 LTS debian_based buster/sid (4.15.0-1057-aws)
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 C.UTF-8
LC_ALL
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do
  desc "Description of what the lane does"
  lane :custom_lane do
    # add actions here: https://docs.fastlane.tools/actions
  end
end

lane :register_ids do
	register_devices(
  		devices_file: "./ids.txt"
	)
end

#下载provisioning_profile
lane :adhoc_profile do
    #如果没有在Apple Developer创建证书的话,get_certificates会帮你自动创建证书
    #get_certificates
    sigh(
        username: 'JamesShiporski113@hotmail.com',
        app_identifier: 'net.fishing.*',
        force: true,
        provisioning_name: 'test_adhoc9',
        ignore_profiles_with_different_name: true,
        adhoc: true,
        filename: adhoc.mobileprovision
    )
end


`./fastlane/Appfile`
# app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app
# apple_id("[[APPLE_ID]]") # Your Apple email address
app_identifier("net.fishing.*")
apple_id("JamesShiporski113@hotmail.com")


# For more information about the Appfile, see:
#     https://docs.fastlane.tools/advanced/#appfile

fastlane gems

Gem Version Update-Status
fastlane 2.148.1 ✅ Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.2.0
slack-notifier 2.3.2
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 2.0.0
terminal-table 1.8.0
plist 3.5.0
CFPropertyList 3.0.2
public_suffix 2.0.5
addressable 2.7.0
multipart-post 2.0.0
word_wrap 1.0.0
tty-screen 0.7.1
tty-cursor 0.7.1
tty-spinner 0.9.3
babosa 1.0.3
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
fastimage 2.1.7
gh_inspector 1.1.3
mini_magick 4.10.1
multi_xml 0.6.0
rubyzip 1.3.0
security 0.1.3
xcpretty-travis-formatter 1.0.0
dotenv 2.7.5
bundler 2.1.4
naturally 2.2.0
simctl 1.6.8
jwt 2.1.0
uber 0.1.0
declarative 0.0.10
declarative-option 0.1.0
representable 3.0.4
retriable 3.1.2
mini_mime 1.0.2
httpclient 2.8.3
google-api-client 0.38.0
emoji_regex 1.0.1
nanaimo 0.2.6
colored2 3.1.2
claide 1.0.3
atomos 0.1.3
xcodeproj 1.16.0
unicode-display_width 1.7.0
excon 0.73.0
faraday 1.0.1
unf_ext 0.0.7.7
faraday_middleware 1.0.0
json 2.3.0
multi_json 1.14.1
signet 0.14.0
os 1.1.0
memoist 0.16.2
googleauth 0.12.0
digest-crc 0.5.1
google-cloud-errors 1.0.0
google-cloud-env 1.3.1
google-cloud-core 1.5.0
google-cloud-storage 1.26.1
aws-eventstream 1.1.0
aws-sigv4 1.1.3
aws-partitions 1.315.0
jmespath 1.4.0
aws-sdk-core 3.95.0
aws-sdk-kms 1.31.0
aws-sdk-s3 1.64.0
ipaddr 1.2.0
openssl 2.1.1
date 1.0.0
fileutils 1.0.2
psych 3.0.2
webrick 1.4.2

generated on: 2020-05-25

[04:13:48]: Take notice that this output may contain sensitive information, or simply information that you don't want to make public. [04:13:48]: Open https://github.com/fastlane/fastlane/issues/new to submit a new issue ✅

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 6
  • Comments: 35

Most upvoted comments

Fixed for me after remove /Users/username/.fastlane/spaceship/{email}/cookie

I was having the same problem. I removed the cookie file originally, but that didn’t work. I had to remove the {email} directory as well.

It took 2 executions of fastlane to work though. The first time I didn’t get the chance to enter the code, but the second run worked.

Suggestion by @notsubversion worked for me.

Removing the email directory at

/Users/username/.fastlane/spaceship/{email}/

and then running it twice did the job.

Nothing was working too since today.

By despair i went to Apple Developer, relogged on it, retry my lane after and it worked again… 🤔

Don’t know… maybe a weird account state in Apple Auth Server that my login reset ?!

I was using fastlane v2.141.0 and seeing the same issue. Updating to v2.149.1 fixed it.

Having this issue, nothing working 😢

✅ fastlane environment ✅

Stack

Key Value
OS 10.15.4
Ruby 2.6.3
Bundler? false
Git git version 2.26.2
Installation Source /usr/local/bin/fastlane
Host Mac OS X 10.15.4 (19E287)
Ruby Lib Dir /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
OpenSSL Version LibreSSL 2.8.3
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 11.5

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
update_fastlane

default_platform(:ios)

platform :ios do
  desc "Generate new localized screenshots"
  lane :screenshots do
    capture_screenshots(scheme: "RadiusTests")
  end
end

`./fastlane/Appfile`
app_identifier("net.multieducator.Radius") # The bundle identifier of your app
# apple_id("[[APPLE_ID]]") # Your Apple email address


# For more information about the Appfile, see:
#     https://docs.fastlane.tools/advanced/#appfile

fastlane gems

Gem Version Update-Status
fastlane 2.148.1 ✅ Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.3.0
slack-notifier 2.3.2
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 2.0.0
unicode-display_width 1.7.0
terminal-table 1.8.0
plist 3.5.0
public_suffix 2.0.5
addressable 2.7.0
multipart-post 2.0.0
word_wrap 1.0.0
tty-screen 0.7.1
tty-cursor 0.7.1
tty-spinner 0.9.3
babosa 1.0.3
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
excon 0.73.0
unf_ext 0.0.7.7
unf 0.1.4
domain_name 0.5.20190701
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
fastimage 2.1.7
gh_inspector 1.1.3
mini_magick 4.10.1
multi_xml 0.6.0
rubyzip 1.3.0
security 0.1.3
xcpretty-travis-formatter 1.0.0
dotenv 2.7.5
bundler 1.17.2
naturally 2.2.0
simctl 1.6.8
jwt 2.1.0
uber 0.1.0
declarative 0.0.10
declarative-option 0.1.0
representable 3.0.4
retriable 3.1.2
mini_mime 1.0.2
multi_json 1.14.1
signet 0.14.0
httpclient 2.8.3
google-api-client 0.38.0
emoji_regex 1.0.1
nanaimo 0.2.6
colored2 3.1.2
claide 1.0.3
CFPropertyList 3.0.2
atomos 0.1.3
xcodeproj 1.16.0
faraday 1.0.1
faraday_middleware 1.0.0
json 2.3.0
os 1.1.0
memoist 0.16.2
googleauth 0.12.0
digest-crc 0.5.1
google-cloud-errors 1.0.0
google-cloud-env 1.3.1
google-cloud-core 1.5.0
google-cloud-storage 1.26.1
aws-eventstream 1.1.0
aws-sigv4 1.1.3
aws-partitions 1.320.0
jmespath 1.4.0
aws-sdk-core 3.96.1
aws-sdk-kms 1.31.0
aws-sdk-s3 1.66.0
forwardable 1.2.0
logger 1.3.0
stringio 0.0.2
ipaddr 1.2.2
openssl 2.1.2
ostruct 0.1.0
strscan 1.0.0
date 2.0.0
fileutils 1.1.0
etc 1.0.1
io-console 0.4.7
zlib 1.0.0
libxml-ruby 3.1.0
rexml 3.1.9
psych 3.1.0
mutex_m 0.1.0
webrick 1.4.2

generated on: 2020-05-29

I was on v2.149.1 all the while. One fine day, the problem just goes away on its own 😉

I’ve tried all wordarounds above, and restarted OS but nothing worked. Still waiting for workaround here.

I hava this problem also. after delete .fastlane folder, it still perform the same.

env didn’t has FASTLANE_SESSION , delete fastlane and re-install gem install fastlane still has same problem.

fastlane spaceauth -u xxxxx

after re-install os-system, it return to normal. my os is ubuntu 18.04.

Logging into to App Store Connect (xxxxxxxxxxx@163.com)...
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: Spaceship::UnauthorizedAccessError

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

➡️  Exception type: Spaceship::UnauthorizedAccessError
    https://github.com/fastlane/fastlane/issues/16510 [open] 24 💬
    an hour ago

➡️  fastlane spaceauth return Unauthorized Access
    https://github.com/fastlane/fastlane/issues/16197 [closed] 3 💬
    2 weeks ago

➡️  The request could not be completed because: Unauthorized Access
    https://github.com/fastlane/fastlane/issues/15411 [closed] 22 💬
    08 Mar 2020

and 18 more at: https://github.com/fastlane/fastlane/search?q=The%20request%20could%20not%20be%20completed%20because%3A%0A%09Unauthorized%20Access&type=Issues&utf8=✓


[!] The request could not be completed because:
	Unauthorized Access

I just tried the workarounds and none working. Then tried to run FASTLANE_SESSION= in the terminal and then spaceauth again and it worked.

Nothing was working too since today.

By despair i went to Apple Developer, relogged on it, retry my lane after and it worked again… 🤔

Don’t know… maybe a weird account state in Apple Auth Server that my login reset ?!

What exactly did you do after you logged into Apple Developer?

+1. Yesterday it was fine, my team was deploying Testflight builds with no problem. Today none of it’s working and the workarounds mentioned above aren’t working.

Fixed for me after remove /Users/username/.fastlane/spaceship/{email}/cookie

No way