azure-devopselectronazure-pipelinescicdelectron-builder

electron-builder makensis process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE - no useful error?


I have an azure devops pipeline which uses electron-builder to package and publish a windows executable installer. It worked until recently, with no changes made to code or pipeline it began to fail and no cause can be found. I have the environment set to DEBUG=electron-builder to gather as much info as possible, but I'm still not seeing any useful error details.

Typically it would also do a --publish always but I have removed that because the error occurs without it.

Are there steps I can take to gain more information? Is there anything useful in the azure log here that I'm missing?

Command executed by the pipeline:

$ ../node_modules/.bin/cross-env '../node_modules/.bin/electron-builder' --win --x64 --config.productName={{application}}-UAT --config.extraMetadata.name={{project}}{{application}}-uat --config.publish.repo={{project}}{{application}}-qa

Log Data from pipeline



Output: "/__w/1/s/{{project}}-client/dist/{{application}}-UAT-v0.0.179.exe"
Install: 0 pages (0 bytes), 1 section (32792 bytes), 28 instructions (784 bytes), 2925 strings (23926 bytes), 26 language tables (4316 bytes).
Uninstall: 4 pages (320 bytes), 1 section (32792 bytes), 1802 instructions (50456 bytes), 8509 strings (108758 bytes), 26 language tables (8684 bytes).

Using zlib compression.

EXE header size:               57856 / 39424 bytes
Install code:                   9788 / 45834 bytes
Install data:                      0 / 8 bytes
Uninstall code+data:          124823 / 126184 bytes
CRC (0xDAF0DAE2):                  4 / 4 bytes

Total size:                   192471 / 211454 bytes (91.0%)
  • exited          command=makensis code=0 pid=1783
  • spawning        command=/__w/1/s/{{project}}-client/node_modules/app-builder-bin/linux/x64/app-builder wine --ia32 /__w/1/s/{{project}}-client/dist/{{application}}-UAT-v0.0.179.exe
  • execute command  command=wine /__w/1/s/{{project}}-client/dist/{{application}}-UAT-v0.0.179.exe workingDirectory=
  • command executed  executable=wine
                      errorOut=0034:err:module:process_init L"C:\\windows\\system32\\winemenubuilder.exe" not found
    002c:err:wineboot:process_run_key Error running cmd L"C:\\windows\\system32\\winemenubuilder.exe -a -r" (126).
    00b8:err:explorer:initialize_display_settings Failed to query current display settings for L"\\\\.\\DISPLAY1".
    
  • exited          command=app-builder code=0 pid=1784
  • spawning        command=/home/vsts_azpcontainer/.cache/electron-builder/nsis/nsis-3.0.4.1/linux/makensis -WX -INPUTCHARSET UTF8 -DAPP_ID=com.electron.{{project}}{{application}}-uat -DAPP_GUID=dd09bf3b-f027-58f7-988b-89c7b457f575 -DUNINSTALL_APP_KEY=dd09bf3b-f027-58f7-988b-89c7b457f575 -DPRODUCT_NAME={{application}}-UAT -DPRODUCT_FILENAME={{application}}-UAT -DAPP_FILENAME={{application}}-UAT -DAPP_DESCRIPTION={{project}} {{application}} Client Application -DVERSION=0.0.179 -DPROJECT_DIR=/__w/1/s/{{project}}-client/www -DBUILD_RESOURCES_DIR=/__w/1/s/{{project}}-client/www/build -DAPP_PACKAGE_NAME={{project}}{{application}}-uat -DMUI_ICON=/__w/1/s/{{project}}-client/dist/.icon-ico/icon.ico -DMUI_UNICON=/__w/1/s/{{project}}-client/dist/.icon-ico/icon.ico -DAPP_64=/__w/1/s/{{project}}-client/dist/{{project}}{{application}}-uat-0.0.179-x64.nsis.7z -DAPP_64_NAME={{project}}{{application}}-uat-0.0.179-x64.nsis.7z -DAPP_64_HASH=436CB5BA50C783C2102B9678AEF6A3E3334AE6D465BABB9C5989D5F5E546F0A23627FD1A6D397F0FD73C24A02930FC28465F55A5BAD2C8F97696A48B2DC96B46 -DCOMPANY_NAME={{company}} -DAPP_INSTALLER_STORE_FILE={{project}}{{application}}-uat-updater\installer.exe -DCOMPRESSION_METHOD=7z -DHIDE_RUN_AFTER_FINISH -DMULTIUSER_INSTALLMODE_ALLOW_ELEVATION -DINSTALL_MODE_PER_ALL_USERS_REQUIRED -DallowToChangeInstallationDirectory -DMENU_FILENAME={{company}} -DSHORTCUT_NAME={{application}}-UAT -DUNINSTALL_DISPLAY_NAME={{application}}-UAT -DMUI_WELCOMEFINISHPAGE_BITMAP=${NSISDIR}\Contrib\Graphics\Wizard\nsis3-metro.bmp -DMUI_UNWELCOMEFINISHPAGE_BITMAP=${NSISDIR}\Contrib\Graphics\Wizard\nsis3-metro.bmp -DESTIMATED_SIZE=1061717 -DCOMPRESS=auto -DUNINSTALLER_OUT_FILE=/__w/1/s/{{project}}-client/dist/__uninstaller-nsis-{{project}}{{application}}-uat.exe -XOutFile "/__w/1/s/{{project}}-client/dist/{{application}}-UAT-v0.0.179.exe" -XVIProductVersion 0.0.179.0 -XVIAddVersionKey /LANG=1033 ProductName "{{application}}-UAT" -XVIAddVersionKey /LANG=1033 ProductVersion "0.0.179" -XVIAddVersionKey /LANG=1033 LegalCopyright "Copyright © 2024 {{company}}" -XVIAddVersionKey /LANG=1033 FileDescription "{{project}} {{application}} Client Application" -XVIAddVersionKey /LANG=1033 FileVersion "0.0.179.20240816.4" -XVIAddVersionKey /LANG=1033 CompanyName "{{company}}" -XUnicode true -XSetCompressor zlib - cwd=/__w/1/s/{{project}}-client/node_modules/app-builder-lib/templates/nsis
