我有一个 Azure DevOps 管道,它使用 Electron-Builder 来打包和发布 Windows 可执行安装程序。 它一直有效,直到最近,在没有对代码或管道进行任何更改的情况下,它开始失败,并且找不到原因。 我将环境设置为 DEBUG=electron-builder 以收集尽可能多的信息,但我仍然没有看到任何有用的错误详细信息。
通常它也会执行
--publish always
但我已删除它,因为没有它就会发生错误。
我可以采取哪些措施来获取更多信息? 这里的天蓝色日志中是否有我遗漏的有用内容?
管道执行的命令:
$ ../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
从管道记录数据
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.
编辑:带有诊断的新信息
我看到的唯一黄色标志是磁盘空间非常低,但它不会达到 0。我应该/可以增加代理磁盘空间吗?
当执行 electro-builder 时,会提供此信息
最近的成功:电子构建器版本=22.8.0 os=6.5.0-1022-azure
当前故障:电子构建器版本=23.6.0 os=6.5.0-1025-azure
电子构建器版本 22.8 也失败了,我尝试更新它。 虽然操作系统版本是新的,但我不知道如何控制它或者这是否会成为问题。
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
根据我们评论中的讨论,我们发现该问题可能是由 Microsoft 托管代理上的磁盘空间不足以及容器映像或操作系统版本的潜在更改引起的。我们尝试启用系统诊断并将
system.debug
设置为 true 以获取更详细的日志。我们还比较了成功和失败运行的日志,并检查容器映像中的更新。
最后,您通过将
vmImage
从 ubuntu-latest
切换为 ubuntu-20.04
解决了问题。此更改解决了管道故障。
我在管道中测试了
ubuntu-20.04
和 ubuntu-22.04
图像。我发现ubuntu-20.04
图像的可用空间似乎比ubuntu-22.04
图像上的可用空间多了1G。我猜可能是ubuntu-22.04
图像上的软件版本较新,导致占用更多空间。