ERR_ELECTRON_BUILDER_CANNOT_EXECUTE when trying to build a desktop app for Ubunto #881

Open
opened 2026-01-29 16:51:05 +00:00 by claunia · 0 comments
Owner

Originally created by @sam-wheat on GitHub (Apr 25, 2023).

I believe I am having a similar problem to what is found here and here. The error message I get is different so I will write a new issue. My goal is to produce a desktop app that will run on Linux. Per this issue I think what I am doing is supported.

Environment:

Windows 10 22H2 19045.2846

Visual Studio 2022 / latest

Unbutu running on WSL2 same physical machine as Windows

sam@UGLY:~/stuff/BlazorServerTest1$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy

dotnet, node and x11 are installed. xeyes/gedit runs correctly.

My app is Hello World, only mods from default Blazor template are to install Electron.Net
Electron.Net versions 23.6.1 and 23.6.2-alpha-13 - both give same result.

Steps to reproduce
On Windows open command line in .csproj folder:

dotnet electronize start

This works fine - Blazor runs in an Electron window.

In same command window:

C:\Projects\BlazorServerTest1\BlazorServerTest1>dotnet electronize build /target linux

Build Electron Application...
Arguments:
target = linux
Build ASP.NET Core App for linux-x64...
Executing dotnet publish in this directory: C:\Projects\BlazorServerTest1\BlazorServerTest1\obj\desktop\linux
Build ASP.NET Core App for linux-x64 under Release-Configuration...
dotnet publish -r linux-x64 -c "Release" --output "C:\Projects\BlazorServerTest1\BlazorServerTest1\obj\desktop\linux\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --self-contained
dotnet publish -r linux-x64 -c "Release" --output "C:\Projects\BlazorServerTest1\BlazorServerTest1\obj\desktop\linux\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --self-contained
MSBuild version 17.5.1+f6fdcf537 for .NET
Determining projects to restore...
Restored C:\Projects\BlazorServerTest1\BlazorServerTest1\BlazorServerTest1.csproj (in 345 ms).
BlazorServerTest1 -> C:\Projects\BlazorServerTest1\BlazorServerTest1\bin\Release\net6.0\linux-x64\BlazorServerTest1.dll
BlazorServerTest1 -> C:\Projects\BlazorServerTest1\BlazorServerTest1\obj\desktop\linux\bin\

Start npm install...
npm install --production

added 49 packages, and audited 50 packages in 8s

found 0 vulnerabilities

ElectronHostHook handling started...
Build Electron Desktop Application...
Executing electron magic in this directory: C:\Projects\BlazorServerTest1\BlazorServerTest1\bin\desktop
Create electron-builder configuration file...
node build-helper.js electron.manifest.json

