jabbera / vsts-authenticode

A task to authenticode sign dlls
MIT License
7 stars 4 forks source link

When the build takes long, the task will fail #33

Open jessehouwing opened 4 years ago

jessehouwing commented 4 years ago

I have a build with a couple of slow optional steps. When I insert the task (using secure file) after the slow steps (takes about 30 minutes), the sign task fails consistently in most cases (of course not always, that would be too easy).

When I disable the slow tasks or move the sign task to above the slow steps it succeeds.

E:\Agent01\_work\_tasks\authenticode-sign_752fe535-ed47-4c2c-afcf-0778adb0bb12\5.0.4\x64\signtool.exe sign /tr http://timestamp.digicert.com /td sha256 /f E:\Agent01\_work\_temp\Unit4_Codesign_2021.pfx /p *** /fd sha256 E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.BL.Factory.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.BL.Resources.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.BL.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.DAL.Core.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.DAL.Model.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.DAL.Providers.SQLBase.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.DAL.Web.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.Reporting.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.Server.Online.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.WcfPortal40.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.BL.Factory.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.BL.Resources.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.BL.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.DAL.Core.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.DAL.Model.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.DAL.Providers.SQLBase.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.DAL.Web.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.Proxy.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.Reporting.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.Server.Online.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.Web.WebApi.Core.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.Web.WebApi.DataAccess.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.Web.WebApi.Model.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.Web.WebApi.dll E:\Agent01\_work\19\s\Bin\API\_PublishedWebsites\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.BL.Factory.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.BL.Resources.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.BL.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.DAL.Core.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.DAL.Model.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.DAL.Providers.SQLBase.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.DAL.Web.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.Reporting.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.Server.Online.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.WcfPortal40.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\bin\UNIT4.Multivers.API.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.BL.Factory.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.BL.Resources.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.BL.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.DAL.Core.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.DAL.Model.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.DAL.Providers.SQLBase.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.DAL.Web.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.Reporting.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.Server.Online.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.WcfPortal40.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.WcfPortal40\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi.Core\bin\UNIT4.Multivers.API.BL.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi.Core\bin\UNIT4.Multivers.API.Reporting.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi.Core\bin\UNIT4.Multivers.API.Web.WebApi.Core.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi.DataAccess\bin\UNIT4.Multivers.API.Web.WebApi.DataAccess.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi.Model\bin\UNIT4.Multivers.API.Reporting.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi.Model\bin\UNIT4.Multivers.API.Web.WebApi.Core.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi.Model\bin\UNIT4.Multivers.API.Web.WebApi.Model.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.BL.Factory.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.BL.Resources.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.BL.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.DAL.Core.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.DAL.Model.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.DAL.Providers.SQLBase.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.DAL.Web.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.Proxy.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.Reporting.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.Server.Online.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.Web.WebApi.Core.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.Web.WebApi.DataAccess.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.Web.WebApi.Model.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.Web.WebApi.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\bin\UNIT4.Multivers.API.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.BL.Factory.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.BL.Resources.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.BL.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.DAL.Core.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.DAL.Model.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.DAL.Providers.SQLBase.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.DAL.Web.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.Proxy.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.Reporting.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.Server.Online.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.Web.WebApi.Core.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.Web.WebApi.DataAccess.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.Web.WebApi.Model.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.Web.WebApi.dll E:\Agent01\_work\19\s\UNIT4.Multivers.API.Web.WebApi\obj\x86\Release\Package\PackageTmp\bin\UNIT4.Multivers.API.dll
SignTool Error: An error occurred while attempting to load the signing

    certificate from: E:\Agent01\_work\_temp\Unit4_Codesign_2021.pfx

Error attempting to sign. Attempt number: 0. Exception text: Error: The process 'E:\Agent01\_work\_tasks\authenticode-sign_752fe535-ed47-4c2c-afcf-0778adb0bb12\5.0.4\x64\signtool.exe' failed with exit code 1
Sleeping for 15 second(s)

...
...

##[error]Unable to sign Error: The process 'E:\Agent01\_work\_tasks\authenticode-sign_752fe535-ed47-4c2c-afcf-0778adb0bb12\5.0.4\x64\signtool.exe' failed with exit code 1
##[error]Unable to sign Error: The process 'E:\Agent01\_work\_tasks\authenticode-sign_752fe535-ed47-4c2c-afcf-0778adb0bb12\5.0.4\x64\signtool.exe' failed with exit code 1
(node:13200) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: The process 'E:\Agent01\_work\_tasks\authenticode-sign_752fe535-ed47-4c2c-afcf-0778adb0bb12\5.0.4\x64\signtool.exe' failed with exit code 1
Finishing: Authenticode Sign Build results
jessehouwing commented 4 years ago

I added a download secure file task and it injects a pre-job script to download the file, probably so that the lifetime of the token can be kept at short at reasonable. I swapped the file location in this task to the output parameter of the download secure file task.

Works like magic. And at added bonus it sets the file's variables.

jabbera commented 4 years ago

Thanks! I’ll take a look at your PRs soon. Stuffs been crazy:-)