Cloud Sync Task - Google Photos not starting

devinbaines

Cadet
Joined
Apr 15, 2022
Messages
5
Greetings. New around here.

I've got a fairly fresh install of TrueNAS-SCALE-22.02.0.1 and I have added credentials for my personal OneDrive and Google Drive accounts and successfully added cloud sync tasks for them to back up into a local folder on a shared drive I created for the purpose. They run daily at midnight without issue. Set to pull and sync.

I added credentials for Google Photos (actually, the credentials for my Google Drive account were already there) and went to add a cloud sync task for that as well. I've tried doing a dry run as well as running the task and under the Task Manager window, I see the following:

Updating​

cloudsync.sync 0.00%

Starting

And that's as far as it gets. Never moves past 0.0%

Any thoughts or ideas? Something I am missing between using the Google Photos service vs. OneDrive or Google Drive?
 

devinbaines

Cadet
Joined
Apr 15, 2022
Messages
5
Still looking for advice on this issue. Basically, the Google Photos Cloud Sync task does not move beyond 0.0% in either a dry run or when started manually.

Thoughts?
 

NightFish

Cadet
Joined
Jun 4, 2022
Messages
7
Hi there,

I was having the same issue. I searched through logs and found nothing. It was just rclone saying "0% done, 0 Bytes/s, ETA: -" which was not very helpful.

Turns out the download wont start when I use the Google authentication provided by TrueNAS aka the button in the Cloud Credentials add dialog that says "Log In To Provider".
I had to create my own Google Photos API Credentials then log in using rclone on my personal computer to get the access token to give TrueNAS.

EDIT: You can find the updated steps in this resource https://www.truenas.com/community/resources/creating-custom-google-photos-api-credentials-for-cloud-sync-task.188/

Steps to do this:

1. Go to https://console.cloud.google.com/apis/dashboard and create a new API project using the drop down in the top left. Make sure your new project is selected.
2. Once in your new project, go to the "Enabled APIs & services" menu on the left.
3. Click "Enable APIs and services" near the top
4. Search for "Photos Library API" and enable it
5. Go back to the API dashboard and click "OAuth consent screen" and then configure
6. It will ask you to configure consent screen. Select "External" then "Create"
7. Fill in the app name, support email and developer contact info then click "Save and Continue"
8. Skip the scopes section
9. Add the Google email address you want to use for Photos on the TrueNAS as a Test User.
10. Go back to the API dashboard and click credentials
11. Click "Create Credentials" and then "OAuth Client ID"
12. Select "Desktop app" as the application type and enter a name.
13. Copy your client ID and Client secret.
14. On your own computer, install rclone and then type "rclone config"
15. Type "n" for new remote and type a name
17. Type "17" for google photos remote type
18. Fill in the client ID and secret from Google API dashboard
19. Type false for readonly
20. Dont edit advanced config
21. Type "y" for auto config and log in to your Google Account in the browser. It will say google hasnt verified the app but hit continue.
22. Tick the box for "See, upload, and organize items in your Google Photos library." and hit continue.
23. Type "y" to whatever rclone says now and it should print out something like:
[remote]
type = google photos
client_id = 098230283-adhadfklo304y304y3y.apps.googleusercontent.com
client_secret = ABCDEF-asdasdasd-lkajhdasdhasdh23
token = {"access_token":"asdhlaksdhasdh", "token_type":"Bearer","refresh_token":"akdhasdoasdp","expiry":"1234"}

24. Go to TrueNAS and add a new cloud credential for Google Photos.
25. Copy the client ID, client secret and token from rclone into the dialog. Do not click "Log In To Provider"
(When entering the access token into TrueNAS make sure you enter the whole token, That means include the curly brackets and everything in them)
26. Hit "Verify Credentials" and if that works then save and go set up your cloud sync task with the new credential and it should work.


Sorry there are so many steps. Most of it is pretty self explanatory, just thought I'd go into detail for anyone that has not used the Google API Dashboard before.
 
Last edited:

devinbaines

Cadet
Joined
Apr 15, 2022
Messages
5
Hi there,

This is super helpful. At step 7, what do I enter as the app name?

7. Fill in the app name, support email and developer contact info then click "Save and Continue"

Thanks.

Devin
 

devinbaines

Cadet
Joined
Apr 15, 2022
Messages
5
Nevermind - I figured it out.

I followed all the steps and it worked!! It's been bugging me for a while - thank you for your assistance. Greatly appreciated.
 

willekind

Cadet
Joined
Jun 5, 2022
Messages
1
Thanks for the guide - very helpful. I got stuck on step 21.

I tried browsing to the link http://127.0.0.1:53682/auth?state=QTBPzl5H4xFT8TW-JVIjhg but it didn't work. I tried replacing the 127.0.0.1 with the IP of my NAS box but couldn't get it to work.
1654438559240.png
 

Dice

Wizard
Joined
Dec 11, 2015
Messages
1,410
@NightFish nice writeup, consider making a Resource of it, as this may help many others too.
 

NightFish

Cadet
Joined
Jun 4, 2022
Messages
7
Thanks for the guide - very helpful. I got stuck on step 21.

