Bad request 400, backup to GCS

I’ve started using Duplicacy GUI to run a backup to GCS.
Had everything setup correctly, downloaded the JSON token file.
It was working for several days but now every run it says :
oauth2: cannot fetch token: 400 Bad Request
The token itself in the GCS console has not expired.

many thanks for the help.

This is GCS.
I just bought the license, so it is not in trial.

The full error message is :

Running backup command from C:\ProgramData/.duplicacy-web/repositories/localhost/0 to back up E:/Management
Options: [-log backup -storage m12345_h -threads 1 -stats]
2024-11-16 11:47:26.253 INFO REPOSITORY_SET Repository set to E:/Management
2024-11-16 11:47:26.490 INFO STORAGE_SET Storage set to gcs://m12345_h/Management/
2024-11-16 11:47:27.417 ERROR STORAGE_CONFIG Failed to download the configuration file from the storage: Get “https://storage.googleapis.com/storage/v1/b/m12345_h/o/Management%2Fconfig?alt=json&prettyPrint=false&projection=full”: oauth2: cannot fetch token: 400 Bad Request
Response:
Failed to download the configuration file from the storage: Get “https://storage.googleapis.com/storage/v1/b/m12345_h/o/Management%!F(MISSING)config?alt=json&prettyPrint=false&projection=full”: oauth2: cannot fetch token: 400 Bad Request

Thanks,
Eyal

Is the token file still present on disk? (Duplicacy only saves the path to the token file, instead of increasing its content).

Yes, it is still in the same place and name as it was when I had it setup. and in Google console it says the token is valid.

Interesting. Maybe it’s some oauth shenanigans. @gchen ?

How did you obtain your token file? Can you try getting here again: Google Cloud Platform for Duplicacy

Yes, I’ve already got it twice after the setup from that link, however, it works at first, and after some time stops with the same error.
If I delete the storage setting and recreate it with the same json file, it starts working again until failing after some time.

I started with this same error message today, first time ever its failed, been working solid for months. gcd-token.json file still in-place and intact. Grabbed a replacment token from the link from gchen and it failed with an uninitialised storage backend error. Any advice welcome?

Same issue here, stopped working a few days ago with identical error message. I have not tried grabbing a new token yet (backing up to other targets as well, so not urgent for me).

I had the same problem / error message.

Even though my token was a full access scoped I thought I avoided the mass purge of these types of token reported a month or so ago.

I should have migrated to a app scoped token back then.

Whatever I did even trying to follow the instructions to fix this didn’t help me. I obviously couldn’t access the Duplicacy backup as the token was gone and trying to copy the files manually to the new Duplicacy setup directory with Google Drive didn’t work I just ended up with two directories with the same name in the same directory (!!!) - presuming with different permissions. It was a mess.

Luckily I had a partial local copy so I could setup a new token and configure a bit identical copy and transfer it over and get everything back in sync. Lost several weeks of backups and a day sorting it out / reuploading but not a complete disaster it could have been much worse.

Lesson learnt either backup locally first and then copy to Google Drive or stop using Google Drive!

2 Likes

Thanks, wasn’t aware of a Google token change so the thread you linked go me to my solution/fix. FWIW that fix did work for me as in I was able to reuse the original drive backup files without having to start all over again.

Glad it worked for you.

I spent hours trying and just had to accept I had lost several weeks of backups. I couldn’t get my head around how to access the old files as the old token had been revoked so Duplicacy couldn’t access it and when trying to use Google Drive I was getting duplicate directories instead of it combining into the new Duplicacy storage location.

Perhaps it works if using the GUI instead of the command line or I was not using Google Drive correctly.

As the old files that were copied with Google Drive were not created by Duplicacy I do not see how the new token could access them.

Very strange.

@eyalserv how long did the backup start to fail after creating the new token? The token file should not change at all, so you can make a copy when it is working and then compare two files when it starts to fail.