Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spawn EBUSY failedTask=build stackTrace=Error: spawn EBUSY #7791

Closed
iffy opened this issue Sep 22, 2023 · 1 comment · Fixed by #7798 or #7825 · May be fixed by vespasianvs/electron-builder#1
Closed

spawn EBUSY failedTask=build stackTrace=Error: spawn EBUSY #7791

iffy opened this issue Sep 22, 2023 · 1 comment · Fixed by #7798 or #7825 · May be fixed by vespasianvs/electron-builder#1

Comments

@iffy
Copy link
Contributor

iffy commented Sep 22, 2023

  • Electron-Builder Version: 24.6.3
  • Node Version: 16.19.1
  • Electron Version: ^26.1.0
  • Electron Type (current, beta, nightly): current
  • electron-updater version: 6.1.1
  • Target: Windows NSIS

I've seen a "spawn EBUSY" error twice in a row (after a very long build). I think it's failing during the upload of the executable to GitHub maybe?

Here's the error:

Successfully signed: D:\a\src\src\app\dist\Application-0.72.0.exe

                      Number of files successfully Signed: 1

Number of warnings: 0

Number of errors: 0


  • publishing      publisher=Github (owner: myowner, project: desktop, version: 0.72.0)
  • uploading       file=Application-0.72.0.exe provider=github
  ⨯ spawn EBUSY     failedTask=build stackTrace=Error: spawn EBUSY
    at ChildProcess.spawn (node:internal/child_process:420:11)
    at spawn (node:child_process:733:9)
    at execFile (node:child_process:331:17)
    at D:\a\src\src\app\node_modules\builder-util\src\util.ts:94:13
    at new Promise (<anonymous>)
    at exec (D:\a\src\src\app\node_modules\builder-util\src\util.ts:93:10)
    at execWine (D:\a\src\src\app\node_modules\app-builder-lib\src\wine.ts:11:16)
    at NsisTarget.computeScriptAndSignUninstaller (D:\a\src\src\app\node_modules\app-builder-lib\src\targets\nsis\NsisTarget.ts:398:21)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at NsisTarget.buildInstaller (D:\a\src\src\app\node_modules\app-builder-lib\src\targets\nsis\NsisTarget.ts:317:9)
    at NsisTarget.finishBuild (D:\a\src\src\app\node_modules\app-builder-lib\src\targets\nsis\NsisTarget.ts:133:9)
    at async Promise.all (index 4)
    at AsyncTaskManager.awaitTasks (D:\a\src\src\app\node_modules\builder-util\src\asyncTaskManager.ts:65:25)
    at Packager.doBuild (D:\a\src\src\app\node_modules\app-builder-lib\src\packager.ts:458:5)
    at executeFinally (D:\a\src\src\app\node_modules\builder-util\src\promise.ts:12:14)
    at Packager._build (D:\a\src\src\app\node_modules\app-builder-lib\src\packager.ts:376:31)
2023-09-22T15:27:37.668Z electron-builder Response: 200 OK, request options: {
  "protocol": "https:",
  "hostname": "api.github.com",
  "port": null,
  "path": "/repos/myowner/desktop/releases",
  "headers": {
    "accept": "application/vnd.github.v3+json",
    "authorization": "<stripped sensitive data>",
    "User-Agent": "electron-builder",
    "Cache-Control": "no-cache"
  }
}

Here's my relevant config:

    win: {
      rfc3161TimeStampServer: "http://timestamp.digicert.com",
      publisherName: "My Name",
      target: ["nsis", "portable"],
    },
    nsis: {
      perMachine: true,
    },

Anything else I can provide to help figure out what's going on? I'll try updating to 24.6.4 or 24.6.5, but the builds take a long time (and cost money), so I'd like to do as few debug builds as I can.

@iffy
Copy link
Contributor Author

iffy commented Sep 26, 2023

I've found the problem. Running the nsis and portable builds in parallel causes contention with some of the files. This change prevents that and my builds now succeed:

diff --git a/packages/app-builder-lib/src/targets/nsis/NsisTarget.ts b/packages/app-builder-lib/src/targets/nsis/NsisTarget.ts
index 1685f4c7..aab95bc2 100644
--- a/packages/app-builder-lib/src/targets/nsis/NsisTarget.ts
+++ b/packages/app-builder-lib/src/targets/nsis/NsisTarget.ts
@@ -42,6 +42,7 @@ export class NsisTarget extends Target {
 
   /** @private */
   readonly archs: Map<Arch, string> = new Map()
+  readonly isAsyncSupported = false;
 
   constructor(readonly packager: WinPackager, readonly outDir: string, targetName: string, protected readonly packageHelper: AppPackageHelper) {
     super(targetName)

I've submitted a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant