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

Crash on start - unhandled exception #944

Open
OzWT opened this issue Jun 15, 2022 · 7 comments
Open

Crash on start - unhandled exception #944

OzWT opened this issue Jun 15, 2022 · 7 comments
Assignees
Labels
0 - _Triaging Issue is accepted, but a milestone has yet to be added for the issue Bug Issues where something has happened which was not expected or intended

Comments

@OzWT
Copy link

OzWT commented Jun 15, 2022

When I start ChocolateyGUI, I get an unhandled exception error from Windows.

My system:
Windows 10 Pro 21H1 (32 bit)
Build 19043.1706
Chocolatey version 1.1.0
ChocolateyGUI version 1.0.0

Screenshot below.
Fehler

The debug log from ChocolateyGUI is here.

I have reinstalled ChocolateyGUI and I tried to delete the %appdata%\Local\Chocolatey Gui\data.db, but it doesnt help.

@fenderfan7
Copy link

I get a very similar crash on startup, reinstalling does not help here as well.
ChocolateyCrash

@corbob
Copy link
Member

corbob commented Sep 27, 2022

IIRC the only xml file read in by Chocolatey GUI is the Chocolatey Configuration file found at $env:ChocolateyInstall/config/chocolatey.config. @fenderfan7 the error you have there appears to indicate an invalid character as the first character of the Chocolatey config file. Interestingly it sounds like you're not having Chocolatey issues even though it appears to only be Chocolatey methods mentioned as opposed to Chocolatey GUI.

I would check what encoding the chocolatey.config has, and ensure it's saved as UTF8 without BOM if it's not already.

@corbob corbob added Bug Issues where something has happened which was not expected or intended 0 - _Triaging Issue is accepted, but a milestone has yet to be added for the issue labels Sep 27, 2022
@fenderfan7
Copy link

@corbob Yes my chocolatey kept working fine.
I found the solution: The outdatedPackages.xml file was invalid. I just renamed the file under [Username]\AppData\Local\Chocolatey GUI and restarted chocolatey gui and everything is fine now.

This corrupted file must have been written, when my PC shut down immediately (probably due to some unrelated driver failure) yesterday while the file was written.

Here is an upload of the broken file, if anybody wants to debug this.
outdatedPackagesBroken.zip

@corbob
Copy link
Member

corbob commented Sep 30, 2022

Thank you for getting us the file @fenderfan7! It looks like you're right, it was corrupted. I had to open it in a hex editor to see anything with it, and it was all just 0's:

image

@OzWT if you're still having this issue, could you verify that particular xml file? As well, the error seems to indicate some NuGet related things, can you verify that choco list -lo functions correctly?

@corbob corbob self-assigned this Sep 30, 2022
@OzWT
Copy link
Author

OzWT commented Oct 1, 2022

Yes I still have this issue, but only on the system described in the 1. Post. On my other machines (64 bit) I haven't an issue with Chocolatey GUI (maybe the architecture matters).

Concerning the system with the issue:
I don't have the outdatedPackages.xml file in the [Username]\AppData\Local\Chocolatey GUI folder. I think it is created after a proper start of Chocolatey GUI.

Chocolatey (cli) works as expected all the time. choco list -lo lists all installed packages without an error.

After @corbob mentioned the $env:ChocolateyInstall/config/chocolatey.config, I experimented a bit with the chocolatey.config. This file is encoded as UTF-8-BOM. If I change this into UTF-8 without BOM, Chocolatey GUI still crashes and chocolatey.config is encoded as UTF-8-BOM again.
If I change the encoding and set a write protection, Chocolatey GUI takes much longer till crash.

@corbob
Copy link
Member

corbob commented Oct 1, 2022

Thank you for the additional information @OzWT. It sounds like it's related to the chocolatey.config file as you say it takes longer before it crashes when it's not allowed to write to it. Could you possibly rename or move the file and try again? If it works after renaming/moving the file, I'd love to see the file, but beware that it could contain sensitive data so you may not want to upload it without verifying it's contents.

As for the issue @fenderfan7 ran into, I'll open a new issue for that so we can hopefully add some handling of corruption in the outdatedPackages.xml file 😄

@OzWT
Copy link
Author

OzWT commented Oct 1, 2022

It doesn't work.
The error massage (translated from German): The application could not be started. the file 'ChocolateyInstall/config/chocolatey.config' could not be found.

Sad, but let me know, if I can some other tests for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - _Triaging Issue is accepted, but a milestone has yet to be added for the issue Bug Issues where something has happened which was not expected or intended
Projects
None yet
Development

No branches or pull requests

4 participants