-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
Failed to parse the configuration file at ... config.xml #471
Comments
Weird, I've seen this around before, but it was usually associated with Windows updates, also affected log files from both Syncthing and SyncTrayzor (so it wasn't directly do to SyncTrayzor), and wasn't repeatable. My best guesses are Windows Update screwed something up, and disk failure (which I can't do much about). Can you check the health of the disk on the machine which this message keeps appearing on? When you see it happen, could you also check the log files (in the same directory) for big sequences of null bytes? |
Hello, My disk seems fine. I am going to check the disk, as soon as possible, and inform you. There are no null bytes in the log files. Below there are the last lines of synctrayzor.log. "Referência de objeto não definida para uma instância de um objeto." means "Object reference undefined for an object instance" in portuguese. Greetings,
|
(Fixed that NullReferenceException in your log -- that shouldn't have happened) |
Issue still here(?), just have the same message on startup. |
Found something that might be related, will fix in the next release. For now, delete SyncTrayzor's configuration file |
FWIW. Windows 10 just updated and got the null bytes in config.xml again. And the end of syncthing.log also has null bytes. This was on 1.1.22, so as expected. Deleting the config.xml indeed fixed it. Looking forward to the next version, keep up the good work! Loving Syncthing/SyncTrayzor. |
If Syncthing's log file also got null bytes, then this is something to do with Windows Update, and is not something that I can fix I'm afraid. |
Hmm, searching for files with all null bytes shows several more files in the AppData directory. Some from Firefox also from yesterday, a program that was also running 'during' the update. See https://superuser.com/questions/845270/what-could-cause-the-files-to-be-replaced-with-null-bytes-size-and-timestamp-no and https://superuser.com/questions/845268/how-to-find-all-files-that-consist-only-of-null-bytes-any-number-of-them (The Syncthing log only had the nulls at the end, but searching for files with just some nulls gives way to many false positives. I'll do some more searches.) Maybe some writes are not properly synced when the upgrade is performed? Or maybe the associated reboot was the triggers as many machines only reboot on update. Since the main problem is with config.xml, perhaps you could make sure that this file is not kept open longer than needed? Just a though. By now my worry has extended beyond SyncTrayzor and I'm wondering what other files might be corrupted. That's a bit beyond the scope of this issue though. |
@canton7 you might find this discussion on the Notepad++ forum interesting: https://notepad-plus-plus.org/community/topic/13302/fix-corrupted-txt-file-null First:
Later
And finally
Maybe there's something useful in that thread. For me this exercise is over I think. My investigation is summarized on one of the stackoverflow questions: https://superuser.com/a/1402396/13089 . I'll be more careful in the future with closing all my applications when rebooting. |
Thanks for those links, I'll do some reading. Note that SyncTrayzor does only open its config file on startup, and again when it needs to be written to, which shouldn't in theory be very often (although I've never check to see if something's causing it to be saved more often) |
It's weird that I have seen this happen prob a few times over the past year and even the most recent time when I did a fresh install of Windows 10 and syncthing... I see the same thing with just a bunch of NULL values if I open with NP++. I hadn't done any windows updates and there is 0 issues /w my HD unless the corruption is specific to this file out of hundreds of thousands multiple times... then I should play the lottery :) |
What about to add some code to simply delete and recreate config.xml in case it gets corrupted? Syncthing/Synctrayzor are the best software I know for the job. I've tried others but they can't come close. We need to use this. The dialog box with "Failed to parse the configuration file at ...\AppData\Roaming\SyncTrayzor\config.xml" could have added two simple button: "Recreate config.xml" and "Cancel". In fact, this could solve the operational aspect of this bug. Users of every level of knowledge on computing could simply deal of it without asking for support. That's my suggestion. |
I am getting this issue from past couple of days, before that it was all cool. Aren't we planning to work on this? |
I am also getting this following the most recent update |
This issue persists for me too |
I've also hit this issue for the first time on Windows 11 (I've done a few Windows updates after this machine was unused for a while). My config.xml file is full of nulls. I also spotted one other file, unrelated to SyncTrazor that had been zeroed out. A file that hasn't changed since 2002, Windows shows it hasn't changed and yet the size had gone from 8KB to zero. The only reason that I spotted this is that the file is part of a SyncThing folder and the files in that folder never get change from this machine and yet it was showing local conflicting changes for that file. That file was definitely not in use during the Windows updates, it is a basically a backup of stuff I've not looked at in many years. I wonder what other files Windows has managed to clear the contents of... The two files were impacted differently though, config.xml was full of nulls, the other file was just zero length. |
As a suggestion, easiest way to resolve this is probably to make the save operation write to a temporary file first in the same directory, and then overwrite the existing config file with an atomic move. |
That's what currently happens. https://github.com/canton7/SyncTrayzor/blob/master/src/SyncTrayzor/Utils/AtomicFileStream.cs |
@canton7 Maybe it needs to call https://docs.microsoft.com/en-us/dotnet/api/system.io.filestream.flush?view=net-6.0#overloads
Seems like |
I sometimes get this problem on power loss on Windows 10, and now on Windows 11. The config file is exactly 4096 bytes, all zeroes, every time this happens. |
The only difference between That shouldn't matter. We're just about to close the file handle, and when we do that, the OS will lazy-write any unflushed buffers to disk. But, whether the OS does write any unflushed buffers to disk or not shouldn't matter, because we've just been writing to a temporary file: we're about to move that to the proper config file. That call to
The fact that we're seeing any changes at all to |
Although, there are hints that |
I'm seeing this on a regular basis. I usually delete the config.xml file and then things just continue to work. I'm actually synching the folder which contains the config.xml file (for backup), could this be causing it? |
Yeah just got the "all NULLS" config.xml as well. But then I accidentally deleted the Syncthing config, not the SyncTrayzor config. So that's nice. |
I just lost Synctrayzor's config.xml to null bytes after I powered on the laptop, it seemed to work and then did something weird and went black, and I powered on again. :( I've also had other files in AppData disappear recently, with apps acting like they were just started for the first time. Not sure if related. |
I just got the "Failed to parse the configuration file" box, after BIOS update.
This is a Windows 10 Pro system with AMD Ryzen 5600G and a lower end Asus B550 motherboard. I ran the update in the BIOS, with its EzFlash tool. After the update was done, and before the system proceeded to start booting to Windows 10, I entered the newly installed BIOS. The BIOS settings were reset so I re-configured everything just like they used to be before. After that I saved the settings, restarted the system, and after booting to Windows and logging in I was greeted with the "Failed to parse the configuration file" box. This is just to let you know in what situation I got this error message. It's the first time I see that. And I don't really know if it's BIOS update related but this is where I got it. I'll now try to solve this by hand, or by deleting the config.xml Thanks, cheers! Edit: deleting config.xml solved this for me. |
Same NULL-bytes error in SyncTrayzor after Win update here. Deleting trayzor's config.xml helped, all is good now. |
Hello,
From time to time Synctrayzor (1.1.21) fails to start. This happens on two different Windows 10 laptops, maybe every month or two. A dialog box appears with the message:
Looking at config.xml I can see that all characters have been replaced, somehow, by the null character.
I don't care about going to %appdata% and deleting the file, but other people here have trouble with this. I have found a similar issue #120 but it is closed.
Thank you for SyncTrayzor.
Greetings,
Márcio Moreira
The text was updated successfully, but these errors were encountered: