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."}}))
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.
There is definitely something odd going on. Let’s try the following steps, which will help to confirm a couple of things:
Exit any running odrive clients. (Windows 11 system, Linux system, etc…)
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.
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.
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?
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.
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.
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.
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.
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.
Sorry, I’ve been busy at work the past couple of weeks, so I’m only looking at this now. I’ve just installed version 7307 and will let you know how it goes. Thanks again!
Hi @chris2,
Thanks for sending that. I need to dig a deeper, but it really seems like there is something unique about the “Samsung Gallery” folder that is causing access token issues.
The error being returned in these cases is “Token contains invalid signature”. What is interesting is that the same token seems to be fine when performing operations on other paths.
It looks like there is a special relationship for this folder where Microsoft is performing some backend syncing between OneDrive and Samsung’s service. Is that correct from your understanding? I wonder if that special setup is causing these strange auth issues when trying to interact with that location via Microsoft’s API.
I think your understanding is probably correct. I remember I had to approve some sort of authorization between Microsoft and Samsung when I originally setup cloud backup for my phone with OneDrive. That being said, I have had this working for years before I started getting these errors, so something must have changed on the Microsoft and / or Samsung side that led to this behavior.
Sorry again for the delayed response. I did as you requested and put a ~ in front of the Samsung Gallery folder, but I still see a token error for a different folder - Pictures\Camera Roll. This is an old folder that was used to upload pictures on my old Samsung phone from 4 years ago. It was also used to upload pictures taken on my old Windows phone from 2014 to 2016, so it’s not a folder used exclusively by Samsung. It currently has 2,411 files in it. I’m thinking that these token issues have more to do with folders having too many files in them rather than it does with a special Microsoft / Samsung relationship.
Below is the error line from the main.log file.
06 Dec 11:33:08AM INFO Failed Folder refresh attempt (RSC) for: D:/odrive/OneDrive (Chris)/Pictures/Camera Roll. 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.”}}))
Attached is the odrive pop-up asking me to reauthorize OneDrive in order to read the Pictures\Camera Roll folder.
I’ve been regularly testing with folders that have 3000 and 6000 files. I also am now testing a single folder with over 10,000 images in it (syncing, unsyncing, downloading, uploading). I haven’t hit any errors yet, except for rate limits, so I’m not sure what to make of the error you are seeing with these two folders.
If you exclude that folder with ~ do the “invalid signature” errors go away?