I tried browsing to the link http://127.0.0.1:53682/auth?state=QTBPzl5H4xFT8TW-JVIjhg but it didn't work. I tried replacing the 127.0.0.1 with the IP of my NAS box but couldn't get it to work.
View attachment 55890
Hi there, you can also do "n" at that step and it will give you a link to go to in your browser and your browser will give you a code to paste back in.
I might update the instructions to use that method instead of auto configure.

Also, nice idea to use the truenas itself as the rclone box considering it already has it installed! I might update the instructions to use that too.

Let me know if you have any more issues.
 

NightFish

Cadet
Joined
Jun 4, 2022
Messages
7
Hi there,

This is super helpful. At step 7, what do I enter as the app name?

7. Fill in the app name, support email and developer contact info then click "Save and Continue"

Thanks.

Devin
Glad you got this working in the end.
For anyone else having issues with this step:
It doesn't really matter what the name is. I just called mine "TrueNAS", and the support email and developer email should be your google email address.
 

Gorf

Dabbler
Joined
Jan 5, 2017
Messages
20
Starting with Step 24, the TrueNas console doesn't really align. For starters in step 24, there is no "Google Photos" option. There is just Google Cloud Storage and Google Drive. Only the G Drive option accepts the ClientID and Secret option however...

1659206579567.png


Once you put that in, there is no option to simply accept of verify the credentials. You MUST choose the Log In to Provider option as your only next step.

1659206790212.png


Additionally the Google Drive requires the Access Token option to be set.
 

Gorf

Dabbler
Joined
Jan 5, 2017
Messages
20
haha well, all this to discover now that the download component is basically a joke thanks to Google hamstringing the API.
 

NightFish

Cadet
Joined
Jun 4, 2022
Messages
7
Starting with Step 24, the TrueNas console doesn't really align. For starters in step 24, there is no "Google Photos" option. There is just Google Cloud Storage and Google Drive. Only the G Drive option accepts the ClientID and Secret option however...

View attachment 57250

Once you put that in, there is no option to simply accept of verify the credentials. You MUST choose the Log In to Provider option as your only next step.

View attachment 57251

Additionally the Google Drive requires the Access Token option to be set.
Are you using TrueNas Core? If I recall correctly Core does not support Google Photos, only Scale does which is what I based my tutorial off of.

There are still some issues with my tutorial mainly that TrueNas does not refresh the token so you have to re-do all this regularly.
 

krypticnexus

Cadet
Joined
Aug 16, 2022
Messages
1
I did this and sadly it does the same as if I just did the provider button. Never starts. I would like to use this feature but i would assume its a google issue but we all know this will never be fixed.
 

OrcD3vil

Cadet
Joined
Aug 18, 2022
Messages
9
Are you using TrueNas Core? If I recall correctly Core does not support Google Photos, only Scale does which is what I based my tutorial off of.

There are still some issues with my tutorial mainly that TrueNas does not refresh the token so you have to re-do all this regularly.
How often do you have to "redo" the token as I did it yesterday for first time and now it won't work on next sync
 

te45a

Cadet
Joined
Apr 6, 2018
Messages
3
ok, what am I missing, I don't see 19. Type false for readonly, I see bucket_acl and object_acl that deal with permissions, what am I doing wrong?

thank you
 

fallstop

Cadet
Joined
Oct 20, 2022
Messages
1
ok, what am I missing, I don't see 19. Type false for readonly, I see bucket_acl and object_acl that deal with permissions, what am I doing wrong?

thank you
Check you haven't selected Google Drive as the rclone remote during step 17. In my rclone version (v3.2.6), the list of remotes has Google drive as #17, google photos as #19.
 

te45a

Cadet
Joined
Apr 6, 2018
Messages
3
Check you haven't selected Google Drive as the rclone remote during step 17. In my rclone version (v3.2.6), the list of remotes has Google drive as #17, google photos as #19.
You are absolutely correct, in version of reclone I used Google Photos is 19, thank you!
 

hynsey

Cadet
Joined
Feb 12, 2023
Messages
1
Hi folks,
I've gone through the updated steps, but after I use rclone, and then go to Verify the cloud Credentials, I get this error:

couldn't list directory: googleapi: Error 403: Request had insufficient authentication scopes.

Error: 2023/02/12 15:20:01 ERROR : : error listing: couldn't list directory: googleapi: Error 403: Request had insufficient authentication scopes.
Details:
[
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"domain": "googleapis.com",
"metadata": {
"method": "google.apps.drive.v3.DriveFiles.List",
"service": "drive.googleapis.com"
},
"reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT"
}
]

More details:
Reason: insufficientPermissions, Message: Insufficient Permission
2023/02/12 15:20:01 Failed to lsjson with 2 errors: last error was: error in ListJSON: couldn't list directory: googleapi: Error 403: Request had insufficient authentication scopes.
Details:
[
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"domain": "googleapis.com",
"metadata": {
"method": "google.apps.drive.v3.DriveFiles.List",
"service": "drive.googleapis.com"
},
"reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT"
}
]

More details:
Reason: insufficientPermissions, Message: Insufficient Permission

Appreciate any help!
 
Top