-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Starting with version 0.9.1-beta.24123.2 error on tempfile/folder #684
Comments
I just created a brand new W22 machine in Azure but there I have the same issue VERBOSE: Running Invoke-cdsaALAppSign. PSBoundParameters: I'm kind of out of options as the previous versions don't Sign buisness central apps. |
@RonKoppelaar, thanks for the report. Sorry you're having this problem. @clairernovotny had an idea that there might be contention with an antivirus/malware scanner. Are you using a stock VM template? If yes, which one is it? Do you see a pattern in reproducibility (e.g.: it happens every time) or is it random? Can you share a simplified repro that doesn't have any sensitive or proprietary data? |
Unfortune sharing repro without sensitive is not possible as the certificate is taken from AZ Key Vault. I could however share the script without any secrets though. Will add repro to this thread tomorrow. |
Hi, is there any news? because i have the same problem and i need a solution. |
I did some tests with an plain Azure VM (image: 2022-datacenter-azure-edition, size: Standard_D2s_v5), found an solution and have noticed the following: First Attempt: dotnet tool install sign --global --prerelease
"Write-Host 'test'" | Out-File "c:\sign.ps1"
sign code azure-key-vault -kvu "https://....vault.azure.net/" `
-kvc "..." `
-kvi "..." `
-kvs "" `
-kvt "..." `
--verbosity Debug `
--description "..." `
--description-url "https://.../" `
--publisher-name "...." `
"c:\sign.ps1"
info: Sign.Core.ISigner[0]
Submitting c:\sign.ps1 for signing.
info: Sign.Core.ISigner[0]
SignAsync called for c:\sign.ps1. Using C:\Users\azadmin\AppData\Local\Temp\prim4gnk.vvb\jr00srcb.ps1 locally.
info: Sign.Core.ISignatureProvider[0]
Signing SignTool job with 1 files.
info: Sign.Core.ISignatureProvider[0]
Signing C:\Users\azadmin\AppData\Local\Temp\prim4gnk.vvb\jr00srcb.ps1.
fail: Sign.Core.ISignatureProvider[0]
Signing failed with error -2146881271.
info: Sign.Core.ISignatureProvider[0]
Performing attempt #2 of 3 attempts after 5 s.
info: Sign.Core.ISignatureProvider[0]
Signing C:\Users\azadmin\AppData\Local\Temp\prim4gnk.vvb\jr00srcb.ps1.
fail: Sign.Core.ISignatureProvider[0]
Signing failed with error -2146881271.
info: Sign.Core.ISignatureProvider[0]
Performing attempt #3 of 3 attempts after 11.1803398 s. As shown, this resulted in an error and signing not worked. Second Attempt: Third Attempt:
@dtivel Using this script, the signing was successful. It appears that Chocolatey installs some additional assets required by the sign tool. |
Thx for the investigation. That would explain only one of our buildserver did work. I expect its one of the older servers which in the past was created by automation, and using Chocolaty to install some assets So main question is, altough there's a workaround installing assets what is the rootcause? Do you consider this to be an issue for the sign tool or should this be addressed to the .Net team? |
@RonKoppelaar |
Describe the bug
Starting with version 0.9.1-beta.24123.2 I got file in use errors when using the sign tool. Its depending on machine type/configuration but unclear why. I have two build machines both run on W2019
Repro steps
Run Sign.exe for one app file (Business Central) using certificate from Azure keyvault.
Invoke the cmd from PS ISE.
Error stack:
VERBOSE: Running Invoke-cdsaALAppSign. PSBoundParameters:
KeyVaultName:CodeSignERP CertificateName:CodeSignCertificate FilesToSign:C:\temp\Zig_Zig365 Insights Connector_23.23.0.0.app Description:test signing DescriptionUrl:https:\www.zig.nl Verbose:True Verbosity:Information
VERBOSE: Start find sign tool
VERBOSE: Instal Sign tool
VERBOSE: Installing signing tool version 0.9.1-beta.24123.2 in C:\Users\BUILDA
1.JVF\AppData\Local\Temp\1\SigningTool-0.9.1-beta.24123.21.JVF\AppData\Local\Temp\1\SigningTool-0.9.1-beta.24123.2\Sign.exeVERBOSE: Getting sign tool C:\Users\BUILDA
VERBOSE: Using sign tool: C:\Users\BUILDA~1.JVF\AppData\Local\Temp\1\SigningTool-0.9.1-beta.24123.2\Sign.exe
VERBOSE: Signing file: C:\temp\Zig_Zig365 Insights Connector_23.23.0.0.app
info: Sign.Core.ISigner[0]
Submitting C:\temp\Zig_Zig365 Insights Connector_23.23.0.0.app for signing.
info: Sign.Core.ISigner[0]
SignAsync called for C:\temp\Zig_Zig365 Insights Connector_23.23.0.0.app. Using C:\Users\buildadmin.jvfbbmhpxp7u6\AppData\Local\Temp\1\0zx1bmjk.5ib\5sdgrzsb.app locally.
info: Sign.Core.ISignatureProvider[0]
Signing SignTool job with 1 files.
info: Sign.Core.ISignatureProvider[0]
Signing C:\Users\buildadmin.jvfbbmhpxp7u6\AppData\Local\Temp\1\0zx1bmjk.5ib\5sdgrzsb.app.
fail: Sign.Core.ISignatureProvider[0]
Signing failed with error -2146762749.
info: Sign.Core.ISignatureProvider[0]
Performing attempt #2 of 3 attempts after 5 s.
info: Sign.Core.ISignatureProvider[0]
Signing C:\Users\buildadmin.jvfbbmhpxp7u6\AppData\Local\Temp\1\0zx1bmjk.5ib\5sdgrzsb.app.
fail: Sign.Core.ISignatureProvider[0]
Signing failed with error -2147024864.
info: Sign.Core.ISignatureProvider[0]
Performing attempt #3 of 3 attempts after 11.1803398 s.
info: Sign.Core.ISignatureProvider[0]
Signing C:\Users\buildadmin.jvfbbmhpxp7u6\AppData\Local\Temp\1\0zx1bmjk.5ib\5sdgrzsb.app.
fail: Sign.Core.ISignatureProvider[0]
Signing failed with error -2147024864.
fail: Sign.Core.ISignatureProvider[0]
Failed to sign. Attempts exceeded.
warn: Sign.Core.IDirectoryService[0]
An exception occurred while attempting to delete directory C:\Users\buildadmin.jvfbbmhpxp7u6\AppData\Local\Temp\1\0zx1bmjk.5ib.
System.IO.IOException: The process cannot access the file '5sdgrzsb.app' because it is being used by another process.
at System.IO.FileSystem.RemoveDirectoryRecursive(String fullPath, WIN32_FIND_DATA& findData, Boolean topLevel)
at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive)
at System.IO.DirectoryInfo.Delete(Boolean recursive)
at Sign.Core.DirectoryService.Delete(DirectoryInfo directory) in //src/Sign.Core/FileSystem/DirectoryService.cs:line 52
fail: Sign.Core.ISigner[0]
Could not sign C:\Users\buildadmin.jvfbbmhpxp7u6\AppData\Local\Temp\1\0zx1bmjk.5ib\5sdgrzsb.app.
System.Exception: Could not sign C:\Users\buildadmin.jvfbbmhpxp7u6\AppData\Local\Temp\1\0zx1bmjk.5ib\5sdgrzsb.app.
at Sign.Core.AzureSignToolSignatureProvider.<>c__DisplayClass7_0.<b__0>d.MoveNext() in //src/Sign.Core/SignatureProviders/AzureSignToolSignatureProvider.cs:line 110
--- End of stack trace from previous location ---
at System.Threading.Tasks.Parallel.<>c__53
1.<<ForEachAsync>b__53_0>d.MoveNext() --- End of stack trace from previous location --- at Sign.Core.AzureSignToolSignatureProvider.SignAsync(IEnumerable
1 files, SignOptions options) in //src/Sign.Core/SignatureProviders/AzureSignToolSignatureProvider.cs:line 104at Sign.Core.AggregatingSignatureProvider.SignAsync(IEnumerable
1 files, SignOptions options) in /_/src/Sign.Core/SignatureProviders/AggregatingSignatureProvider.cs:line 204 at Sign.Core.Signer.<>c__DisplayClass3_0.<<SignAsync>b__0>d.MoveNext() in /_/src/Sign.Core/Signer.cs:line 153 --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.<>c__53
1.<b__53_0>d.MoveNext()--- End of stack trace from previous location ---
at Sign.Core.Signer.SignAsync(IReadOnlyList`1 inputFiles, String outputFile, FileInfo fileList, DirectoryInfo baseDirectory, String applicationName, String publisherName, String description, Uri descriptionUrl, Uri timestampU
rl, Int32 maxConcurrency, HashAlgorithmName fileHashAlgorithm, HashAlgorithmName timestampHashAlgorithm) in //src/Sign.Core/Signer.cs:line 85
VERBOSE: Finished Invoke-cdsaALAppSign.
The text was updated successfully, but these errors were encountered: