lando / notarize-action

A GitHub action to Apple notarize files. Originally adapted from https://github.com/devbotsxyz/xcode-notarize
GNU General Public License v3.0
7 stars 1 forks source link

notarytool throws Unexpected end of JSON input #26

Closed drale2k closed 4 months ago

drale2k commented 1 year ago

I was not able to make it working using notarytool, the default, as it was always throwing the following error during the notarization step:

Run lando/notarize-action@v2
Archiving Application
Notarizing with notarytool
Error: Notarization failed with an unexpected error: Unexpected end of JSON input

I got it working by switching the tool to altool:

...
with:
  product-path: dist/myapp.app
  appstore-connect-username: ${{ secrets.APPLE_ID }}
  appstore-connect-password: ${{ secrets.APPLE_ID_PASSWORD }}
  appstore-connect-team-id: XYZ
  tool: altool

Leaving this here in case anyone bumps his head for 30 mins like i did.

zkovari commented 1 year ago

I had the same problem today but I just had a pending signature on my apple developer account - about some policy change or whatever. After I signed it, it worked well. Unfortunately, by the time I ran this action again with the verbose option (which you could try as well) I already signed the said document, so I'm not sure where the json error came from. Is it a parsing error in the action, or the notarytool CLI itself? I'm not sure.

Changing to altool doesn't really solve anything, since it's already deprecated.

aatishparsonscode commented 7 months ago

For me I was first missing the 'teamId" when I ran build, and then the "ascProvider" property when I ran package, adding them at each step to await notarize({... (inside notarize.js) seemed to work

drale2k commented 5 months ago

Now that altool can no longer be used i had to go back to notarytool and i am again running in to the same issue. Any workaround? None of the above options are relevant to me

I turned on verbosity, and it seems the error is caused by the Apple API returning a 403


[00:50:31.410Z] Debug [AUTHENTICATION] Authenticating request to '/notary/v2/submissions' with WebServices Token. AppleID: ***, Team ID: ***, Token: private<String>
[00:50:31.410Z] Debug [TASKMANAGER] Starting Task Manager loop to wait for asynchronous HTTP calls.
[00:50:31.812Z] Debug [API] Received response status code: [40](https://github.com/***/actions/runs/8916943471/job/24489222323#step:7:42)3, message: forbidden, URL: https://appstoreconnect.apple.com/notary/v2/submissions?, Correlation Key: QFXCNMW2IPA3CPU2FBQXG***
[00:50:31.813Z] Error [API] Received non-JSON response body from Notary API, URL: https://appstoreconnect.apple.com/notary/v2/submissions?
drale2k commented 4 months ago

Turns out my Team ID changed for whatever reason. Verbose logging made that clear.