-
Notifications
You must be signed in to change notification settings - Fork 907
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
Ensure invalid .arguments files do not prevent running Chocolatey CLI commands #3513
Comments
Can you go back to the above and:
|
Full Output logs: [Uploading choco.summary.1.log…] |
@pauby is ok now? |
getting same error with CLI
|
The error is gone when I reinstalled choco by:
|
had this problem too, out of nowhere.. had to fully reinstall chocolatey and restore every package, then reinstate them all (because just copying |
Reading through the logs attached to this issue, I am as sure as I can be that this is related to this issue #3503. While the symptoms are slightly different, the underlying issue is still the same. There is something wrong with one of the The "fix" here would be to report the problem with the file, rather than abort the operation, as in some cases, information about the remembered arguments is not required. @corbob is going to be spending some time looking into this issue, and will report back here once he has some more information.
This process should not have been required. Based on what I am seeing reported here, one of the |
@gep13 I think you're right about the relation to #3503. When I was looking through to track where I could fix that one, I stumbled upon this line:
It is one of the 4 places in the codebase where we're converting from base64, as well as it's consistent with the stack trace. |
I can confirm that the change I made in #3540 in my tests results in this error not terminating except in the scenario where termination is desired (upgrade with remembered arguments). To validate this, I opened a
|
Currently we are decrypting the arguments file every time a list is run, even though we only care about them in scenarios where we might output them to the user (when Verbose is specified on the list command or with the info --local-only command). This updates the handling of the remembered arguments to be consistent between the List method and the scenario in an Upgrade where we want to use the remembered arguments. We now will only throw an error in a scenario where we can't decrypt the contents and we need them for the scenario to succeed. We are also stating what file we couldn't decrypt so the user can troubleshoot.
Currently we are decrypting the arguments file every time a list is run, even though we only care about them in scenarios where we might output them to the user (when Verbose is specified on the list command or with the info --local-only command). This updates the handling of the remembered arguments to be consistent between the List method and the scenario in an Upgrade where we want to use the remembered arguments. We now will only throw an error in a scenario where we can't decrypt the contents and we need them for the scenario to succeed. We are also stating what file we couldn't decrypt so the user can troubleshoot.
Add some Pester tests for the arguments file decryption handling. Ensuring that both invalid keys and base64 corruption works correctly.
Currently we are decrypting the arguments file every time a list is run, even though we only care about them in scenarios where we might output them to the user (when Verbose is specified on the list command or with the info --local-only command). This updates the handling of the remembered arguments to be consistent between the List method and the scenario in an Upgrade where we want to use the remembered arguments. We now will only throw an error in a scenario where we can't decrypt the contents and we need them for the scenario to succeed. We are also stating what file we couldn't decrypt so the user can troubleshoot.
Add some Pester tests for the arguments file decryption handling. Ensuring that both invalid keys and base64 corruption works correctly.
Currently we are decrypting the arguments file every time a list is run, even though we only care about them in scenarios where we might output them to the user (when Verbose is specified on the list command or with the info --local-only command). This updates the handling of the remembered arguments to be consistent between the List method and the scenario in an Upgrade where we want to use the remembered arguments. We now will only throw an error in a scenario where we can't decrypt the contents and we need them for the scenario to succeed. We are also stating what file we couldn't decrypt so the user can troubleshoot.
Add some Pester tests for the arguments file decryption handling. Ensuring that both invalid keys and base64 corruption works correctly.
- Use OrdinalIgnoreCase for command name comparison. - Log with Warn or Error where appropriate and emit to log file only as needed. - Use explicitly named parameters instead of true/false. - Remove comment that's no longer valid.
- Use OrdinalIgnoreCase for command name comparison. - Log with Warn or Error where appropriate and emit to log file only as needed. - Use explicitly named parameters instead of true/false. - Remove comment that's no longer valid.
- Use OrdinalIgnoreCase for command name comparison. - Use explicitly named parameters instead of true/false. - Remove comment that's no longer valid.
Currently we are decrypting the arguments file every time a list is run, even though we only care about them in scenarios where we might output them to the user (when Verbose is specified on the list command or with the info --local-only command). This updates the handling of the remembered arguments to be consistent between the List method and the scenario in an Upgrade where we want to use the remembered arguments. We now will only throw an error in a scenario where we can't decrypt the contents and we need them for the scenario to succeed. We are also stating what file we couldn't decrypt so the user can troubleshoot.
Add some Pester tests for the arguments file decryption handling. Ensuring that both invalid keys and base64 corruption works correctly.
- Use OrdinalIgnoreCase for command name comparison. - Use explicitly named parameters instead of true/false. - Remove comment that's no longer valid.
The CommandName is null when the list method is called during alternate source commands.
The CommandName is null when the list method is called during alternate source commands.
🎉 This issue has been resolved in version 2.4.0 🎉 The release is available on: |
Checklist
What You Are Seeing?
After every choco upgrade /install /uninstall command I get an error:
2024-09-17 13:34:06,040 13688 [ERROR] - The input data is not a valid Base-64 string because it contains a character with a base other than 64, more than two padding characters, or an invalid character among the padding characters. [choco_log.txt](https://github.com/user-attachments/files/17027571/choco_log.txt) 2024-09-17 13:34:06,045 13688 [ERROR] - More Details: System.FormatException: The input data is not a valid Base-64 string because it contains a character with a base other than 64, more than two padding characters, or an invalid character among the padding characters.. w System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength) w System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength) w System.Convert.FromBase64String(String s) w chocolatey.infrastructure.cryptography.DefaultEncryptionUtility.DecryptString(String encryptedString) w chocolatey.infrastructure.app.utility.ArgumentsUtility.<DecryptPackageArgumentsFile>d__1.MoveNext() w System.String.Join(String separator, IEnumerable1 values) w chocolatey.infrastructure.app.services.NugetService.<List>d__15.MoveNext() w System.Collections.Generic.List1..ctor(IEnumerable1 collection) w System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) w chocolatey.infrastructure.app.services.NugetService.GetInstalledPackages(ChocolateyConfiguration config) w chocolatey.infrastructure.app.services.NugetService.Install(ChocolateyConfiguration config, Action2 continueAction, Action2 beforeModifyAction) w chocolatey.infrastructure.app.services.ChocolateyPackageService.Install(ChocolateyConfiguration config) w chocolatey.infrastructure.app.runners.GenericRunner.Run(ChocolateyConfiguration config, Container container, Boolean isConsole, Action 1 parseArgs) w chocolatey.infrastructure.app.runners.ConsoleApplication.Run(String[] args, ChocolateyConfiguration config, Container container) w chocolatey.console.Program.Main(String[] args) 2024-09-17 13:34:06,045 13688 [DEBUG] - Exiting with 1
Full command log in the attachment.
What is Expected?
Command complete confirmation
How Did You Get This To Happen?
Error comes up when I run a commands:
System Details
Installed Packages
Running choco list command also fail with the same error. It list packages
2024-09-17 13:34:05,937 13688 [DEBUG] - 7zip 24.8.0 2024-09-17 13:34:05,964 13688 [DEBUG] - 7zip.install 24.8.0 2024-09-17 13:34:05,969 13688 [DEBUG] - adobereader 2024.2.21005 2024-09-17 13:34:05,973 13688 [DEBUG] - advanced-ip-scanner 2.5.4594.1 2024-09-17 13:34:05,975 13688 [DEBUG] - atom.install 1.63.1 2024-09-17 13:34:05,979 13688 [DEBUG] - autohotkey.portable 2.0.18 2024-09-17 13:34:05,982 13688 [DEBUG] - autoruns 14.11.0 2024-09-17 13:34:05,985 13688 [DEBUG] - Unable to locate .arguments file for version '4.32.0' of package 'bginfo'. 2024-09-17 13:34:05,985 13688 [DEBUG] - bginfo 4.32.0 2024-09-17 13:34:05,990 13688 [DEBUG] - calibre 7.17.0 2024-09-17 13:34:05,995 13688 [DEBUG] - chocolatey 2.3.0 2024-09-17 13:34:05,998 13688 [DEBUG] - chocolatey-compatibility.extension 1.0.0 2024-09-17 13:34:06,002 13688 [DEBUG] - chocolatey-core.extension 1.4.0 2024-09-17 13:34:06,006 13688 [DEBUG] - chocolatey-dotnetfx.extension 1.0.1 2024-09-17 13:34:06,008 13688 [DEBUG] - chocolateygui 2.1.1 2024-09-17 13:34:06,012 13688 [DEBUG] - chocolatey-windowsupdate.extension 1.0.5 2024-09-17 13:34:06,016 13688 [DEBUG] - cpu-z.install 2.9.0.20240123 2024-09-17 13:34:06,019 13688 [DEBUG] - deepl 24.8.2.13437 2024-09-17 13:34:06,021 13688 [DEBUG] - dellcommandupdate 5.4.0 2024-09-17 13:34:06,025 13688 [DEBUG] - docker-cli 27.2.1
and then fails. I found in log file that next package should be:
2024-09-15 19:43:50,093 9932 [DEBUG] - DotNet4.5.2 4.5.2.20140902 2024-09-15 19:43:50,095 9932 [DEBUG] - Unable to locate .arguments file for version '4.6.1055.20170308' of package 'DotNet4.6.1'. 2024-09-15 19:43:50,096 9932 [DEBUG] - DotNet4.6.1 4.6.1055.20170308 2024-09-15 19:43:50,100 9932 [DEBUG] - dotnet4.7.2 4.7.2.20210903 2024-09-15 19:43:50,103 9932 [DEBUG] - dotnetfx 4.8.0.20220524 2024-09-15 19:43:50,107 9932 [DEBUG] - dropbox 207.4.5821 2024-09-15 19:43:50,111 9932 [DEBUG] - evernote 10.85.4 2024-09-15 19:43:50,113 9932 [DEBUG] - evernote-chrome 6.10.3 2024-09-15 19:43:50,116 9932 [DEBUG] - Everything 1.4.11024 2024-09-15 19:43:50,119 9932 [DEBUG] - gimp 2.10.36.1 2024-09-15 19:43:50,121 9932 [DEBUG] - git 2.44.0 2024-09-15 19:43:50,127 9932 [DEBUG] - git.install 2.44.0 2024-09-15 19:43:50,132 9932 [DEBUG] - GoogleChrome 120.0.6099.276 2024-09-15 19:43:50,135 9932 [DEBUG] - googledrive 89.0.2 2024-09-15 19:43:50,139 9932 [DEBUG] - grammarly-chrome 14.821.1.1383 2024-09-15 19:43:50,143 9932 [DEBUG] - greenshot 1.2.10.6 2024-09-15 19:43:50,146 9932 [DEBUG] - https-everywhere-chrome 2016.12.19 2024-09-15 19:43:50,150 9932 [DEBUG] - InkScape 1.3.2 2024-09-15 19:43:50,154 9932 [DEBUG] - intellijidea-community 2023.4.0 2024-09-15 19:43:50,157 9932 [DEBUG] - irfanview 4.67.0 2024-09-15 19:43:50,167 9932 [DEBUG] - irfanview-languages 4.67.0 2024-09-15 19:43:50,170 9932 [DEBUG] - irfanviewplugins 4.67.0 2024-09-15 19:43:50,174 9932 [DEBUG] - jre8 8.0.401 2024-09-15 19:43:50,177 9932 [DEBUG] - KB2919355 1.0.20160915 2024-09-15 19:43:50,180 9932 [DEBUG] - KB2919442 1.0.20160915 2024-09-15 19:43:50,183 9932 [DEBUG] - KB2999226 1.0.20181019 2024-09-15 19:43:50,186 9932 [DEBUG] - KB3033929 1.0.5 2024-09-15 19:43:50,189 9932 [DEBUG] - KB3035131 1.0.3 2024-09-15 19:43:50,194 9932 [DEBUG] - keepassxc 2.7.7 2024-09-15 19:43:50,197 9932 [DEBUG] - k-litecodecpackfull 18.3.0 2024-09-15 19:43:50,200 9932 [DEBUG] - koodo-reader 1.6.6 2024-09-15 19:43:50,204 9932 [DEBUG] - malwarebytes 5.1.2.88 2024-09-15 19:43:50,210 9932 [DEBUG] - maven 3.9.6 2024-09-15 19:43:50,213 9932 [DEBUG] - microsoft-teams 1.7.0.7956 2024-09-15 19:43:50,217 9932 [DEBUG] - mobaxterm 24.0.0 2024-09-15 19:43:50,220 9932 [DEBUG] - Unable to locate .arguments file for version '4.7.2' of package 'netfx-4.7.2'. 2024-09-15 19:43:50,221 9932 [DEBUG] - netfx-4.7.2 4.7.2 2024-09-15 19:43:50,225 9932 [DEBUG] - netfx-4.8 4.8.0.20220524 2024-09-15 19:43:50,228 9932 [DEBUG] - nodejs 21.7.1 2024-09-15 19:43:50,231 9932 [DEBUG] - nodejs.install 21.7.1 2024-09-15 19:43:50,234 9932 [DEBUG] - notepadplusplus 8.6.5 2024-09-15 19:43:50,237 9932 [DEBUG] - notepadplusplus.install 8.6.5 2024-09-15 19:43:50,240 9932 [DEBUG] - office365business 17328.20162.0 2024-09-15 19:43:50,243 9932 [DEBUG] - openjdk 21.0.2 2024-09-15 19:43:50,247 9932 [DEBUG] - openvpn 2.6.10.1 2024-09-15 19:43:50,251 9932 [DEBUG] - paint.net 5.0.13 2024-09-15 19:43:50,254 9932 [DEBUG] - PDFCreator 5.2.1 2024-09-15 19:43:50,260 9932 [DEBUG] - postman 10.24.16 2024-09-15 19:43:50,263 9932 [DEBUG] - procexp 17.5.0.20231021 2024-09-15 19:43:50,266 9932 [DEBUG] - putty 0.81.0 2024-09-15 19:43:50,269 9932 [DEBUG] - putty.portable 0.81.0 2024-09-15 19:43:50,273 9932 [DEBUG] - qfinderpro 7.9.1.817 2024-09-15 19:43:50,277 9932 [DEBUG] - qsync 5.1.4.129 2024-09-15 19:43:50,281 9932 [DEBUG] - simple-sticky-notes 6.3.0 2024-09-15 19:43:50,285 9932 [DEBUG] - skype 8.94.0.428 2024-09-15 19:43:50,288 9932 [DEBUG] - slack 4.37.101 2024-09-15 19:43:50,290 9932 [DEBUG] - spotify 1.2.35.663 2024-09-15 19:43:50,292 9932 [DEBUG] - tanzu-community-edition 0.12.1 2024-09-15 19:43:50,295 9932 [DEBUG] - teamviewer 15.52.4 2024-09-15 19:43:50,299 9932 [DEBUG] - totalcommander 11.3.0 2024-09-15 19:43:50,302 9932 [DEBUG] - treesizefree 4.7.2 2024-09-15 19:43:50,306 9932 [DEBUG] - vcredist140 14.38.33135 2024-09-15 19:43:50,312 9932 [DEBUG] - vcredist2010 10.0.40219.32503 2024-09-15 19:43:50,314 9932 [DEBUG] - vlc 3.0.20 2024-09-15 19:43:50,317 9932 [DEBUG] - vlc.install 3.0.20 2024-09-15 19:43:50,320 9932 [DEBUG] - vscode.install 1.88.1 2024-09-15 19:43:50,324 9932 [DEBUG] - WhatsApp 2.2306.9 2024-09-15 19:43:50,326 9932 [DEBUG] - Unable to locate .arguments file for version '1.62.0' of package 'windows-defender-browser-protection-chrome'. 2024-09-15 19:43:50,327 9932 [DEBUG] - windows-defender-browser-protection-chrome 1.62.0 2024-09-15 19:43:50,330 9932 [DEBUG] - winrar 7.0.0 2024-09-15 19:43:50,334 9932 [DEBUG] - winscp 6.3.2 2024-09-15 19:43:50,338 9932 [DEBUG] - winscp.install 6.3.2 2024-09-15 19:43:50,341 9932 [DEBUG] - wireshark 4.2.4 2024-09-15 19:43:50,346 9932 [DEBUG] - yarn 1.22.19 2024-09-15 19:43:50,350 9932 [DEBUG] - youtube-dl 2021.12.17 2024-09-15 19:43:50,354 9932 [DEBUG] - zoom 5.17.11.34827
Output Log
Additional Context
Problem appeared after upgrade chocolatey to v2.3.0
The text was updated successfully, but these errors were encountered: