· 11 min read · Nadeera Silva
Fastlane "Could not receive latest API key": 2026 Fix
Apple removed the endpoint old fastlane used for its sign-in key, so Apple ID logins fail. Update fastlane, check Ruby, and move CI to an API key.

Your iOS release lane worked last week, and now fastlane stops at the Apple ID login with "Service key is empty" followed by "Could not receive latest API key from App Store Connect, this might be a server issue." If it started around 11 September 2026, or shows up today in an older project, it is not a server hiccup and retrying will not help. Apple removed the endpoint that older fastlane versions use to fetch a sign-in key, so the login never starts. The fix is a fastlane update, plus one Ruby check that catches a lot of CI setups.
Quick answer
Older fastlane fetched the App Store Connect sign-in key from GET /olympus/v1/app/config, which Apple removed in September 2026 and which now returns 404, so spaceship reports "Service key is empty" and then "Could not receive latest API key". Update fastlane to 2.241.0 or newer (2.242.0 today) with bundle update fastlane, commit the new Gemfile.lock, and run CI on Ruby 3.2 or later. For CI, switch the lane to an App Store Connect API key so it no longer needs an Apple ID login at all.
What this means for your app or business
While this error is happening, you cannot ship iOS builds through your automated pipeline. TestFlight uploads, App Store submissions and certificate renewals that use an Apple ID login all stop at the same step. Your app in the store is not affected, and nothing is wrong with your Apple account.
The fix is small: update one tool, sometimes update the Ruby version on the build server, and run the release again. A developer who knows the setup can usually do it in under an hour. It takes longer when the pipeline also runs on an old Ruby, or when the build was set up years ago by someone who has left. If a release is due and nobody on the team has touched the CI config before, this is a good moment to get help rather than guess.

