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 2 years ago
  • Reactions: 15
  • Comments: 18 (1 by maintainers)

Most upvoted comments

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

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.

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