mholt / photobak

Back up your content from Google Photos - DEPRECATED: use Timeliner
https://github.com/mholt/timeliner
309 stars 29 forks source link

oauth2: token expired and refresh token is not set #18

Closed viperx77 closed 5 years ago

viperx77 commented 6 years ago

After some period of time (I think one hour) I get this error and sync will no longer work.

mholt commented 6 years ago

Interesting -- did you go through the authentication process at first to set it up, and has it been working okay since then? Meaning, it just stops after 1 hour after setting it up?

Or by "sync" do you mean the process of downloading the photos is happening continuously for an hour, and then it breaks? If you could be more specific about what you're doing, that will help.

viperx77 commented 6 years ago

So I deleted my local content and started over. Here's the command:

photobak -googlephotos [redacted]@gmail.com

And here's the output:

2018/01/07 14:26:08 Getting new OAuth2 token
2018/01/07 15:31:03 listing collection items (attempt 1): Get https://picasaweb.google.com/data/feed/api/user/default/albumid/1000000486896946?imgmax=d&start-index=3001: oauth2: token expired and refresh token is not set
2018/01/07 15:31:03 listing collection items (attempt 2): Get https://picasaweb.google.com/data/feed/api/user/default/albumid/1000000486896946?imgmax=d&start-index=1: oauth2: token expired and refresh token is not set
2018/01/07 15:31:03 listing collection items (attempt 3): Get https://picasaweb.google.com/data/feed/api/user/default/albumid/1000000486896946?imgmax=d&start-index=1: oauth2: token expired and refresh token is not set
2018/01/07 15:31:03 [ERROR] processing Auto Backup: client error listing collection items, giving up: Get https://picasaweb.google.com/data/feed/api/user/default/albumid/1000000486896946?imgmax=d&start-index=1: oauth2: token expired and refresh token is not set

It downloaded 28gb before it crapped out after a little over an hour. When I start it again with the command:

photobak -googlephotos [redacted]@gmail.com

It immediately responds with:

2018/01/07 18:37:24 Get https://picasaweb.google.com/data/feed/api/user/default: oauth2: token expired and refresh token is not set

I hope that's clear. Am I doing something wrong?

ameesme commented 6 years ago

A temporary workaround is to create new credentials using a different installation of photobak, and then manually modifying photobak.db (which is a BoltDB) using a utility like boltbrowser.

mholt commented 5 years ago

I think I've seen this happen when re-authenticating after your application was already authorized by Google; I've been able to fix it by removing the app's access: https://myaccount.google.com/permissions - and then re-authenticating from scratch (doesn't require deleting all the data).

mholt commented 5 years ago

This project has been deprecated in favor of Timeliner. Thank you!