DecSyncCC icon indicating copy to clipboard operation
DecSyncCC copied to clipboard

Unexpected JSON token warning

Open cinghiopinghio opened this issue 4 years ago • 4 comments

Hi,

Since few days I receive weird warnings from the app on Android. The app is notifying the following:

Unexpected JSON token at offset 0: Cannot begin reading element, unexpected token: 127
JSON input:

I suspect that one file is broken but I don't know how to find that file. I checked manually the last changed files in the syncthing directory but I found nothing clearly wrong. I have no conflicting files. If I add new entries to the calendar, the devices sync without problems except the notification on Android.

cinghiopinghio avatar Oct 31 '21 08:10 cinghiopinghio

I have no idea how the ASCII DEL character can end up in the files, but if you use Linux I think you can look for the broken file by executing grep -re "\x{FF}" ~/.local/share/decsync.

39aldo39 avatar Nov 05 '21 22:11 39aldo39

Unfortunately I couldn't find any weird character on the device files. The problem persisted.

Now, while forcing the same device to update to v2 for tasks, the problem is magically gone, so I cannot help with further debugging.

cinghiopinghio avatar Nov 15 '21 09:11 cinghiopinghio

Well. After sanitizing my shared folder I got a period of few days where everything worked fine.

Today after a sudden unwanted reboot of the phone, the error came back. I grepped the folder looking for the offending file without success.

Is it possible that the character ended up in the database due to a sudden forced kill of the app?

I got the annoying notification every time the app try to refresh.

cinghiopinghio avatar Nov 21 '21 13:11 cinghiopinghio

The problem was solved when I cleared the app cache through the system settings.

Which favours the database issue hypothesis.

cinghiopinghio avatar Nov 21 '21 17:11 cinghiopinghio