Skip to content

Hard Crashes During Notarization Step #209

Open
@Bug-Reaper

Description

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • 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:

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 <subcommand>
  See 'notarytool --help' for more information.
at /Users/llama/Sorcery/releaseday/soundsafari/node_modules/@electron/notarize/lib/notarytool.js:120:23
    at Generator.next (<anonymous>)
    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.

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 (<anonymous>)
    at fulfilled (/Users/llama/Sorcery/releaseday/soundsafari/node_modules/@electron/notarize/lib/notarytool.js:28:58)
    at runMicrotasks (<anonymous>)
    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.

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions