notarize: The staple and validate action failed! Error 65.

Stapling the app using electron-builder afterSign hook and the following script:

await electron_notarize.notarize({
  tool: "notarytool",
  appBundleId: appId,
  appPath: appPath,
  appleId: process.env.APPLE_ID,
  appleIdPassword: process.env.APPLE_ID_PASSWORD,
  teamId: process.env.APPLE_TEAM_ID,
});

Yeilds this error for me:

CloudKit query for Parallel.app (2/de1888131cc20e39522d0986cb6fe9cab1d86146) failed due to "Record not found".
Could not find base64 encoded ticket in response for 2/de1888131cc20e39522d0986cb6fe9cab1d86146
The staple and validate action failed! Error 65.

I am running MacOS Ventura 13.0.1. Thank you!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 15
  • Comments: 18 (1 by maintainers)

Most upvoted comments

My conclusion is also that this could be a wrong certificate.

The issue is that the notarize function will return 0 and the json response indicates that is invalid. electron/notarize does not parse the json and always proceeds to try to staple which fails. You can try yourself with something like this.

cd dist/mac-universal
ditto -c -k --sequesterRsrc --keepParent 'App.app' '${HOME}/app/App.zip'
xcrun notarytool submit "./App.zip" --apple-id "user" --password "pass" --team-id "team" --wait --output-format json 

@CodyQuiz Out of curiosity what type of certificate are you using? I think I used “Apple Development”. I would also like to distribute outside of appstore as a standalone app.

First i used Apple Distribution and it caused the error 65. Then I switched to the Developer ID Application certificate and it works fine.

I actually figured it out. I didn’t have the right kind of certificate. Once I got that taken care of, it worked.

Ah yeah, I’m not sure there is anything we can do in @electron/notarize to automatically detect this but notarization only works on “Developer ID” certificates so you have to be sure you’re using the right type of certificate

My conclusion is also that this could be a wrong certificate. The issue is that the notarize function will return 0 and the json response indicates that is invalid. electron/notarize does not parse the json and always proceeds to try to staple which fails. You can try yourself with something like this.

cd dist/mac-universal
ditto -c -k --sequesterRsrc --keepParent 'App.app' '${HOME}/app/App.zip'
xcrun notarytool submit "./App.zip" --apple-id "user" --password "pass" --team-id "team" --wait --output-format json 

@CodyQuiz Out of curiosity what type of certificate are you using? I think I used “Apple Development”. I would also like to distribute outside of appstore as a standalone app.

First i used Apple Distribution and it caused the error 65. Then I switched to the Developer ID Application certificate and it works fine.

Yup sorry for late reply but this fixed it for me too

Anyone had any luck here? I am seeing the same thing on Monterey M2.

As for me I realized that i used wrong certificate. I tried to notarize app that will distribute outside the app store with certificate for app store. After I added correct one the issue was solved. So it’s just was my mistake. Not sure that it can help someone but at least help to avoid same error.

Anyone had any luck here? I am seeing the same thing on Monterey M2.

@r0hin ty for updates. Seems like i should do the same. But also looks like the issue is still actual.

What I did was I installed Xcode separately and manually used notarytool and stapler to notarize, which seemed to work. Seems there is a disconnect between that process and this library somewhere.

Any updates here? Running into the same issue