electron / electron/notarize

Hard Crashes During Notarization Step

Open
#209 6 comments 3 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
193
Forks
41
Avg merge
4h 45m
Merged PRs (30d)
3

Description

### Pre-flight checklist

- [X] I have read the [contribution documentation](https://github.com/electron/forge/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project uses.
- [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

### Electron Forge version

7.4.0

### Electron version

29.X

### Operating system

Ventura 13.5

### Last known working Electron Forge version

N/A

### Expected behavior

App Gets Notarized

### Actual behavior

Hard crashes on a notary step:
```stderror
An unhandled rejection has occurred inside Forge:
Error: Failed to notarize via notarytool. Failed with unexpected result:

Error: SoundSafari.zip must be a zip archive (.zip), flat installer package (.pkg), or UDIF disk image (.dmg)
Usage: notarytool
See 'notarytool --help' for more information.
at /Users/llama/Sorcery/releaseday/soundsafari/node_modules/@electron/notarize/lib/notarytool.js:120:23
at Generator.next ()
at fulfilled (/Users/llama/Sorcery/releaseday/soundsafari/node_modules/@electron/notarize/lib/notarytool.js:28:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
```

### Steps to reproduce

This is the forge.config.js I was using, it's practically vanilla.
```javascript
const { FusesPlugin } = require('@electron-forge/plugin-fuses');
const { FuseV1Options, FuseVersion } = require('@electron/fuses');

module.exports = {
packagerConfig: {
name: 'SoundSafari',
buildVersion:"0.0.1",
icon:"./build/SoundSafari",
osxSign: {},
osxNotarize:{
tool: 'notarytool',
keychainProfile: '**************i'
},
asar: true,
dir:"./",
appCategoryType: 'public.app-category.developer-tools',
appBundleId:"SoundSafari",
appCategoryType:"public.app-category.music",
overwrite:"true",
junk:"true",
},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {
setupIcon:"./build/SoundSafari.icn"
},
},
{
name: '@electron-forge/maker-dmg',
config: {
background: './build/SoundSafariDmg.png'
}
},
{
name: '@electron-forge/maker-deb',
config: {},
},
{
name: '@electron-forge/maker-rpm',
config: {},
},
],
plugins: [
{
name: '@electron-forge/plugin-auto-unpack-natives',
config: {},
},
// Fuses are used to enable/disable various Electron functionality
// at package time, before code signing the application
new FusesPlugin({
version: FuseVersion.V1,
[FuseV1Options.RunAsNode]: false,
[FuseV1Options.EnableCookieEncryption]: true,
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
[FuseV1Options.OnlyLoadAppFromAsar]: true,
}),
],
};
```
----

### Personal Debug Notes
I'm doing this on an M1 Macbook Pro using `electron-forge make`.

- ✅ Problem still occurs if I target ZIP Instead of DMG.
- ✅ Problem still occurs if I run as sudo.
- ✅ Builds fine as DMG or ZIP if I remove `osxNotarize:{}` from config.

Doesn't appear to be a malformed path -- I forced a thrown error from `@electron/notarize/lib/notarytool.js` to get the array used to execute the `notarytool` command and the result is below.
```
An unhandled rejection has occurred inside Forge:
Error: notarytool,submit,/var/folders/lx/3zfzg6xd4_l1lzqbl04kb22h0000gn/T/electron-notarize-8Nl1Ck/SoundSafari.zip,--keychain-profile,***********,--wait,--output-format,json
at /Users/llama/Sorcery/releaseday/soundsafari/node_modules/@electron/notarize/lib/notarytool.js:112:19
at Generator.next ()
at fulfilled (/Users/llama/Sorcery/releaseday/soundsafari/node_modules/@electron/notarize/lib/notarytool.js:28:58)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
```

### Conclusion

My best guess at this point is the forge is trying to send it for notarization before it's fully copied into tmp storage or is otherwise causing the file to be malformed. It is a rather beefy app (~4Gib). Happy to assist if I have time w/a PR to fix.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.