Google cloud storage bucket stopped working with

Have been using Restic to backup to a Google cloud bucket for a long time (since 2019). In the last few days have started getting the following error:

Fatal: unable to open config file: service.Objects.Get: Get “”: oauth2: cannot fetch token: 400 Bad Request
Response: {“error”:“invalid_grant”,“error_description”:“Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. Check your iat and exp values in the JWT claim.”}

Nothing has changes with the machine to my knowledge. I have several other machines backing up to their own buckets on Google in the same manner and they are still operating as expected.

restic version output: restic 0.15.2 compiled with go1.20.3 on linux/amd64

Run Restic with the following script:

export RESTIC_REPOSITORY="gs:my_google_bucket:/"
export RESTIC_PASSWORD="redacted-password"

export GOOGLE_PROJECT_ID="redacted-project-id"
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/restic_google_storage.json"


/usr/local/bin/restic "$@"

I tried generating a new JSON credentials file however using that made no difference.

Any ideas?


Have you checked the server’s clock? I wonder if it drifted a bit too much.

Hey! That was the problem. Thank you so much for that.

Gonna make sure that machine has either NTP or Timesyncd in there to make sure that doesn’t happen again.

4 posts were split to a new topic: Google Cloud Storage problems

A post was merged into an existing topic: Google Cloud Storage permission denied