Command line defined: "APP_ID=com.electron.{{project}}{{application}}-uat"
Command line defined: "APP_GUID=dd09bf3b-f027-58f7-988b-89c7b457f575"
Command line defined: "UNINSTALL_APP_KEY=dd09bf3b-f027-58f7-988b-89c7b457f575"
Command line defined: "PRODUCT_NAME={{application}}-UAT"
Command line defined: "PRODUCT_FILENAME={{application}}-UAT"
Command line defined: "APP_FILENAME={{application}}-UAT"
Command line defined: "APP_DESCRIPTION={{project}} {{application}} Client Application"
Command line defined: "APP_64=/__w/1/s/{{project}}-client/dist/{{project}}{{application}}-uat-0.0.179-x64.nsis.7z"
Command line defined: "APP_64_NAME={{project}}{{application}}-uat-0.0.179-x64.nsis.7z"
Command line defined: "APP_64_HASH=436CB5BA50C783C2102B9678AEF6A3E3334AE6D465BABB9C5989D5F5E546F0A23627FD1A6D397F0FD73C24A02930FC28465F55A5BAD2C8F97696A48B2DC96B46"
Command line defined: "COMPANY_NAME={{company}}"
Command line defined: "APP_INSTALLER_STORE_FILE={{project}}{{application}}-uat-updater\installer.exe"
Command line defined: "COMPRESSION_METHOD=7z"
Command line defined: "HIDE_RUN_AFTER_FINISH"
Command line defined: "MULTIUSER_INSTALLMODE_ALLOW_ELEVATION"
Command line defined: "INSTALL_MODE_PER_ALL_USERS_REQUIRED"
Command line defined: "allowToChangeInstallationDirectory"
Command line defined: "MENU_FILENAME={{company}}"
Command line defined: "SHORTCUT_NAME={{application}}-UAT"
Command line defined: "UNINSTALL_DISPLAY_NAME={{application}}-UAT"
Command line defined: "MUI_WELCOMEFINISHPAGE_BITMAP=${NSISDIR}\Contrib\Graphics\Wizard\nsis3-metro.bmp"
Command line defined: "MUI_UNWELCOMEFINISHPAGE_BITMAP=${NSISDIR}\Contrib\Graphics\Wizard\nsis3-metro.bmp"
Command line defined: "ESTIMATED_SIZE=1061717"
Command line defined: "COMPRESS=auto"
Command line defined: "UNINSTALLER_OUT_FILE=/__w/1/s/{{project}}-client/dist/__uninstaller-nsis-{{project}}{{application}}-uat.exe"
Processing script file: "<stdin>" (UTF8)
  • exited          command=makensis code=null pid=1847
  • async task error  error=/home/vsts_azpcontainer/.cache/electron-builder/nsis/nsis-3.0.4.1/linux/makensis process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
