Google Photos sync with TrueNas scale

Hi, Is it possible to sync Google Photos with a shared folder on a TrueNAS Scale? and how?
thx

Hallo, and thank you for the information, I did all that, but I got an error :

[EINVAL] attributes.folder: Pulling from the root directory is not allowed. Please, select a specific directory.

So what is the wrong I did here ? Could you please help ?

Apologies. There has been a significant overhaul to that article in preparation for 24.10 that includes better instructions and troubleshooting for that error. I had forgotten those improvements weren’t included in the 24.04 branch. Try this one:

Thank you very much for your effort but when i try to sync I got this error :slight_smile:
[EFAULT] Errors: 1 (retrying may help) Elapsed time: 0.2s <6>INFO : Google Photos path “album”: Committing uploads - please wait… Failed to sync: couldn’t list albums: Get “https://photoslibrary.googleapis.com/v1/albums?pageSize=50”: couldn’t fetch token: invalid_client: if you’re using your own client id/secret, make sure they’re properly set up following the docs.

This is very strange, could you please help and if there is some tutorial video?

Thank you very much

again this error :

Pulling from the root directory is not allowed. Please, select a specific directory.
More info…
Error: Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/middlewared/job.py”, line 469, in run
await self.future
File “/usr/lib/python3/dist-packages/middlewared/job.py”, line 511, in __run_body
rv = await self.method(*args)
^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/schema/processor.py”, line 187, in nf
return await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/middlewared/plugins/cloud_sync.py”, line 1077, in sync_onetime
verrors.check()
File “/usr/lib/python3/dist-packages/middlewared/service_exception.py”, line 70, in check
raise self
middlewared.service_exception.ValidationErrors: [EINVAL] attributes.folder: Pulling from the root directory is not allowed. Please, select a specific directory.

As the error says, the task is targeting the wrong directory. The Before You Begin and Troubleshooting sections of the updated article explain how to set this up.

I’ve never seen the other error, but it seems to indicate a misconfiguration with your Google Photos API ID and Secret credentials.

I’m not aware of any video tutorials, but my advice would be to start over from the beginning, following the instructions in the updated article, and see where that gets you.

Hi again,

I checked everything, including the Photos API ID, and everything looks fine. However, I don’t think TrueNAS has a real function to deal with Google Photos. It can handle Google Drive, which I have no problem syncing, but with Google Photos, there is no way. I searched online, and no one seems to have successfully synced with Google Photos. Unfortunately, I think this is one of the downsides of TrueNAS.

Thank you anyway for your replies.

Hi

encountered similar issue:

<6>INFO : Google Photos path “album”: Committing uploads - please wait…
Failed to copy: couldn’t list albums: Request had insufficient authentication scopes. (403 PERMISSION_DENIED)

did anyone was able to resolve it ?

I haven’t come across that error. A google search for that message suggests that it probably has something to do with the way you’ve configured permissions on your Google API token

Hi all - new user here and just getting set up. Already configured Drive, and now was following the documentation for Photos. I’m getting the same error mentioned (permission denied due to missing scopes).

Not only can I reproduce by running the backup task, but also when setting up the backup task and selecting folders, if I go to expand folders like “albums” or “all” in media, it gives me the error message.

possible that Google changed their API to require scopes which will also force verification?

It’s possible. I know they steps in that article worked at the time it was last updated and I never ran into the scopes error in testing, so it’s possible there was an upstream change.

If you’re able to reliably reproduce the issue, can you please submit a bug report with a debug file from the system in the failed state so our engineers can take a look at it?

Thanks for the reply, did some digging and found these:

https://developers.google.com/photos/support/updates

Bad news is that it even impacted a super popular FOSS project called gphotos-sync: https://github.com/gilesknap/gphotos-sync

https://github.com/gilesknap/gphotos-sync-discussion/discussions/1

Google will be changing the authorization scopes for Google Photos on March 15th 2025 as described … There is no way that a backup tool like gphotos-sync can operate under the new scopes.

For a discussion on the impact see …

You can still use the current version of the software until March but after that it will cease to operate. Over the last 9 years with the help of many contributors we have ironed out most of the bugs in this tool. Those few remaining issues outstanding, I’m afraid I don’t have motivation to spend time on them when there are only a few months of operation left.

That doesn’t explain why it isn’t working now for me, but might be a foreshadowing of things to come :frowning:

One possible solution is to use Syncthing. I use Syncthing on macOS to sync my iCloud folders to TrueNAS as a backup. This has worked really well for me. I imagine all one would need to do is set up a device on your network with Google’s native client and sync that folder via Syncthing to your TrueNAS box.
Good luck!

These instructions work for me with one exception.

The token is only good for an hour and has to be manually renewed with sudo rclone authorize “google photos” which makes it impossible to run as a regular cloud sync task. I have 3 Google Photos accounts to backup so this is a bummer. My QNAP NAS has an app called MARS that handles a daily Google Photos sync fine so I know it is possible. I hate to have to keep the QNAP running just for this one thing since everything else moved to TrueNAS without a problem. Does anyone know a way around this?

This thread suggests that there may be an rclone configuration issue preventing the token from automatically refreshing. Take a look and see if it’s relevant to you:

Thanks. It is a bit of a challenge trying to map this to the built-in rclone on TrueNAS Scale, but I am poking around to see if I can figure out something.

I read that the token really does expire in an hour, but the refresh token is then used to renew it. rclone built into TrueNAS doesn’t ask for a refresh token so I don’t know how it can use it.

I’m not sure then. When I tested and documented that tutorial I generated the rclone token on another system, not on TrueNAS itself, so I haven’t tried using the built-in.

Thanks for the help. I will look into the article more tomorrow since I didn’t find anything like the rclone config file so far. I am generating the token on a different system then pasting it into the TrueNas backup credentials. It works as long as I start the sync before an hour. Even a several hour sync worked. It just doesn’t let me start a new one after an hour unless I get a new token. I think I tried it on my Ubuntu PC as well and had the same problem, but I am not sure if I remember correctly since I tried so many things.

It must be an issue specific to the builtin rclone on TrueNAS Scale since it works fine on my Ubuntu PC even after the token is several days old. I will open a ticket with Truenas. None of the steps to find the rclone config file work on TrueNAS so I can’t check the permissions, etc. I have 3 Google Photo accounts I am trying to routinely backup so I guess I will have to switch to manual and just get a new token each time.