Deploy-to-itunesconnect-application-loader step fails when using API key

deploy
ios
#1

I am using “deploy-to-itunesconnect-application-loader” step to upload the ipa to App Store.

If the step is configured with “itunescon_user” and “app_password”, the step works as expected.

However, if the step is configured with “api_key_path” and “api_issuer”, if fails with the following error.

$ xcrun “altool” “–upload-app” “-f” “/Users/vagrant/deploy/AppName.ipa” “–apiKey” “Bitrise” “–apiIssuer” “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”

2020-10-22 12:30:32.486 altool[7692:32128] *** Error: Server returned an invalid MIME type: text/plain, body: Unauthenticated

Request ID: DBXASD3RJ467KUXYLYBZ24KR2Y.0.0

2020-10-22 12:30:32.929 altool[7692:32120] *** Error: Error uploading ‘/Users/vagrant/deploy/AppName.ipa’.

2020-10-22 12:30:32.929 altool[7692:32120] *** Error: code -1011 (Failed to authenticate for session: (

“Error Domain=ITunesConnectionAuthenticationErrorDomain Code=-26000 “The server returned an invalid response. This may indicate that a network proxy is interfering with communication, or that Apple servers are having issues. Please try your request again later.” UserInfo={NSLocalizedRecoverySuggestion=The server returned an invalid response. This may indicate that a network proxy is interfering with communication, or that Apple servers are having issues. Please try your request again later., NSLocalizedDescription=The server returned an invalid response. This may indicate that a network proxy is interfering with communication, or that Apple servers are having issues. Please try your request again later., NSLocalizedFailureReason=App Store operation failed.}”

) Authentication failed.)

The same API key and Issuer ID was used previously to connect the Apple Developer account to Bitrise.

The build URL is https://app.bitrise.io/build/ad3db239e7e085c0
The Bitrise Support user for the app has been enabled.

Can anyone point out how to fix the issue?

1 Like

#2

The issue was observed because I had renamed the API key file.

The “deploy-to-itunesconnect-application-loader” step expects the filename of the API key to be in the form “AuthKey_XXXXXXXXXX.p8”.

After downloading the API key file from App Store Connect, I had renamed the file. This caused the issue. After renaming the file back to its old name, the issue is not observed.

0 Likes