[COMPASS-4127] Windows ffmpeg.dll failed to sign Created: 03/Feb/20  Updated: 29/Oct/23  Resolved: 03/Feb/20

Status: Closed
Project: Compass
Component/s: CI, Release
Affects Version/s: None
Fix Version/s: 1.21.0

Type: Task Priority: Major - P3
Reporter: Lucas Hrabovsky (Inactive) Assignee: Lucas Hrabovsky (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
causes COMPASS-4129 Upgrade windows installer libraries f... Closed
Related
is related to COMPASS-4122 Windows builds failing Closed
Epic Link: COMPASS-3417
Sprint: Iteration Vicuña

 Description   

[2020/01/31 12:46:54.956] 2020-01-31T17:46:54.950Z electron-windows-installer:main Created NuSpec file:
[2020/01/31 12:46:54.956] <?xml version="1.0" encoding="utf-8"?>
[2020/01/31 12:46:54.956] <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
[2020/01/31 12:46:54.956]   <metadata>
[2020/01/31 12:46:54.956]     <id>MongoDBCompassCommunityDev</id>
[2020/01/31 12:46:54.956]     <title>MongoDB Compass Community Dev</title>
[2020/01/31 12:46:54.956]     <version>1.21.0-dev</version>
[2020/01/31 12:46:54.956]     <authors>MongoDB Inc</authors>
[2020/01/31 12:46:54.956]     <owners>MongoDB Inc</owners>
[2020/01/31 12:46:54.956]     <iconUrl>https://compass.mongodb.com/favicon.ico</iconUrl>
[2020/01/31 12:46:54.956]     <requireLicenseAcceptance>false</requireLicenseAcceptance>
[2020/01/31 12:46:54.956]     <description>The MongoDB GUI</description>
[2020/01/31 12:46:54.956]     <copyright>Copyright © 2020 MongoDB Inc</copyright>
[2020/01/31 12:46:54.956]   </metadata>
[2020/01/31 12:46:54.956]   <files>
[2020/01/31 12:46:54.956]     <file src="locales\**" target="lib\net45\locales" />
[2020/01/31 12:46:54.956]     <file src="resources\**" target="lib\net45\resources" />
[2020/01/31 12:46:54.956]     <file src="*.bin" target="lib\net45" />
[2020/01/31 12:46:54.956]     <file src="*.dll" target="lib\net45" />
[2020/01/31 12:46:54.956]     <file src="*.pak" target="lib\net45" />
[2020/01/31 12:46:54.956]     <file src="*.exe.config" target="lib\net45" />
[2020/01/31 12:46:54.956]     <file src="*.exe.sig" target="lib\net45" />
[2020/01/31 12:46:54.956]     <file src="icudtl.dat" target="lib\net45\icudtl.dat" />
[2020/01/31 12:46:54.956]     <file src="Squirrel.exe" target="lib\net45\squirrel.exe" />
[2020/01/31 12:46:54.956]     <file src="LICENSE" target="lib\net45\LICENSE" />
[2020/01/31 12:46:54.956]     <file src="MongoDBCompassCommunityDev.exe" target="lib\net45\MongoDBCompassCommunityDev.exe" />
[2020/01/31 12:46:54.956]   </files>
[2020/01/31 12:46:54.956] </package>
[2020/01/31 12:46:54.956] 2020-01-31T17:46:54.950Z electron-windows-installer:spawn Spawning Z:\data\mci\4aeabc11d02dfb3bea020f4f8e07a6a5\src\node_modules\electron-winstaller\vendor\nuget.exe pack C:\data\mci\4aeabc11d02dfb3bea020f4f8e07a6a5\tmp\si-2020031-2464-1xen19v.s0be\MongoDBCompassCommunityDev.nuspec -BasePath C:\data\mci\4aeabc11d02dfb3bea020f4f8e07a6a5\src\dist\MongoDBCompassCommunityDev-win32-x64 -OutputDirectory C:\data\mci\4aeabc11d02dfb3bea020f4f8e07a6a5\tmp\si-2020031-2464-1xen19v.s0be -NoDefaultExcludes
[2020/01/31 12:47:24.486] 2020-01-31T17:47:24.486Z electron-windows-installer:main Attempting to build package from 'MongoDBCompassCommunityDev.nuspec'.
[2020/01/31 12:47:24.486] Successfully created package 'C:\data\mci\4aeabc11d02dfb3bea020f4f8e07a6a5\tmp\si-2020031-2464-1xen19v.s0be\MongoDBCompassCommunityDev.1.21.0-dev.nupkg'.
[2020/01/31 12:47:24.486] 2020-01-31T17:47:24.486Z electron-windows-installer:spawn Spawning Z:\data\mci\4aeabc11d02dfb3bea020f4f8e07a6a5\src\node_modules\electron-winstaller\vendor\Squirrel.exe --releasify C:\data\mci\4aeabc11d02dfb3bea020f4f8e07a6a5\tmp\si-2020031-2464-1xen19v.s0be\MongoDBCompassCommunityDev.1.21.0-dev.nupkg --releaseDir C:\data\mci\4aeabc11d02dfb3bea020f4f8e07a6a5\src\dist --loadingGif C:\data\mci\4aeabc11d02dfb3bea020f4f8e07a6a5\src\src\app\images\win32\mongodb-compass-installer-loading.gif --signWithParams yes --no-msi
[2020/01/31 12:47:29.021] ×  Error: Error: Failed with exit code: 4294967295
[2020/01/31 12:47:29.021] Output:
[2020/01/31 12:47:29.021] System.AggregateException: One or more errors occurred. ---> System.Exception: Failed to sign, command invoked was: '.\signtool.exe sign yes C:\Users\mci-exec\AppData\Local\SquirrelTemp\tempa\lib\net45\ffmpeg.dll'
[2020/01/31 12:47:29.021]    at Squirrel.Update.Program.<signPEFile>d__17.MoveNext()
[2020/01/31 12:47:29.021] --- End of stack trace from previous location where exception was thrown ---
[2020/01/31 12:47:29.021]    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[2020/01/31 12:47:29.021]    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[2020/01/31 12:47:29.021]    at Squirrel.Update.Program.<>c__DisplayClass10_0.<<Releasify>b__14>d.MoveNext()
[2020/01/31 12:47:29.021] --- End of stack trace from previous location where exception was thrown ---
[2020/01/31 12:47:29.021]    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[2020/01/31 12:47:29.021]    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
[2020/01/31 12:47:29.021]    at Squirrel.Utility.<>c__DisplayClass13_1`1.<<ForEachAsync>b__1>d.MoveNext()
[2020/01/31 12:47:29.021]    --- End of inner exception stack trace ---
[2020/01/31 12:47:29.021]    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
[2020/01/31 12:47:29.021]    at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
[2020/01/31 12:47:29.021]    at Squirrel.Update.Program.<>c__DisplayClass10_0.<Releasify>b__7(String pkgPath)
[2020/01/31 12:47:29.021]    at Squirrel.ReleasePackage.CreateReleasePackage(String outputFile, String packagesRootDir, Func`2 releaseNotesProcessor, Action`1 contentsPostProcessHook)
[2020/01/31 12:47:29.021]    at Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts, String baseUrl, String setupIcon, Boolean generateMsi, String frameworkVersion, Boolean generateDeltas)
[2020/01/31 12:47:29.021]    at Squirrel.Update.Program.executeCommandLine(String[] args)
[2020/01/31 12:47:29.021]    at Squirrel.Update.Program.main(String[] args)
[2020/01/31 12:47:29.021]    at Squirrel.Update.Program.Main(String[] args)
[2020/01/31 12:47:29.021] ---> (Inner Exception #0) System.Exception: Failed to sign, command invoked was: '.\signtool.exe sign yes C:\Users\mci-exec\AppData\Local\SquirrelTemp\tempa\lib\net45\ffmpeg.dll'



 Comments   
Comment by Githook User [ 03/Feb/20 ]

Author:

{'name': 'Lucas Hrabovsky', 'username': 'imlucas', 'email': 'hrabovsky.lucas@gmail.com'}

Message: build: COMPASS-4127: Fix code signing on Windows (#1895)

Evergreen:
https://evergreen.mongodb.com/version/5e386060e3c3311158f8f2e2

    1. Todo
    1. Description

Rollback `electron-winstaller` to `2.5.1` for now. Don't upgrade until [BUILD-2932](https://jira.mongodb.org/browse/BUILD-2932) is done.

    1. Notes

[Evergreen windows builds](https://evergreen.mongodb.com/task/10gen_compass_master_windows_package_and_publish_compass_3d7b0895c3d7ed4aada6f997286a8a57d7f835b5_20_01_31_17_33_22) started failing with the electron 6 update:

```
[2020/01/31 12:47:29.021] × Error: Error: Failed with exit code: 4294967295

[2020/01/31 12:47:29.021] Output:
[2020/01/31 12:47:29.021] System.AggregateException: One or more errors occurred. ---> System.Exception: Failed to sign, command invoked was: '.\signtool.exe sign yes C:\Users\mci-exec\AppData\Local\SquirrelTemp\tempa\lib\net45\ffmpeg.dll'
[2020/01/31 12:47:29.021] at Squirrel.Update.Program.<signPEFile>d__17.MoveNext()
```

Normally, `Failed with exit code: 4294967295` means [the signtool.exe notary service client](https://jira.mongodb.org/browse/BUILD-920) is getting a 500 service error due to an outage.

However, all other OS were signing with no issues [see BUILD-10250](https://jira.mongodb.org/browse/BUILD-10250).

```
cd /cygdrive/z/data/mci/src/dist/MongoDBCompassDev-win32-x64;

$ ../../signtool.exe sign yes ffmpeg.dll
2020/02/03 16:34:55 Signing service didn't return a permalink

$ ../../signtool.exe sign yes libEGL.dll
2020/02/03 16:35:14 Signing service didn't return a permalink

$ ../../signtool.exe sign yes MongoDBCompassDev.exe
Worked
$ ../../signtool.exe sign yes Squirrel.exe
Worked
```

So, it can't be a service issue and must be something related to the changes to `hadron-build` for COMPASS-3933 electron 6 support.

Only a handful of commits and [e3ff85c9303bc43e56976226d10d6b9897324b66](https://github.com/mongodb-js/hadron-build/commit/e3ff85c9303bc43e56976226d10d6b9897324b66)
`electron-winstaller` was upgraded from `2.5.1` to `4.0.0`. This changed the effective version of the [Squirrel.Windows](https://github.com/Squirrel/Squirrel.Windows) framework electron uses for win32 auto-update:

In `electron-winstaller@2.5.2` :arrow_right: [squirrel.windows@1.5.2](https://github.com/Squirrel/Squirrel.Windows/releases/tag/1.5.2):

> ### Releasify now disallows non-Semver versions
>
> While using non-Semver versions in your NuGet package was always incorrect and resulted in undefined behavior, due to #868, these are now a full non-starter. We now require packages to have Semver-compatible versions names. Note that this doesn't affect your EXE versions, which can still use all four Win32 version numbers.
>
> ### Bug Fixes
>
> - Allow uppercase characters in SemVer versions (#924, thanks)
> - Sign DLL and .node files during Releasify
> - Ensure that Stub Executables pass along their parameters to the target

And now the facepalm moment; [BUILD-2932](https://jira.mongodb.org/browse/BUILD-2932) (created in 2017) as the notary service doesn't support dll signing the way we need it to.

    1. Motivation and Context
  • [x] Dependency update
    1. Dependents

mongodb-js/hadron-build#110

    1. Types of changes
Comment by Githook User [ 03/Feb/20 ]

Author:

{'username': 'imlucas', 'name': 'Lucas Hrabovsky', 'email': 'hrabovsky.lucas@gmail.com'}

Message: COMPASS-4127: Fix windows build
Branch: COMPASS-4127
https://github.com/mongodb-js/compass/commit/0f21192655886a6a8ae8a633b5e74e474f37b1c2

Comment by Githook User [ 03/Feb/20 ]

Author:

{'name': 'Lucas Hrabovsky', 'username': 'imlucas', 'email': 'hrabovsky.lucas@gmail.com'}

Message: COMPASS-4127: Rollback electron-winstaller to 2.5.1 (#110)

  • [ ] BUILD ticket: notary service dll support

https://github.com/mongodb-js/hadron-build/commit/e3ff85c9303bc43e56976226d10d6b9897324b66
`electron-winstaller` was upgraded from `2.5.1` to `4.0.0`.

`electron-winstaller@2.5.1.` :arrow_right: [squirrel.windows@1.5.1](https://github.com/Squirrel/Squirrel.Windows/releases/tag/1.5.1)
`electron-winstaller@>=3.0.0` :arrow_right: [squirrel.windows@1.9.1](https://github.com/Squirrel/Squirrel.Windows/releases/tag/1.5.1)

In `electron-winstaller@2.5.2` :arrow_right: [squirrel.windows@1.5.2](https://github.com/Squirrel/Squirrel.Windows/releases/tag/1.5.2)

> ## Releasify now disallows non-Semver versions
>
> While using non-Semver versions in your NuGet package was always incorrect and resulted in undefined behavior, due to #868, these are now a full non-starter. We now require packages to have Semver-compatible versions names. Note that this doesn't affect your EXE versions, which can still use all four Win32 version numbers.
>
> ## Bug Fixes
>
> - Allow uppercase characters in SemVer versions (#924, thanks @runehalfdan)
> - Sign DLL and .node files during Releasify
> - Ensure that Stub Executables pass along their parameters to the target
Branch: master
https://github.com/mongodb-js/hadron-build/commit/3134dff24b3042397611fe8e9b81515835d4197f

Comment by Githook User [ 03/Feb/20 ]

Author:

{'name': 'Lucas Hrabovsky', 'username': 'imlucas', 'email': 'hrabovsky.lucas@gmail.com'}

Message: COMPASS-4127: Rollback electron-winstaller to 2.5.1

  • [ ] BUILD ticket: notary service dll support

https://github.com/mongodb-js/hadron-build/commit/e3ff85c9303bc43e56976226d10d6b9897324b66
`electron-winstaller` was upgraded from `2.5.1` to `4.0.0`.

`electron-winstaller@2.5.1.` :arrow_right: [squirrel.windows@1.5.1](https://github.com/Squirrel/Squirrel.Windows/releases/tag/1.5.1)
`electron-winstaller@>=3.0.0` :arrow_right: [squirrel.windows@1.9.1](https://github.com/Squirrel/Squirrel.Windows/releases/tag/1.5.1)

In `electron-winstaller@2.5.2` :arrow_right: [squirrel.windows@1.5.2](https://github.com/Squirrel/Squirrel.Windows/releases/tag/1.5.2)

> ## Releasify now disallows non-Semver versions
>
> While using non-Semver versions in your NuGet package was always incorrect and resulted in undefined behavior, due to #868, these are now a full non-starter. We now require packages to have Semver-compatible versions names. Note that this doesn't affect your EXE versions, which can still use all four Win32 version numbers.
>
> ## Bug Fixes
>
> - Allow uppercase characters in SemVer versions (#924, thanks @runehalfdan)
> - Sign DLL and .node files during Releasify
> - Ensure that Stub Executables pass along their parameters to the target
Branch: rollback-electron-winstaller
https://github.com/mongodb-js/hadron-build/commit/9f5fa2443c2626ef79acc1f86ce48ca3a777b19f

Generated at Wed Feb 07 22:35:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.