Illegal Character Code in XML


(Ultimatecheese) #1

Whenever I try to run Syncthing, it tells me “FATAL: Config: XML syntax error on line 1: illegal character code U+0000”. (Note that this character is “.”.) Below I paste the log.

[VRNJX] 22:33:30 INFO: syncthing v0.14.27 "Dysprosium Dragonfly" (go1.8.1 windows-amd64) jenkins@build.syncthing.net 2017-04-15 07:38:23 UTC
[VRNJX] 22:33:30 INFO: My ID: VRNJXQR-XVU5556-YDSG5PO-F73HBGM-KU4J72Y-XVQ6F3L-PXN6SSK-WB4IBQW
[VRNJX] 22:33:31 INFO: Single thread SHA256 performance is 176 MB/s using minio/sha256-simd (145 MB/s using crypto/sha256).
[VRNJX] 22:33:31 INFO: Hashing performance with weak hash is 149.99 MB/s
[VRNJX] 22:33:32 INFO: Hashing performance without weak hash is 171.04 MB/s
[VRNJX] 22:33:32 INFO: Default folder created and/or linked to new config
[VRNJX] 22:33:32 FATAL: Config: XML syntax error on line 1: illegal character code U+0000
[VRNJX] 22:33:33 INFO: syncthing v0.14.27 "Dysprosium Dragonfly" (go1.8.1 windows-amd64) jenkins@build.syncthing.net 2017-04-15 07:38:23 UTC
[VRNJX] 22:33:33 INFO: My ID: VRNJXQR-XVU5556-YDSG5PO-F73HBGM-KU4J72Y-XVQ6F3L-PXN6SSK-WB4IBQW
[VRNJX] 22:33:34 INFO: Single thread SHA256 performance is 176 MB/s using minio/sha256-simd (145 MB/s using crypto/sha256).
[VRNJX] 22:33:34 INFO: Hashing performance with weak hash is 149.99 MB/s
[VRNJX] 22:33:35 INFO: Hashing performance without weak hash is 171.04 MB/s
[VRNJX] 22:33:35 INFO: Default folder created and/or linked to new config
[VRNJX] 22:33:35 FATAL: Config: XML syntax error on line 1: illegal character code U+0000
[VRNJX] 22:33:36 INFO: syncthing v0.14.27 "Dysprosium Dragonfly" (go1.8.1 windows-amd64) jenkins@build.syncthing.net 2017-04-15 07:38:23 UTC
[VRNJX] 22:33:36 INFO: My ID: VRNJXQR-XVU5556-YDSG5PO-F73HBGM-KU4J72Y-XVQ6F3L-PXN6SSK-WB4IBQW
[VRNJX] 22:33:37 INFO: Single thread SHA256 performance is 176 MB/s using minio/sha256-simd (145 MB/s using crypto/sha256).
[VRNJX] 22:33:37 INFO: Hashing performance with weak hash is 150.93 MB/s
[VRNJX] 22:33:38 INFO: Hashing performance without weak hash is 171.04 MB/s
[VRNJX] 22:33:38 INFO: Default folder created and/or linked to new config
[VRNJX] 22:33:38 FATAL: Config: XML syntax error on line 1: illegal character code U+0000
[VRNJX] 22:33:39 INFO: syncthing v0.14.27 "Dysprosium Dragonfly" (go1.8.1 windows-amd64) jenkins@build.syncthing.net 2017-04-15 07:38:23 UTC
[VRNJX] 22:33:39 INFO: My ID: VRNJXQR-XVU5556-YDSG5PO-F73HBGM-KU4J72Y-XVQ6F3L-PXN6SSK-WB4IBQW
[VRNJX] 22:33:40 INFO: Single thread SHA256 performance is 176 MB/s using minio/sha256-simd (145 MB/s using crypto/sha256).
[VRNJX] 22:33:40 INFO: Hashing performance with weak hash is 149.05 MB/s
[VRNJX] 22:33:41 INFO: Hashing performance without weak hash is 171.04 MB/s
[VRNJX] 22:33:41 INFO: Default folder created and/or linked to new config
[VRNJX] 22:33:41 FATAL: Config: XML syntax error on line 1: illegal character code U+0000

Note that it is mostly just repeating the same message. I never used to have this issue. I’ve made sure I’m using the most recent release, but that hasn’t fixed it.

Any advice would be appreciated :slight_smile:


#2

Did you manually edit the file?

U+0000 isn’t “.”, it’s NULL, a control character which isn’t allowed in XML files and which most editors don’t display.

You can open the file in Notepad++. It will display the character so you can remove it.


(Ultimatecheese) #3

Thanks for your response. No, I didn’t edit it. The only reason I suggested it was “.” is because of the following error message when using SyncthingTray.

I’ll try to edit the file… but first I don’t actually know which file it is! Can you help me there? :slight_smile:


#4

The file is config.xml, but where you can find it depends. Normally I think it’s in %APPDATA%\Syncthing or %localappdata%\Syncthing, but it could also be in the path you specified in SyncthingTray.

The invalid character should be displayed like the CR / LF in this screenshot, and should be visible without any special settings in Notepad++. It could also be, that the first few characters in the file are just unidentifiable junk. Either way, the file should start with a <, so everything else at the start should be removed.


(Ultimatecheese) #5

When I open with IE or Wordpad, the file is completely blank. I downloaded and installed Notepad++, and it is just a list of 8748 “NUL” characters looking like the ones in your screenshot. See screenshot.

I guess one could say that’s quite bad =P – any ideas on how this might be fixed? :slight_smile:


(Audrius Butkevicius) #6

If its only nulls, then there is nothing you can do to recover apart from removing it and reconfiguring syncthing from scratch. There might be an older version of the config in the same directory which you might be able to use.


(Ultimatecheese) #7

There was config.xml.v15 and config.xml.v16. So I renamed config.xml as config_old.xml and config.xml.v16 as config.xml. It said “Archiving a copy of old config file format at: C:\Users\Sam\AppData\Local\Syncthing\config.xml.v16”, and now is getting on with scanning as is should.

So that’s sorted, thanks very much! :slight_smile:


(system) #8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.