Skip to content
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

Corrupted .chocolatey files can lead to cryptic warning and error messages #3597

Open
6 tasks done
corbob opened this issue Jan 3, 2025 · 0 comments
Open
6 tasks done

Comments

@corbob
Copy link
Member

corbob commented Jan 3, 2025

Checklist

  • I confirm there are no unresolved issues reported on the Chocolatey Status page.
  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

When there is a corrupted file in the .chocolatey directory, the warnings and errors don't always portray where the issue is, or what the cause may be.

What is Expected?

Warnings and errors should provide actionable information (ie: identify the file that's the issue).

How Did You Get This To Happen?

For the purposes of this, I'll use the glab package. The steps below reproduce the issue reported in Discord, but other changes to the files result in other warnings that are also unhelpful.

  1. Install a package with Chocolatey (choco install glab -y)
  2. Install imhex - if you're on a VM, you'll likely want the NoGPU portable version (there is a currently outdated Chocolatey package for this, but it does not include the NoGPU version).
  3. Launch imhex.
  4. For each file in C:\ProgramData\Chocolatey\.chocolatey\glab.1.51.0\, open them in imhex
  5. Right click the hex side of imhex and choose to insert a byte starting at offset 0x00.
    Image
  6. Run choco info glab --local-only
  7. Note the warnings and errors.
    Image

System Details

  • Operating System: Windows 11
  • Windows PowerShell version: 5.1
  • Chocolatey CLI Version: 2.4.1
  • Chocolatey Licensed Extension version: N/A
  • Chocolatey License type: N/A
  • Terminal/Emulator: Windows Terminal

Installed Packages

Chocolatey v2.4.1
chocolatey 2.4.1
glab 1.51.0
glab.portable 1.51.0
3 packages installed.

Output Log

https://gist.github.com/corbob/411e83ae075bb25c109c8c504c77823a

Additional Context

In my testing, these corrupted files don't seem to be blocking things, but there maybe some upgrade, install, uninstall commands where they may file. The .arguments file for sure will be a terminating error on an upgrade where remembered arguments are used.

@corbob corbob changed the title Corrupted .chocolatey files can lead to criptic warning and error messages Corrupted .chocolatey files can lead to cryptic warning and error messages Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant