Skip to content

Notarization for arm64 version of app fails randomly but succeeds on retry #219

Open
@praneetloke

Description

I have an Electron app that is built and notarized using electron-builder. Notarization for the arm64 version of the app fails randomly without any additional information. The only log I have is this:

...
electron-notarize:spawn spawning cmd: xcrun args: [
  'notarytool',
  'submit',
  '/var/folders/5q/zcc7tkt11f13mhczs1yfd4qc0000gn/T/electron-notarize-PsiiWM/****.zip',
  '--apple-id',
  '*********',
  '--password',
  '*********',
  '--team-id',
  '*********',
  '--wait',
  '--output-format',
  'json'
] opts: {}
...
...
electron-notarize:spawn cmd xcrun terminated with code: null
electron-notarize:helpers work failed
  ⨯ Failed to notarize via notarytool.  Failed with unexpected result: 

  failedTask=build stackTrace=Error: Failed to notarize via notarytool.  Failed with unexpected result: 
                                                                                 at /Users/runner/work/****/****/node_modules/@electron/notarize/src/notarytool.ts:115:13
    at Generator.next (<anonymous>)
    at fulfilled (/Users/runner/work/****/****/node_modules/@electron/notarize/lib/notarytool.js:28:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
From previous event:
    at processImmediate (node:internal/timers:483:21)
From previous event:
    at readDirectoryAndSign (/Users/runner/work/****/****/node_modules/app-builder-lib/src/macPackager.ts:496:29)
    at MacPackager.signApp (/Users/runner/work/****/****/node_modules/app-builder-lib/src/macPackager.ts:506:11)
    at MacPackager.doSignAfterPack (/Users/runner/work/****/****/node_modules/app-builder-lib/src/platformPackager.ts:346:21)
    at MacPackager.doPack (/Users/runner/work/****/****/node_modules/app-builder-lib/src/platformPackager.ts:331:7)
    at MacPackager.pack (/Users/runner/work/****/****/node_modules/app-builder-lib/src/macPackager.ts:215:9)
    at Packager.doBuild (/Users/runner/work/****/****/node_modules/app-builder-lib/src/packager.ts:459:9)
    at executeFinally (/Users/runner/work/****/****/node_modules/builder-util/src/promise.ts:12:14)
    at Packager.build (/Users/runner/work/****/****/node_modules/app-builder-lib/src/packager.ts:393:31)
    at executeFinally (/Users/runner/work/****/****/node_modules/builder-util/src/promise.ts:12:14)

There is no other information about the failure. In a successful execution, the exit code is 0 which is expected. I have set DEBUG=electron-notarize* as per the README in this repo but it doesn't seem to help with emitting any additional information about the failure. Any help/tips on diagnosing this would be appreciated.

EDIT Jan 2025:
See #219 (comment). If you are using GitHub Actions:

  • and have noticed that the build fails randomly despite having accepted all pending Apple Terms
  • and are using macos-latest
  • downgrade your runner to macos-13.
    • macos-13 runner is an Intel-based runner with 14GB RAM.

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions