Invalid character '3' after top-level value - OneDrive

This is in realated to topic: Cannot re-connect to one drive storage - Support - Duplicacy Forum
I created that topic long time back and there was a solution posted. It worked for a while, but now I am getting same issue very often.

I am using GUI version of duplicacy in an unraid using docker. I have a persistant location for the onedrive token in the docker compose (this was suggested previously)
image

I have noticed that the duplicacy finds the error very often now:

Running backup command from /cache/localhost/0 to back up /backuproot/arraydata/nextcloud-data
Options: [-log backup -storage OneDrive -threads 1 -stats]
2023-01-06 15:15:49.774 INFO REPOSITORY_SET Repository set to /backuproot/arraydata/nextcloud-data
2023-01-06 15:15:49.774 INFO STORAGE_SET Storage set to one://BACKUPS/Duplicacy
2023-01-06 15:15:49.792 ERROR STORAGE_CREATE Failed to load the OneDrive storage at one://BACKUPS/Duplicacy: invalid character '3' after top-level value
Failed to load the OneDrive storage at one://BACKUPS/Duplicacy: invalid character '3' after top-level value

If I create a new storage with the new token it works, but this defeats the purpose of backup as I have to do it almost every other day now. Suprisingly, if I compare token files with notepad++, there is no difference; they are exactly same. In that scenario, I am not sure how and where duplicaly is able to detect invalid character ‘3’, I am guessing it is not in the token itself.

Your guidance will be very helpful. If you need any information please let me know.

Thank you,

Can you PM me the toke file with actual tokens redacted?

Hi @gchen : I messeged you my token file. Can you lookinto it.

The invalid character ‘3’ is after the the ending bracket. It looks like it was from the previous token, which means when the file was rewritten during the token refresh, the file wasn’t truncated correctly. This can be caused by multiple backup jobs trying to refresh the token at the same time. Do you have multiple parallel backup jobs?