Resource icon

Creating custom Google Photos API credentials for Cloud Sync Task

The Issue:
Some people have encountered an issue where Google Photos Cloud Sync Tasks are stuck on 0% and will not start. If you look into the rclone logs it says "0% done, 0 Bytes/s, ETA: -".

The issue is something to do with the API credentials that get generated when you use the "Log In To Provider" button:


The Fix:
The workaround for this issue is to create your own Google Photos API credentials and use those instead.

Hint: If you decide to use the TrueNAS shell for the rclone steps, you can use CTRL + INSERT to copy and SHIFT + INSERT to paste.

Steps:
  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".
    (It does not really matter what you name your app, I called mine "TrueNAS Scale". Use your Google email address for the support email and developer contact.)

  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.
    (The name here does not matter either, I just called mine "TrueNAS")

  13. Copy your client ID and Client secret.

  14. On your own computer, install rclone and then type "rclone config".
    (You can also do this in the command line shell on your TrueNAS but make sure to select "N" for headless mode in step 20)

  15. Type "n" for new remote and type a name.

  16. Type the number associated with the "Google Photos" remote type.
    (Likely number 17 or 16 depending on your rclone version)

  17. Fill in the client ID and secret from Google API dashboard.

  18. Type false for read_only.

  19. Don't edit advanced config.

  20. Type "y" for auto config and log in to your Google Account in the browser. It will say google hasn't verified the app but hit continue.
    (If you are doing this in the TrueNAS shell or on a headless computer, type "n" and follow the link)

  21. Tick the box for "See, upload, and organize items in your Google Photos library." and hit continue.
    (If you are using the TrueNAS shell, copy the Authorization code from Google and paste it into the shell)

  22. Type "y" for the warning about media types 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"}

    You'll want to copy this text into a text document if you're using the TrueNAS shell or you will lose it when leaving the shell.

  23. Type "y" when rclone asks you if the config looks OK. You can now quit rclone.

  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.
Author
NightFish
Views
8,409
First release
Last update
Rating
4.75 star(s) 4 ratings

Latest reviews

A couple details need to be updated as rclone has been updated to remove OOB requests, so the look & feel of stumbling through the process is a little different.

Users also need to put their API application into production (not just testing) or else credentials expire after 7 days. This key detail is missing and causes a lot of confusion when the sync starts failing.
great guide
Thank you!
It was so confusing to see the option in the UI yet not working out of the box.
super helpfull
Top