Trouble Syncing Samsung Gallery Through OneDrive

I have my OneDrive account synced with odrive using Windows 11 Desktop Client 7301. Recently the Samsung Gallery items from inside OneDrive\Pictures will not sync. I get the following error message in main.log.

26 Oct 03:16:29PM INFO Failed Folder refresh attempt (BC) for: D:/odrive/OneDrive (Chris)/Pictures/Samsung Gallery. Error: code o_ITEM_NOT_FOUND caused by odriveItemNotFoundException(code o_ITEM_NOT_FOUND)

I have tried unlinking my OneDrive account from odrive and relinking. I have also tried unlinking my Samsung account from OneDrive and relinking. Still the issue persists. Any ideas?

Edit: I confirmed that i get the same error on Linux when attempting to refresh my Samsung Gallery folder within OneDrive. Also, other folders in my OneDrive sometimes give the following error.

27 Oct 11:26:51AM INFO Failed Folder refresh attempt (RSC) for: /mnt/data/odrive/OneDrive (Chris)/Backup/Chris/2005-06-24/Documents/My Finances. Error: code OD_SESSION_EXPIRED - Exhausted refresh token attempts (4) (RefreshTokenRequestException) caused by RefreshTokenRequestException(code OD_SESSION_EXPIRED caused by OneDriveLoginRequestException(code OD_SESSION_EXPIRED - {"error":{"code":"unauthenticated","innerError":{"code":"invalidSignature"},"message":"Token contains invalid signature."}}))

Hi @chris2,
Is there anything unique about the Samsung Gallery folder?

Can you send over a diagnostic from the odrive tray menu, so we can take a closer look? Just let me know when it has been sent.

Hello Tony,

Thanks for looking into this for me. I have sent a diagnostic. I have also attached the diagnostic file saved locally. Please let me know if you find anything useful.

current_odrive_status.txt (5.0 KB)

Thanks @chris2.

There is definitely something odd going on. Let’s try the following steps, which will help to confirm a couple of things:

  1. Exit any running odrive clients. (Windows 11 system, Linux system, etc…)
  2. Go to the odrive web client (odrive | Sign in) and try to navigate into the Samsung Gallery folder.
  • Are you prompted to reauthorize the OneDrive account?
  • Are you able to navigate into that location? What about other locations within that OneDrive link?

If you are able to navigate into the Samsung folder on the web client, startup the Windows 11 client again, wait about 5 minutes, and see if you are able to sync in that folder now.

Hi Tony,

It is interesting that you ask about being prompted to reauthorize my OneDrive account, because the odrive client is constantly asking me to reauthorize in order to access my Camera folder inside of OneDrive\Pictures\Samsung Gallery\DCIM. When I reauthorize it doesn’t help though, I get the same errors.

When I exit out of my odrive client and navigate to the Camera folder within odrive.com, I can navigate there without reauthorizing. I can even see many of my pictures. However, when I scroll down to see my most recent pictures, the screen freezes for several seconds until kicking me out back to my odrive root folder.

Before scrolling down:

After scrolling down, before being kicked out:

After being kicked back to root folder:

Other locations within my OneDrive folder appear to load just fine. I’m wondering if it’s because I have over 1,000 files in my Camera folder? Is there an issue syncing folders with too many files?

Thanks @chris2!

This may have to do with OneDrive rate limiting while listing the folder. I’m going to do some testing with larger folders.

Do you know how many items are in that folder, total? Is it close to 1000, or could it be several thousand?

Hi Tony,

There were probably more than 3,000 files in that folder before I started manually cleaning it up. Interestingly, the web client for OneDrive will only list 100 files at a time. I have to keep scrolling down to see all of them. I started manually cleaning them up and I think I have got the total down to around 1,200 right now. I’ll let you know if the errors go away once I clean out the folder.

Thanks for all of your help!

Hey @chris2,
Just letting you know I haven’t forgotten about this. There is a new test version in the works that I would like you to try, once it is ready.

The new version has improvements to the OneDrive integration to deal with rate limiting and with larger folders. It also has some optimizations around session handling/refreshing.

I will ping you once it is available!

1 Like

Thank you Tony! You’ve been very helpful and I really appreciate it. I have done some playing around with my OneDrive folder and I have some interesting observations.

  • I kept deleting files from my OneDrive\Pictures\Samsung Gallery\DCIM folder using the Microsoft OneDrive web interface and then trying to refresh in my odrive client. Even when I got the number of files down to 585, odrive client still gave me “Token contains invalid signature” errors when I tried to refresh.
  • However, when I finally deleted all files from the web interface (after downloading them so I wouldn’t lose them of course), I was finally able to successfully refresh my odrive folder and it successfully deleted all files in that folder.
  • My problem with the current odrive client and OneDrive is not completely solved, however. I am now seeing refresh errors for other folders with large numbers of files in them that successfully refreshed in the past.
  • These folders haven’t changed in years, but something seems to have changed with the OneDrive API recently to cause this.
  • Recently odrive attempted to redownload ALL of my OneDrive files. Again, I suspect something recently changed with the OneDrive API.

Again, thank you for your help. I look forward to your test version that I can try out.

Hi @chris2,
Here is the new version

To install:

  1. Exit odrive from the odrive tray menu
  2. Download
  3. Install

Please let me know how it goes and if the behavior seems to be improved!

Hi Tony,

At first it seemed like the new version fixed a lot of problems. I was able to refresh a lot of folders that I wasn’t before, and I didn’t see any errors in the log for a couple of hours. However, I have another folder with 2,411 files in it that will not refresh (OneDrive (Chris)\Pictures\Camera Roll). I get the same errors for this folder that I did with the previous client 7301. I have attached my diagnostic log and I sent it at 5:09 PM CST.

Thanks again for all your help.

current_odrive_status.txt (5.2 KB)

Hi @chris2,
Thanks for continuing to help with this.

Here is another version to try. (Exit odrive, download, and install)

This version has some additional logging for session refreshing and for remote file updates and a couple of logic tweaks.

I was seeing in the logs that a lot files that are updating from remote to local, which should only be happening because of a remote content change. Content changes are detected when OneDrive’s “content tag” (cTag) has changed. This should not change unless the content of the file has actually changed. It sounds like the expectation is that these files have not changed, which makes this odd, so the cTag info has been added to remote to local update logging to give more visibility into this.

Hey @chris2,
Here is newer version that addresses an issue I found earlier today with the previous one.

Let me know when you are able to give it a shot!