-
-
Notifications
You must be signed in to change notification settings - Fork 868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Local File Time Discrepancy Issue #3057
Comments
Now did a directory with only two files inside, one binary and one 7z file, here's the full log:
and now I added a PPTX file, and synced without --resync, here's the output, we can see download, then upload due to timestamp change, then re-download due to enrichment:
|
This is not a bug - sorry. This is how this client operates to deal with Microsoft SharePoint and the issues it creates.
This is because of a 'feature' (a bug) with Microsoft SharePoint. As per the application output, please read: OneDrive/onedrive-api-docs#935 Microsoft will modify all files (except certain file types such as .txt) and change the file post upload - so the file you have locally is no longer the same file as the file online. As you are using a OneDrive Business Account, please complain to Microsoft about why their SharePoint product willfully modifies your files post upload, breaking all notion of expected file integrity. |
Yes I understand the issue on upload and it's OK. |
The answer lies in the application output you provided. Your API response from your SharePoint system is not providing the full details for a file - this is an API inconsistency - ie a bug with Microsoft OneDrive itself. Because the API data is incomplete, the 'onedrive' application has no reference as to what is stored online, to correctly determine the state, thus it is uploaded. All of this is beyond the control of this client. Raise a bug report with Microsoft if this is an issue for you. |
Thanks. Thinking about your message and considering that this was a new PPTX file i uploaded, I thought Onedrive did not yet "enrich" it or add necessary full details, so I decided to give it another shot this morning. Now I see different behavior. Queestion is, Why does the local timestamp for a just downloaded file differ from the online version, which triggers a timestamp update for online verrsion? Skipping path - excluded by sync_list config: ..... Sync with Microsoft OneDrive is complete |
@erenoglu To help you understand what your system is doing enable debug logging using Also ask yourself this question - are you using any file indexer on your system? File indexers like Baloo and others track that they have indexed a file by modifying the filestamp post indexing. This particular issue has cropped up before ... so please ensure you disable all file indexers is you are using any. |
Thanks. I'm not using any trackers or indexers, baloo is disabled & not running (checked with ps). Even if there was such app, I dont see it misbehave, as all of my files just keep their modified times intact except when used with Onedrive. This round, I've kept only one pptx file in OneDrive and synced that directory now with a re-sync after deleting the database. I can still see timestamp issues in the logs. I see below interesting lines. I have full log if required but relevant extract is below.
|
@erenoglu |
@erenoglu |
Thanks, enjoy the beach! :) |
Please can you test the PR below. First install all the require platform dependencies to build the client on your respective platforms. Please read https://github.com/abraunegg/onedrive/blob/master/docs/install.md#building-from-source---high-level-requirements and then follow correctly for your platform. Once this is done, to clone the PR to resolve your issue, you can use a script like the following:
This script will create a local folder called To run the PR, you need to run the client from the PR build directory:
To install the PR, you will need to perform When running the PR, your version should be: |
Your 'issue' could be 100% different here ... This issue (#3057) specifically deals with a bug where setting the timestamp of a downloaded file was not being performed when a very specific option is being used ( The images you have provided, you were the last person to 'change' that file ... now ... why did that occur?
Actions for you
|
Hi @abraunegg , I tested the PR and it seems to work fine. The downloaded file was kept and timestamp matched. No additional uploads. After a few file additions on both remote and local and syncing again, it seems fine as well. As usual, if I add a local file with an old timestamp, it gets uploaded but gets a new modified timestamp (I guess Onedrive is doing this), then due to "enhancement", file is downloaded again and thus the local timestamp is lost.
Not sure what the behavior of Windows Onedrive client is when uploading, I will test. |
Correct. Please complain to Microsoft for their 'feature'
Not really .. when you use Microsoft SharePoint as a back end, all notion of file integrity is lost because of their 'feature' to enrich the file and change it. The timestamp for the online file & its associated metadata (etag, ctag, timestamp) are also intertwined. This is why the online file is downloaded and your local file is replaced with the enriched online version, so that when the API provides all data for online, it matches what is known to be local.
Please let me know .. |
Thanks. I tested with Onedrive Windows client and the Web interface.
I found this as well: |
Thanks for testing. Based on this testing, I am going to leave the behavior as it is - sorry. I will merge this PR into 'master' and mark this as fixed. |
…oad-validation (#3064) * When --disable-download-validation is used, we still need to set the file timestamp correctly to avoid integrity checking issues * Implement setFileTimestamp() as a common function so that when setting a file timestamp this is done in a consistent manner * Update debug logging to be more agnostic to support either file or directory use * Use same function for files and directories to ensure consistency * Update function to detail what is being set, when it is set, and when it is successful
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Describe the bug
I am doing a fresh start with an empty local folder. Then syncing one folder in my Onedrive for Business. Onedrive client downloads the file, then detects that local timestamp is different, then uploads, then complains that Microsoft has "enriched" the file, and re-downloads it. So instead of just once downloading, it's doing download-upload-download. Why would that be?
The local system is an Arch linux up to date, using BTRFS. No running file search applications so dont know who's changing the timestamp, or if Onedrive is failing to put the right timestamp, or the resolution of the timestamp in BTRFS is different etc, or it's checking a different timestamp when comparing.
Here are the error messages from verbose log:
Operating System Details
Linux mylinuxpc 6.12.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 02 Jan 2025 22:52:26 +0000 x86_64 GNU/Linux
Client Installation Method
From Source
OneDrive Account Type
Business | Office365
What is your OneDrive Application Version
onedrive v2.5.3-27-g71a71da1
What is your OneDrive Application Configuration
What is your 'curl' version
Where is your 'sync_dir' located
Local
What are all your system 'mount points'
too many mount points due to subvolumes, but home directory is here: /dev/mapper/arch on / type btrfs (rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,subvolid=258,subvol=/@/.snapshots/1/snapshot)
What are all your local file system partition types
How do you use 'onedrive'
Onedrive on this linux system is not shared, but Microsoft's own Client is probably running online in a virtual Windows machine at work
Steps to reproduce the behaviour
Make a minimal sync_list to download a single directory from your Onedrive
use config file given above
do a --sync --resync and see the logs, various files are downloaded, then uploaded, then downloaded again
Complete Verbose Log Output
Screenshots
No response
Other Log Information or Details
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: