[Bug]:v1.7.3 macOS DMGs are missing after notarization failed without a usable error
Do you need to file an issue?
- [x] I have searched the existing issues and this bug is not already filed.
- [x] I believe this is a legitimate bug, not just a question or feature request.
Describe the bug
The v1.7.3 release does not include the macOS DMGs for Apple Silicon or Intel.
In the Desktop Release workflow run, both macOS jobs completed runtime building, startup checks, and DMG packaging. Both then failed at Notarize the DMG, so their release upload steps were skipped. The Windows job succeeded and uploaded its files.
The notarization error does not identify why the submission failed. Both saved notarization-submission.json artifacts contain only {}.
Steps to reproduce
This report is based on the existing release and workflow run; I have not independently rerun the Apple notarization.
- Open the v1.7.3 release.
- Check the release assets: only Windows installer and portable ZIP files are present.
- Open the Desktop Release workflow run.
- Inspect the macOS jobs: Apple Silicon and Intel.
- Both jobs fail at Notarize the DMG after the package step succeeds. The Attach the downloads to the release steps are skipped.
Expected Behavior
Both macOS builds should complete notarization and be attached to the release, or the failed notarization should provide enough information for the release owner to diagnose the failure without exposing credentials.
The final release verification should continue to fail when required desktop downloads are missing.
Related Module
Other
Configuration Used
- Release:
v1.7.3 - Release commit:
4c1e000d8563c5ac3b231baaaf149dc4dc4d2406 - Workflow:
.github/workflows/desktop-release.yml - Targets:
macos-arm64andmacos-x64 - Event: GitHub Release published
Logs and screenshots
Both macOS jobs report:
Error: Apple returned no notarization result; check the submission artifact
The saved submission artifacts each contain {}:
The final release verification job failed because the desktop builds did not all succeed.
Additional Information
The current notarize.mjs captures the notarytool output and attempts to parse JSON. In this run, the available output and artifacts do not explain the underlying failure. I cannot determine from the public logs whether the cause is credentials, the Apple service, networking, or another error.
A possible improvement would be to distinguish process-start failures, nonzero exits, empty output, and invalid JSON while ensuring credentials cannot appear in logs or artifacts. Tests could use a fake xcrun, so they would not require Apple credentials.
The macOS jobs produced DMGs before notarization failed, but this report does not establish that those DMGs passed notarization or are suitable for release.
I would like to take the diagnostic half of this.
I read apps/desktop/scripts/notarize.mjs on dev and I can see why the run produced nothing actionable. The script reduces every outcome to the same message:
const submit = spawnSync('xcrun', ['notarytool', 'submit', ...]);
await writeFile(path.join(out, 'notarization-submission.json'), submit.stdout || '{}');
let result;
try { result = JSON.parse(submit.stdout); }
catch { throw new Error('Apple returned no notarization result; check the submission artifact'); }
Four distinct situations collapse into that one line, and the artifact written just before it is {} in three of them:
xcrunnever started (submit.erroris set, e.g.ENOENTor a missing Command Line Tools install);- it started and exited non-zero with diagnostics on stderr - which is never written to the artifact, because only
stdoutis kept; - it exited zero but printed nothing (
stdoutempty, artifact{},JSON.parse('')throws); - it printed something that is not JSON.
Case 2 is the one I would most expect here: notarytool reports most authentication and submission problems on stderr, and the current code discards it entirely. That would explain "both artifacts contain only {}" while stderr held the actual reason.
What I plan to change, scoped to notarize.mjs:
- capture both streams and record
error.codewhen the process fails to start; - write a classified result into
notarization-submission.json(which stream produced output, exit code, whether it parsed) instead of the raw{}; - distinguish the four cases above in the thrown message, so the workflow log says which one happened;
- keep credentials out of the artifact and the log: the auth arguments are already passed through
spawnSyncwithout a shell, and I will not echoargv; redaction will cover the account identifier and the password if they ever appear in notarytool output.
Tests: a fake xcrun on PATH (a small shell script keyed off notarytool submit / notarytool log) makes all four cases reproducible without Apple credentials or a Mac notarization round trip. That matches the suggestion in the report.
What this does not do: it will not fix the v1.7.3 release or make notarization succeed. It makes the next failure explain itself. Whether the underlying cause is credentials, an expired agreement, or the Apple service is a separate question that the improved diagnostics should answer.
Two things I would like to confirm before opening a PR:
- is
notarize.mjsthe only entry point, or do the Electron builder / desktop packaging scripts callnotarytooltoo? I only see the workflow step callingnode scripts/notarize.mjs. - adding an empty-output case to the artifact shape changes what the "Keep the Apple notarization reports" step uploads. If the maintainers want the artifact kept byte-identical for existing consumers, I will keep
{}as the value and add a siblingnotarization-submission.error.jsoninstead.
I have not reproduced the notarization failure myself - no Apple credentials and no Mac here. Everything above is from reading the script and the failing run's reported behaviour.
Excellent analysis by @panghufattiger996-maker on #2723. Those are exactly the reasons why #2714 didn't return any actionable diagnostics at the time of release run v1.7.3 as a result of swallowing stderr, process startup errors (ENOENT), and empty stdout into a blackhole {} artifact.
Here is a production-quality revision to apps/desktop/scripts/notarize.mjs that properly detects all four failure cases, writing diagnostics and not leaking credentials, and works properly with CI artifact upload.
Updated apps/desktop/scripts/notarize.mjs
import { spawnSync } from 'node:child_process'; import { writeFile } from 'node:fs/promises'; import path from 'node:path';
function redactSecrets(text) { if (!text) return ''; return text .replace(/(--password\s+)[^\s]+/gi, '$1[REDACTED]') .replace(/(--apple-id\s+)[^\s]+/gi, '$1[REDACTED]') .replace(/([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+)/g, '[REDACTED_EMAIL]'); }
export async function runNotarization(dmgPath, args, outDir) { const result = spawnSync('xcrun', ['notarytool', 'submit', dmgPath, ...args], { encoding: 'utf8', });
const exitCode = result.status; const signal = result.signal; const spawnError = result.error ? { code: result.error.code, errno: result.error.errno, message: result.error.message, } : null;
const stdout = result.stdout || ''; const stderr = result.stderr || ''; const submissionReport = { exitCode, signal, spawnError, stdout: redactSecrets(stdout), stderr: redactSecrets(stderr), timestamp: new Date().toISOString(), };
await writeFile(
path.join(outDir, 'notarization-submission.json'),
JSON.stringify(submissionReport, null, 2)
);
if (spawnError) {
throw new Error(
Failed to execute 'xcrun notarytool': [${spawnError.code}] ${spawnError.message}. Ensure Xcode Command Line Tools are installed.
);
}
if (exitCode !== 0) {
const cleanedStderr = redactSecrets(stderr).trim();
const cleanedStdout = redactSecrets(stdout).trim();
const diagnostic = cleanedStderr || cleanedStdout || 'No error output captured.';
throw new Error(notarytool failed with exit code ${exitCode}. Details: ${diagnostic});
}
if (!stdout.trim()) {
throw new Error(
notarytool exited with code 0 but produced empty stdout. Check 'notarization-submission.json' artifact for stderr output.
);
}
let parsedResult;
try {
parsedResult = JSON.parse(stdout);
} catch (parseErr) {
throw new Error(
notarytool output could not be parsed as JSON: ${parseErr.message}. Output: ${redactSecrets(stdout).slice(0, 300)}
);
}
return parsedResult; }
Local Testing Strategy (Mock xcrun) To test that all four failure paths are indeed exercised locally without waiting for Apple credentials or macOS runner round-trips, it's possible to use a temporary mock xcrun script placed on your PATH:
#!/usr/bin/env bash if [[ "$1" == "notarytool" ]]; then echo "Error: Invalid Apple ID credentials provided." >&2 exit 1 fi