Package Electron App for Platform linux...
npx electron-builder --config=./bin/electron-builder.json --linux --x64 -c.electronVersion=23.2.0
ΓÇó electron-builder version=23.6.0 os=10.0.19045
ΓÇó loaded configuration file=C:\Projects\BlazorServerTest1\BlazorServerTest1\obj\desktop\linux\bin\electron-builder.json
ΓÇó description is missed in the package.json appPackageFile=C:\Projects\BlazorServerTest1\BlazorServerTest1\obj\desktop\linux\package.json
ΓÇó packaging platform=linux arch=x64 electron=23.2.0 appOutDir=C:\Projects\BlazorServerTest1\BlazorServerTest1\bin\Desktop\linux-unpacked
ΓÇó scheduling remote build target=snap arch=x64
ΓÇó scheduling remote build target=appImage arch=x64
ΓÇó cannot get, wait error=Get "https://service.electron.build/find-build-agent?no-cache=1i4dems": dial tcp 51.15.76.176:443: connectex: No connection could be made because the target machine
actively refused it.
attempt=0
waitTime=2
ΓÇó cannot get, wait error=Get "https://service.electron.build/find-build-agent?no-cache=1i4dems": dial tcp 51.15.76.176:443: connectex: No connection could be made because the target machine
actively refused it.
attempt=1
waitTime=4
ΓÇó cannot get, wait error=Get "https://service.electron.build/find-build-agent?no-cache=1i4dems": dial tcp 51.15.76.176:443: connectex: No connection could be made because the target machine
actively refused it.
attempt=2
waitTime=6
Γ¿» Get "https://service.electron.build/find-build-agent?no-cache=1i4dems": dial tcp 51.15.76.176:443: connectex: No connection could be made because the target machine actively refused it.
Γ¿» C:\Users\sam\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1 failedTask=build stackTrace=Error: C:\Users\sam\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\app-builder-bin\win\x64\app-builder.exe process failed
ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
at ChildProcess. (C:\Users\sam\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\builder-util\src\util.ts:250:14)
at Object.onceWrapper (node:events:510:26)
at ChildProcess.emit (node:events:390:28)
at ChildProcess.cp.emit (C:\Users\sam\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1064:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
From previous event:
at processImmediate (node:internal/timers:464:21)
From previous event:
at RemoteBuilder.build (C:\Users\sam\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\app-builder-lib\src\remoteBuilder\RemoteBuilder.ts:51:28)
at RemoteTarget.finishBuild (C:\Users\sam\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\app-builder-lib\src\linuxPackager.ts:105:30)
at async Promise.all (index 2)
at AsyncTaskManager.awaitTasks (C:\Users\sam\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\builder-util\src\asyncTaskManager.ts:65:25)
at Packager.doBuild (C:\Users\sam\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\app-builder-lib\src\packager.ts:453:5)
at Object.executeFinally (C:\Users\sam\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\builder-util\src\promise.ts:12:14)
at Packager._build (C:\Users\sam\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\app-builder-lib\src\packager.ts:376:31)
at Packager.build (C:\Users\sam\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\app-builder-lib\src\packager.ts:337:12)
at Object.executeFinally (C:\Users\sam\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\builder-util\src\promise.ts:12:14)

... done

Despite the above error msg binaries are still produced in bin\Desktop\linux-unpacked\resources\bin.

Copy files in folder above to home folder in WSL file subsystem. In my case this is \\wsl.localhost\Ubuntu\home\sam\stuff\BlazorServerTest1

In a terminal window on the Linux VM run the following:

sam@UGLY:~/stuff/BlazorServerTest1$ chmod 777 BlazorServerTest1


sam@UGLY:~/stuff/BlazorServerTest1$ ./BlazorServerTest1

Unhandled exception. SocketIOClient.ConnectionException: Cannot connect to server 'http://localhost/'
---> System.TimeoutException: The operation has timed out.
--- End of inner exception stack trace ---
at SocketIOClient.SocketIO.ConnectAsync()
at ElectronNET.API.SocketIoFacade.Connect()
at ElectronNET.API.BridgeConnector.get_Socket()
at ElectronNET.API.WindowManager.CreateWindowAsync(BrowserWindowOptions options, String loadUrl)
at ElectronNET.API.WindowManager.CreateWindowAsync(String loadUrl)
at BlazorServerTest1.Program.ElectronBootstrap() in C:\Projects\BlazorServerTest1\BlazorServerTest1\Program.cs:line 80
at BlazorServerTest1.Program.<>c__DisplayClass0_0.<

b__0>d.MoveNext() in C:\Projects\BlazorServerTest1\BlazorServerTest1\Program.cs:line 36
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.<>c.b__128_1(Object state)
at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
at System.Threading.Thread.StartCallback()
Aborted

Am I supposed to have a HTTP server runing on the Linux machine? Error message references files on my windows machine.... IDK why.

Originally created by @sam-wheat on GitHub (Apr 25, 2023). I believe I am having a similar problem to what is found [here](https://github.com/ElectronNET/Electron.NET/issues/713) and [here](https://github.com/ElectronNET/Electron.NET/issues/750). The error message I get is different so I will write a new issue. My goal is to produce a desktop app that will run on Linux. Per [this issue](https://github.com/ElectronNET/Electron.NET/issues/597) I think what I am doing is supported. Environment: Windows 10 22H2 19045.2846 Visual Studio 2022 / latest Unbutu running on WSL2 same physical machine as Windows > sam@UGLY:~/stuff/BlazorServerTest1$ lsb_release -a > No LSB modules are available. > Distributor ID: Ubuntu > Description: Ubuntu 22.04.2 LTS > Release: 22.04 > Codename: jammy dotnet, node and x11 are installed. xeyes/gedit runs correctly. My app is Hello World, only mods from default Blazor template are to install Electron.Net Electron.Net versions 23.6.1 and 23.6.2-alpha-13 - both give same result. Steps to reproduce On Windows open command line in .csproj folder: dotnet electronize start This works fine - Blazor runs in an Electron window. In same command window: C:\Projects\BlazorServerTest1\BlazorServerTest1>dotnet electronize build /target linux > Build Electron Application... > Arguments: > target = linux > Build ASP.NET Core App for linux-x64... > Executing dotnet publish in this directory: C:\Projects\BlazorServerTest1\BlazorServerTest1\obj\desktop\linux > Build ASP.NET Core App for linux-x64 under Release-Configuration... > dotnet publish -r linux-x64 -c "Release" --output "C:\Projects\BlazorServerTest1\BlazorServerTest1\obj\desktop\linux\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --self-contained > dotnet publish -r linux-x64 -c "Release" --output "C:\Projects\BlazorServerTest1\BlazorServerTest1\obj\desktop\linux\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --self-contained > MSBuild version 17.5.1+f6fdcf537 for .NET > Determining projects to restore... > Restored C:\Projects\BlazorServerTest1\BlazorServerTest1\BlazorServerTest1.csproj (in 345 ms). > BlazorServerTest1 -> C:\Projects\BlazorServerTest1\BlazorServerTest1\bin\Release\net6.0\linux-x64\BlazorServerTest1.dll > BlazorServerTest1 -> C:\Projects\BlazorServerTest1\BlazorServerTest1\obj\desktop\linux\bin\ > Start npm install... > npm install --production > added 49 packages, and audited 50 packages in 8s > found 0 vulnerabilities > ElectronHostHook handling started... > Build Electron Desktop Application... > Executing electron magic in this directory: C:\Projects\BlazorServerTest1\BlazorServerTest1\bin\desktop > Create electron-builder configuration file... > node build-helper.js electron.manifest.json > Package Electron App for Platform linux... > npx electron-builder --config=./bin/electron-builder.json --linux --x64 -c.electronVersion=23.2.0 > ΓÇó electron-builder version=23.6.0 os=10.0.19045 > ΓÇó loaded configuration file=C:\Projects\BlazorServerTest1\BlazorServerTest1\obj\desktop\linux\bin\electron-builder.json > ΓÇó description is missed in the package.json appPackageFile=C:\Projects\BlazorServerTest1\BlazorServerTest1\obj\desktop\linux\package.json > ΓÇó packaging platform=linux arch=x64 electron=23.2.0 appOutDir=C:\Projects\BlazorServerTest1\BlazorServerTest1\bin\Desktop\linux-unpacked > ΓÇó scheduling remote build target=snap arch=x64 > ΓÇó scheduling remote build target=appImage arch=x64 > ΓÇó cannot get, wait error=Get "https://service.electron.build/find-build-agent?no-cache=1i4dems": dial tcp 51.15.76.176:443: connectex: No connection could be made because the target machine > actively refused it. > attempt=0 > waitTime=2 > ΓÇó cannot get, wait error=Get "https://service.electron.build/find-build-agent?no-cache=1i4dems": dial tcp 51.15.76.176:443: connectex: No connection could be made because the target machine > actively refused it. > attempt=1 > waitTime=4 > ΓÇó cannot get, wait error=Get "https://service.electron.build/find-build-agent?no-cache=1i4dems": dial tcp 51.15.76.176:443: connectex: No connection could be made because the target machine > actively refused it. > attempt=2 > waitTime=6 > Γ¿» Get "https://service.electron.build/find-build-agent?no-cache=1i4dems": dial tcp 51.15.76.176:443: connectex: No connection could be made because the target machine actively refused it. > Γ¿» C:\Users\sam\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE > Exit code: > 1 failedTask=build stackTrace=Error: C:\Users\sam\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\app-builder-bin\win\x64\app-builder.exe process failed > ERR_ELECTRON_BUILDER_CANNOT_EXECUTE > Exit code: > 1 > at ChildProcess.<anonymous> (C:\Users\sam\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\builder-util\src\util.ts:250:14) > at Object.onceWrapper (node:events:510:26) > at ChildProcess.emit (node:events:390:28) > at ChildProcess.cp.emit (C:\Users\sam\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\cross-spawn\lib\enoent.js:34:29) > at maybeClose (node:internal/child_process:1064:16) > at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) > From previous event: > at processImmediate (node:internal/timers:464:21) > From previous event: > at RemoteBuilder.build (C:\Users\sam\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\app-builder-lib\src\remoteBuilder\RemoteBuilder.ts:51:28) > at RemoteTarget.finishBuild (C:\Users\sam\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\app-builder-lib\src\linuxPackager.ts:105:30) > at async Promise.all (index 2) > at AsyncTaskManager.awaitTasks (C:\Users\sam\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\builder-util\src\asyncTaskManager.ts:65:25) > at Packager.doBuild (C:\Users\sam\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\app-builder-lib\src\packager.ts:453:5) > at Object.executeFinally (C:\Users\sam\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\builder-util\src\promise.ts:12:14) > at Packager._build (C:\Users\sam\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\app-builder-lib\src\packager.ts:376:31) > at Packager.build (C:\Users\sam\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\app-builder-lib\src\packager.ts:337:12) > at Object.executeFinally (C:\Users\sam\AppData\Local\npm-cache\_npx\009083ec26dc578f\node_modules\builder-util\src\promise.ts:12:14) > ... done Despite the above error msg binaries are still produced in `bin\Desktop\linux-unpacked\resources\bin`. Copy files in folder above to home folder in WSL file subsystem. In my case this is `\\wsl.localhost\Ubuntu\home\sam\stuff\BlazorServerTest1` In a terminal window on the Linux VM run the following: sam@UGLY:~/stuff/BlazorServerTest1$ chmod 777 BlazorServerTest1 sam@UGLY:~/stuff/BlazorServerTest1$ ./BlazorServerTest1 > Unhandled exception. SocketIOClient.ConnectionException: Cannot connect to server 'http://localhost/' > ---> System.TimeoutException: The operation has timed out. > --- End of inner exception stack trace --- > at SocketIOClient.SocketIO.ConnectAsync() > at ElectronNET.API.SocketIoFacade.Connect() > at ElectronNET.API.BridgeConnector.get_Socket() > at ElectronNET.API.WindowManager.CreateWindowAsync(BrowserWindowOptions options, String loadUrl) > at ElectronNET.API.WindowManager.CreateWindowAsync(String loadUrl) > at BlazorServerTest1.Program.ElectronBootstrap() in C:\Projects\BlazorServerTest1\BlazorServerTest1\Program.cs:line 80 > at BlazorServerTest1.Program.<>c__DisplayClass0_0.<<Main>b__0>d.MoveNext() in C:\Projects\BlazorServerTest1\BlazorServerTest1\Program.cs:line 36 > --- End of stack trace from previous location --- > at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state) > at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute() > at System.Threading.ThreadPoolWorkQueue.Dispatch() > at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() > at System.Threading.Thread.StartCallback() > Aborted Am I supposed to have a HTTP server runing on the Linux machine? Error message references files on my windows machine.... IDK why.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#881