Storing AppStoreConnect ApiKey to keychain failing

I am running Xcode 15.3. I have downloaded an app ApiKey that I am attempting to store in my keychain. I have an M3 Mac and running Sonoma 14.4.1.

From the command line I run xcrun notarytool store-credentials which prompts me to enter Profile name, Path to App Store Connect API private key, App Store Connect API Key ID, and App Store Connect API Issuer ID. I provide this info and only get the following:

Validating your credentials...

zsh: trace trap xcrun notarytool store-credentials

I am stuck here and need to resolve this. Any suggestions?

Answered by gulevich in 787940022

Generate a new Team API Key, set "Developer" permission on it, and use that for notarization.

This error happens when provided API Key is unauthenticated. This kind of error is handled incorrectly in Notary API REST (a plain text response is produced instead of JSON).

The problem is compounded by the undocumented fact, that Personal API Keys are not eligible for Notary API and one has to use a Team API Key with "Developer" permission for notarization.

Run above command with --verbose option I get this:

Validating your credentials... [16:39:00.503Z] Info [API] Initialized Notary API with base URL: https://appstoreconnect.apple.com/notary/v2/ [16:39:00.505Z] Info [API] Preparing GET request to URL: https://appstoreconnect.apple.com/notary/v2/test?, Parameters: [:], Custom Headers: private<Dictionary<String, String>> [16:39:00.505Z] Debug [JWT] Generating new JWT for key ID: ... zsh: trace trap xcrun notarytool store-credentials --verbose

Validating your credentials...
[16:39:00.503Z] Info [API] Initialized Notary API with base URL: https://appstoreconnect.apple.com/notary/v2/
[16:39:00.505Z] Info [API] Preparing GET request to URL: https://appstoreconnect.apple.com/notary/v2/test?, Parameters: [:], Custom Headers: private<Dictionary<String, String>>
[16:39:00.505Z] Debug [JWT] Generating new JWT for key ID: ...
zsh: trace trap  xcrun notarytool store-credentials --verbose

Running above command w/ --verbose option gives:

Validating your credentials...

[16:48:55.556Z] Info [API] Initialized Notary API with base URL: https://appstoreconnect.apple.com/notary/v2/

[16:48:55.557Z] Info [API] Preparing GET request to URL: https://appstoreconnect.apple.com/notary/v2/test?, Parameters: [:], Custom Headers: private<Dictionary<String, String>>

[16:48:55.558Z] Debug [JWT] Generating new JWT for key ID: ...

zsh: trace trap xcrun notarytool store-credentials --verbose

Did you find a workaround? I am getting the same issue.

@mammouth2727 Unfortunately I have not...

Accepted Answer

Generate a new Team API Key, set "Developer" permission on it, and use that for notarization.

This error happens when provided API Key is unauthenticated. This kind of error is handled incorrectly in Notary API REST (a plain text response is produced instead of JSON).

The problem is compounded by the undocumented fact, that Personal API Keys are not eligible for Notary API and one has to use a Team API Key with "Developer" permission for notarization.

Thank you @gulevich. I was using an Individual Key that I generated from the People tab of Users and Access. Based on your response I found Team Keys under the Integrations tab. I generated a Team Key, downloaded, and was then able run xcrun notarytool store-credentials using that key.

Storing AppStoreConnect ApiKey to keychain failing
 
 
Q