xcp-ng/xenadmin

Could Not Load Settings

Grip3n opened this issue · 8 comments

Describe the bug
XCP-NG Center was running connected to XCP-NG. The PC that runs XCP-NG Center hanged (reason unknown) and a force reboot was needed to get the the PC back up and running.

Try and ran XCP-NG Center and got the error message as seen in screenshot.

To Reproduce
Steps to reproduce the behavior:

  1. Run XCP-NG Center (20.3.1.31)
  2. Connect XCP-NG Center (20.3.1.31) to XCP-NG-8.1.0 that is running a VM
  3. Force reboot XCP-NG Center (20.3.1.31) host system
  4. See error
  5. Delete /user.config
  6. Run XCP-NG Center (20.3.1.31)
  7. See error
  8. Install XCP-NG Center (20.04.00.32)
  9. Run XCP-NG Center (20.04.00.32)
  10. See error
  11. Uninstall XCP-NG Center
  12. Install XCP-NG Center (20.04.00.32)
  13. Run XCP-NG Center (20.04.00.32)
  14. See error
  15. Go to AppData\Roaming\XCP-ng\XenCenterMain.exe_Url_....../
  16. Folder 20.04.00.32 missing
  17. Create folder 20.04.00.32
  18. See error

(NOTE: this is what I observed on my system)

Expected behavior
XCP-NG Center (20.04.00.32) should run ?

Screenshots / Logfiles
Attached
XCP-Ng

Hard-/Software involved:

  • Hardware: Custom build
  • Host XCP-ng Version: 8.1.0
  • Client XCP-ng Center Version: Started with 20.3.1.31 then installed 20.04.00.32
  • Desktop OS: Windows 10 Pro 1909

Additional context
I have no idea why the XCP-ng Center Host PC crached so that part i cannot Reproduce

I have exactly the same problem, except that in my case the folder 20.04.00.32 wasn't missing. (But Grip3n's recreating it didn't solve the problem, so maybe that is unimportant.)

For full details see https://xcp-ng.org/forum/topic/3233/xcp-ng-center-20-4-0-32-fails-with-corrupt-user-config-error/

Hi,

can you zip together those two folders:

%userprofile%\AppData\Roaming\XCP-ng
and
%userprofile%\AppData\Local\XCP-ng\

Please before that check the files for any confidential information like username and passwords and try to replace them with something else.

If I can reproduce the crash with these files I can try to find out what is wrong.

Hi cocoon,
XCPNG.zip

Things have changed since my issue, some files were deleted and some not BUT you are in luck seems the log files were kept and after reviewing them seems the error was captured. Folders 7.6.3.20 and 8.0.1.26 were deleted at time.

IF i recall the way I resolved the issue was by using an old user.config file by recreating the all the folders and moving he config file in place....

(hope it helps in a way)

@Grip3n Thanks for the files, but for me it is not crashing with your files. I would need a state where it still is corrupt and crashes the app.

In the old log it tried to read the config of the previous XCP-ng center Version and that was reported to be corrupt:

20.3.1.31\user.config) ---> System.Xml.XmlException: Root element is missing

Is it still crashing for you?

@cocoon
Hi,
then we are out of luck as it does not crash anymore.
I have tried a lot of solution to resolve the issue some recommended on the web others just by self created trail and error.

Due to deleting the old versions manually and removing some entries, think registry, is going to make fault finding now hopeless....

Will let you know if this happens again as soon as it happens. With the logs attached as asked by you.

Side Note:
Maybe @thoatswold logs will help if can be posted ?

Yes, I think I can help – not just with the logs, I think I've discovered what's going on:

To summarize the problem, in some circumstances upgrading XCP-ng Center to version 20.4.0.32 from an earlier version (including 20.3) causes the upgraded program to fail to load its user.config file, which has become corrupted.

The error message is incorrect. It says "Revert changes to C:\Users\<username>\AppData\Roaming\XCP-ng\...\user.config" However, it turns out that the corrupt file is actually C:\Users\<username>\AppData\Local\XCP-ng\...\user.config. It consists of all zero bytes. When I deleted that file and ran XCP-ng Center 20.4.0.32 again, it did indeed create a valid default user.config file and loaded successfully.

Does that provide enough information for you to reproduce the problem, or shall I post my logs?

I can confirm by making my
C:\Users\AppData*Local*\XCP-ng...\user.config.
a ZERO byte file
Error message shows
C:\Users\AppData*Roaming*\XCP-ng...\user.config

Good catch @thoatswold

we will not work on that