Why does fastlane say "Could not receive latest API key from App Store Connect"?
Before fastlane can log in with an Apple ID, its spaceship library needs a public "widget key" that Apple's sign-in service expects in the X-Apple-Widget-Key header. It is not a secret and not your App Store Connect API key, despite the wording.
For years spaceship read that key from https://appstoreconnect.apple.com/olympus/v1/app/config?hostname=itunesconnect.apple.com. On 11 September 2026 people started reporting that this URL returned 404 (fastlane issue #30199). In fastlane 2.239.0 and older, the 404 page is HTML, the code looks for authServiceKey in it, finds nothing, raises "Service key is empty" and then wraps that as Spaceship::AppleTimeoutError with the "might be a server issue" text. That is why the message is misleading: it is neither a timeout nor a temporary problem.
I checked the endpoint today from my box:
curl -s -o /dev/null -w "%{http_code}\n" \
"https://appstoreconnect.apple.com/olympus/v1/app/config?hostname=itunesconnect.apple.com"
# 404The log usually also contains "Session loaded from environment variable is not valid. Continuing with normal login." or a similar line. An expired session is not the cause. It is just the reason fastlane tried a fresh Apple ID login and hit the broken key step.
Is this the same as the old 2019 and 2020 reports?
The same message showed up years ago for different reasons. Expo CLI users reported it in January 2020 (expo-cli #1442), with 2FA and antivirus software suggested as causes, and one Big Sur case in November 2020 turned out to be a firewall blocking Ruby (expo-cli #2954). On fastlane itself, #14750 was a permission error writing to /tmp, #14704 was a missing tmp folder on Windows, and #20629 (fastlane spaceauth, 2022) showed an SSL "certificate verify failed" error in the verbose log. Old fastlane caught every error in that method and printed the same sentence. If you are on fastlane 2.240.0 or newer and still see a failure here, the message now names the real HTTP status or network error, so read the lines above it.
How do I fix "Service key is empty" in fastlane?
1. Update fastlane in Gemfile.lock
Most projects run fastlane through Bundler, so the version that runs is the one pinned in Gemfile.lock, not the one installed on the machine. Set a minimum in the Gemfile so nobody can lock an affected version again:
source "https://rubygems.org"
# 2.241.0+ reads the sign-in key from appstoreconnect.apple.com/logout on every login
gem "fastlane", ">= 2.241.0"Then update only fastlane and commit both files:
bundle update fastlane # or: bundle lock --update fastlane
bundle exec fastlane --version
git add Gemfile Gemfile.lock
git commit -m "Update fastlane for the App Store Connect sign-in key change"I tested this on a lockfile pinned to 2.230.0. After changing the Gemfile and running bundle lock --update fastlane, the lock moved to fastlane (2.242.0).
2. Use Ruby 3.2 or newer in CI
The fixed versions need a newer Ruby than many old pipelines use. According to RubyGems, fastlane 2.230.0 required Ruby 2.6 or later, 2.239.0 to 2.240.1 require 3.1, and 2.241.0 and newer require 3.2 (2.242.0 suggests 3.3). On an old Ruby, the update fails at bundle install instead of at login. On GitHub Actions, pin Ruby with ruby/setup-ruby and let it install from your lockfile:
name: iOS release
on:
workflow_dispatch:
jobs:
testflight:
runs-on: macos-26
steps:
- uses: actions/checkout@v7
# fastlane 2.241.0 and newer need Ruby 3.2 or later
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true # runs bundle install from Gemfile.lock and caches gems
- name: Show the fastlane version this job really uses
run: bundle exec fastlane --version
- name: Upload to TestFlight
env:
ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
ASC_KEY_P8_BASE64: ${{ secrets.ASC_KEY_P8_BASE64 }}
run: bundle exec fastlane ios betaThe bundle exec fastlane --version step costs a second and shows which version the job really ran. GitHub's macOS 15 and macOS 26 arm64 images (23 Nov 2026) ship fastlane 2.242.0 globally, but that only matters if you call fastlane without Bundler.
3. Bitrise, Codemagic and Expo notes
- Bitrise: the Xcode Archive step embeds its own spaceship project for Apple ID code signing. Version 6.1.3 (24 Sep 2026) picked up fastlane 2.240.1 (steps-xcode-archive PR #434). If your workflow pins an older major or minor of that step, update it.
- Codemagic: the default Xcode 27.2 image (since 29 Nov 2026) has fastlane 2.241.2 preinstalled, but the Xcode 26.6 image still lists 2.236.1 (Codemagic Xcode 26.6 specs). If you run
bundle exec fastlane, your lockfile decides. If you pinned an older Xcode image and call plainfastlane, you get the old version. - Expo EAS: the EAS build images list fastlane per image, and images up to the Xcode 26.6 one (SDK 57) ship versions older than 2.240.0 (EAS build infrastructure). That only matters if a custom build step logs in to Apple with an Apple ID through fastlane on the worker.
4. Clear stale sessions and cached keys
Most people need nothing more than the update. If login still fails after it:
unset FASTLANE_SESSION SPACESHIP_SESSION # and remove the old value from your CI secrets
rm -f /tmp/spaceship_itc_service_key.txt # cache used by fastlane 2.239.0 and older
rm -f "${TMPDIR:-/tmp}/spaceship_itc_service_key.txt" # cache used by 2.240.x
rm -f ~/.fastlane/spaceship_itc_service_key.txt
rm -rf ~/.fastlane/spaceship/*/cookieShould I switch to an App Store Connect API key instead?
For CI, yes. An Apple ID login in CI means a password, a session cookie that expires, 2FA prompts and private web endpoints that Apple can change, which is what happened here. An App Store Connect API key (a .p8 file with a key ID and issuer ID) uses Apple's official API with a signed token, so none of the sign-in key steps run. Upload, TestFlight and code signing actions accept it:
default_platform(:ios)
platform :ios do
lane :beta do
# App Store Connect API key: no Apple ID, no SIRP login, no service key
api_key = app_store_connect_api_key(
key_id: ENV["ASC_KEY_ID"],
issuer_id: ENV["ASC_ISSUER_ID"],
key_content: ENV["ASC_KEY_P8_BASE64"],
is_key_content_base64: true
)
match(type: "appstore", readonly: true, api_key: api_key)
build_app(scheme: "Runner", export_method: "app-store")
upload_to_testflight(api_key: api_key, skip_waiting_for_build_processing: true)
end
endI covered creating the key and storing it as CI secrets in Fastlane 2FA on CI: use an App Store Connect API key. If match then complains about decrypting your certificates repo, see fastlane match "Couldn't decrypt the repo". The fastlane docs list which actions support API keys; a few account-level actions still need an Apple ID, so keep the fastlane update even after you switch.
How do I verify the fix?
Check that Apple still hands out the key where new fastlane looks. This sends no cookies and does not follow the redirect, so it signs nobody out:
curl -sI https://appstoreconnect.apple.com/logout | grep -iE "^HTTP|^location"My output on 30 Nov 2026, with the key shortened:
HTTP/2 302
location: https://idmsa.apple.com/appleauth/signout?widgetKey=e0b80c3b...&asop=destroy-session&asoc=/&rv=3Then ask your installed fastlane to fetch the key exactly as it does before a login. No Apple ID is needed:
# Fetch the App Store Connect service key the way spaceship does before an Apple ID login.
# No Apple ID, password or session is used. Prints only the key length and a short prefix.
require "spaceship"
puts "fastlane #{Fastlane::VERSION}, Ruby #{RUBY_VERSION}"
begin
key = Spaceship::PortalClient.new.send(:itc_service_key)
puts "OK: service key received (#{key.length} chars, starts #{key[0, 8]}...)"
rescue => e
puts "FAILED: #{e.class}: #{e.message}"
endRun it with bundle exec ruby check_key.rb in your project. On my box:
fastlane 2.230.0, Ruby 3.3.6
Service key is empty
FAILED: Spaceship::AppleTimeoutError: Could not receive latest API key from App Store Connect, this might be a server issue.
fastlane 2.242.0, Ruby 3.3.6
OK: service key received (64 chars, starts e0b80c3b...)If the old version is what your CI runs, you will see the first result in the build log too.
How do I stop this from happening again?
Pin a minimum (>= 2.241.0) instead of an exact old version, and let Dependabot open pull requests when fastlane releases a new version:
version: 2
updates:
- package-ecosystem: "bundler"
directory: "/ios" # the folder that holds Gemfile and Gemfile.lock
schedule:
interval: "weekly"
allow:
- dependency-name: "fastlane"Also print bundle exec fastlane --version in every CI run, keep Ruby on a supported version, and move CI from Apple ID logins to an API key. For signing problems on GitHub Actions in general, my GitHub Actions signing certificate guide covers the rest of the setup.
Versions and dates at a glance
| Item | Version or date | What it means |
|---|---|---|
| Endpoint removed | 11 Sep 2026 (first reports) | /olympus/v1/app/config returns 404 |
| fastlane 2.239.0 and older | Before 14 Sep 2026 | Fails with "Service key is empty" |
| fastlane 2.240.0 | 14 Sep 2026 | Reads the key from /logout, clearer errors |
| fastlane 2.240.1 | 15 Sep 2026 | Needs Ruby 3.1+, cache still read first |
| fastlane 2.241.0 | 10 Oct 2026 | Asks /logout on every login, needs Ruby 3.2+ |
| fastlane 2.242.0 | 16 Nov 2026 | Current release on 30 Nov 2026 |
| Bitrise Xcode Archive 6.1.3 | 24 Sep 2026 | Embedded fastlane 2.240.1 |
| Codemagic Xcode 27.2 image | Default since 29 Nov 2026 | fastlane 2.241.2 preinstalled |
Checklist
- Confirm the error: "Service key is empty" then "Could not receive latest API key from App Store Connect".
- Set
gem "fastlane", ">= 2.241.0"and runbundle update fastlane. - Commit both
GemfileandGemfile.lock. - Run CI on Ruby 3.2 or newer and print
bundle exec fastlane --version. - Update pinned Bitrise steps and older Codemagic or EAS images if you rely on their fastlane.
- Remove old
FASTLANE_SESSIONvalues and any hand-writtenspaceship_itc_service_key.txt. - Verify with
curl -sI https://appstoreconnect.apple.com/logoutand the Ruby check. - Move CI to an App Store Connect API key and add Dependabot for Bundler.
Frequently asked questions
What does "Could not receive latest API key from App Store Connect" mean in fastlane?
fastlane could not fetch the public sign-in key it needs before an Apple ID login. Since September 2026 the usual cause is that Apple removed the endpoint older fastlane versions read it from, so updating fastlane to 2.241.0 or newer fixes it.
Why does fastlane say "Service key is empty"?
In fastlane 2.239.0 and older, the request to olympus/v1/app/config now returns a 404 page instead of JSON, so no key is found. fastlane prints Service key is empty and then reports it as a possible server issue, even though retrying will not help.
Which fastlane version fixes the service key error?
fastlane 2.240.0 (14 Sep 2026) reads the key from the appstoreconnect.apple.com/logout redirect. 2.241.0 (10 Oct 2026) asks for it on every login instead of trusting a cached copy, and 2.242.0 is the current release.
Why does CI still fail after I updated fastlane?
CI usually installs the version pinned in Gemfile.lock, so run bundle update fastlane and commit the lockfile. Also check the Ruby version, because fastlane 2.241.0 and newer need Ruby 3.2 or later.
Does fastlane spaceauth fix Could not receive latest API key?
No. fastlane spaceauth uses the same Apple ID login, so on an old fastlane it fails at the same step. Update fastlane first, then create a new session with spaceauth only if you still need FASTLANE_SESSION.
Is an expired Apple ID session the cause?
Not by itself. An expired session is why fastlane starts a fresh Apple ID login, and on an old fastlane that fresh login is what fails while fetching the sign-in key.
Does an App Store Connect API key avoid this error?
Yes. With a .p8 API key fastlane signs a token and calls Apple's official API, so it never fetches the sign-in key or asks for 2FA. Upload, TestFlight and code signing actions support it.
Is my Apple developer account blocked?
No. The failure happens before fastlane even sends your password, so it says nothing about your account. You can still sign in to App Store Connect in a browser while CI shows this error.
Sources
- Apple ID login fails: Olympus app/config returns HTTP 404 ("Service key is empty"), issue #30199 (fastlane on GitHub, 2026-09-11)
- [spaceship] Read the App Store Connect API key from where Apple keeps it now, PR #30206 (fastlane on GitHub, 2026-09-12)
- [spaceship] Say what actually went wrong fetching the App Store Connect API key, PR #30205 (fastlane on GitHub, 2026-09-12)
- A stale cached service key makes every Apple ID login fail, issue #30291 (fastlane on GitHub, 2026-09-29)
- fastlane 2.240.0 release notes (fastlane on GitHub, 2026-09-14)
- fastlane 2.241.0 release notes (fastlane on GitHub, 2026-10-10)
- fastlane 2.242.0 release notes (fastlane on GitHub, 2026-11-16)
- fastlane versions and required Ruby versions (RubyGems.org)
- fix: bump the embedded fastlane to 2.240.1 for Apple ID login, PR #351 (Bitrise on GitHub, 2026-09-24)
- fix: bump go-xcode/v2 to pick up the fastlane 2.240.1 Apple ID login fix, PR #434 (Bitrise on GitHub, 2026-09-24)
- Xcode 26.6.x build machine specs (Codemagic Docs)
- Xcode 27.2.x build machine specs (Codemagic Docs)
- Build infrastructure (Expo Documentation)
- macOS 26 arm64 runner image readme (GitHub Actions runner images)
- Using App Store Connect API (fastlane docs)
- Creating API Keys for App Store Connect API (Apple Developer)
- Getting hit with "Could not receive latest API key" when running fastlane spaceauth, issue #20629 (fastlane on GitHub, 2022-09-07)
- Could not receive latest API key from App Store Connect, issue #1442 (Expo on GitHub, 2020-01-14)
- ruby/setup-ruby (Ruby on GitHub)
- Dependabot options reference (GitHub Docs)
Keep reading
- Fastlane 2FA on CI: Use an App Store Connect API Keyfastlane hangs on CI asking for a 2FA code? Switch match and TestFlight uploads to an App Store Connect API key, with a tested Fastfile and workflow.
- fastlane match password: Fix "Couldn't decrypt the repo"Why fastlane match says "Couldn't decrypt the repo" on GitHub Actions when your passphrase is right, and how to fix MATCH_PASSWORD for Flutter iOS builds.
- No Signing Certificate iOS Distribution Found: Flutter CI FixFlutter iOS builds failing in GitHub Actions with no signing certificate found? Import the .p12 and profile, sign manually and upload to TestFlight.
Comments
Share a question or note about this article.
Loading comments…