null
  ⨯ /home/vsts_azpcontainer/.cache/electron-builder/nsis/nsis-3.0.4.1/linux/makensis process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
null  failedTask=build stackTrace=Error: /home/vsts_azpcontainer/.cache/electron-builder/nsis/nsis-3.0.4.1/linux/makensis process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
null
    at ChildProcess.<anonymous> (/__w/1/s/{{project}}-client/node_modules/builder-util/src/util.ts:250:14)
    at Object.onceWrapper (events.js:520:26)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1088:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
error Command failed with exit code 1.

Edit: New information with diagnostics

The only yellow flag I'm seeing is the disk space is pretty low, but it doesn't go to 0. Should / Can I increase the agent disk space?

When electron-builder is executed, this information is provided

Most recent success: electron-builder version=22.8.0 os=6.5.0-1022-azure

Current failure: electron-builder version=23.6.0 os=6.5.0-1025-azure

It also failed with electron-builder version 22.8, I tried updating that. The os version is new though, I don't know how to control that or if that could be an issue.

Processing script file: "<stdin>" (UTF8)
##[debug]Agent environment resources - Disk: / Available 39.74 MB out of 74244.74 MB, Memory: Used 911.00 MB out of 6921.00 MB, CPU: Usage 61.30%
  • exited          command=makensis code=null pid=1852
  • async task error  error=/home/vsts_azpcontainer/.cache/electron-builder/nsis/nsis-3.0.4.1/linux/makensis process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
null
  ⨯ /home/vsts_azpcontainer/.cache/electron-builder/nsis/nsis-3.0.4.1/linux/makensis process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
null  failedTask=build stackTrace=Error: /home/vsts_azpcontainer/.cache/electron-builder/nsis/nsis-3.0.4.1/linux/makensis process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
null
    at ChildProcess.<anonymous> (/__w/1/s/ethos-client/node_modules/builder-util/src/util.ts:250:14)
    at Object.onceWrapper (events.js:520:26)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1088:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
/__w/1/s/ethos-client
Mon Aug 19 14:28:50 UTC 2024

##[debug]Exit code 0 received from tool '/usr/bin/bash'
##[debug]STDIO streams have closed for tool '/usr/bin/bash'
##[debug]task result: Succeeded
##[debug]Processed: ##vso[task.complete result=Succeeded;done=true;]
##[debug]Handler exit code: 0


Solution

  • According to the discussion in our comments, we found that the issue may have been caused by low disk space on the Microsoft-hosted agent and potential changes in the container image or agent image version. We tried enabling system diagnostics and setting system.debug to true for more verbose logs. We also compared logs from successful and failed runs and checked for updates in the container image.

    Finally, you solved the issue by switching the vmImage from ubuntu-latest to ubuntu-20.04. This change resolved the pipeline failures.

    I tested ubuntu-20.04 and ubuntu-22.04 images in my pipeline. I found that the free space of ubuntu-20.04 images seems to be 1G more than the free space on ubuntu-22.04 images. I guess it may be that the software versions on ubuntu-22.04 images are newer, which causes more space to be occupied.