-
-
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: Upload|Download Loop for AIP Protected File in Monitor Mode #3070
Comments
By the way, the real file name is something like below, in case & character is messing up stuff: |
@erenoglu
The new pptx file is added to the local directory, is uploaded, enriched, then downloaded and that is the end of that. I will setup an Arch Linux system to validate there. |
Thank you. I did a few test on my side now. But it seems related to Azure Information Protection (AIP) protected files.
So it seems something is happening if the file is AIP protected which makes Onedrive believe it's a new file. |
@erenoglu I need to look at the JSON data specifically of the response from the OneDrive API to see if there is anything different in that JSON response post the enrichment after upload that the file is AIP protected. |
@erenoglu
From #3057From #3066I can only assume at this point that the JSON response for the downloaded enriched item lacks either the correct size, hash or both in the response, or, the values are different to that what has been downloaded. To assist with debugging, and to negate needing a full debug log, please can you run the following PR - #3071 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: This will print out:
This will help identify what is going on with these AIP files, and, specifically if there is anything in the JSON response that identifies the file as being AIP protected. Please can you test this PR to provide the needed information. |
Thanks. Here is the log output with the PR, let me know if you'd need more debugging:
|
Thanks OK so there is 100% zero identifier that this is AIP protected in the response, but the downloaded file is totally different size and content wise. The only fix that can be done here is to update the response JSON with actual values from disk if they are different. When that response JSON is then inserted to the DB, the existing on disk values match the DB, thus, will not be flagged as a locally changed file, thus will not be re-uploaded. |
Yeah tough situation, if I added --verbose to --monitor command, would it create more logs? Indeed if it's not possible to identify AIP protected files, how can you differentiate :( |
The logging level does not differenciate / change the API response on an uploaded file ... thats where a change would be needed ... and that is a bug for Microsoft. Whilst not ideal, these need to be true:
So if all of these 4 items are true, its a high potential to be an AIP file. Now .. AIP can applied to a number of file types - and when 'protected' can even change the file extention, but in your example the extention is not changing ... so using that as a further identifier cant be used Using the mimetype in the JSON response also is not going to be helpful. This is the only solution here:
|
The thing is, in a normal workday, I may be receiving these from colleagues through email, then save some of them in my local Onedrive folder (in linux) for future reference, and later open them when I need using a local Windows VM or online Onedrive. How can we deal with this? I would prefer all files to be downloaded whether they may be opened locally or not, frankly speaking, so I'd prefer "Update the JSON" option. In not disabling download integrity check, I'm not sure, I would not want to have an incomplete folder as it may confuse me later on seeking where my files may be (I'm sure I wont remember which files had AIP and which file not) |
Maybe as a best of both world, can we enable download integrity check so we have this protection for normal fles, but as we detect above 4 is true, instead of deleting, just update JSON and not delete the file? While errors may happen during transfer, I assume it's not very common. |
The challenge is - enable / disabls integrity checks ... a non-AIP file , that meets then the 4 criteria, will get the JSON updated .. and it may be a valid bad download that then is treated as a good download (JSON fudging) I would rather only fudge the JSON data only if disable download integrity checking has been enabled ... It is still not ideal ... but this is the best that is possible due to the Microsoft API constraint in their reaponse JSON. |
Makes sense. and if a user wants the integrity check, he can enable it in expense of losing downloads on AIP files. works... |
@erenoglu |
Hi, will do hopefully today, just returned from a business trip. but when I compile, the application version is now: with this, here's the log.I did a --sync first, got to a clean state (deleted online & local unnecesary files), did another --sync, then --monitor, then placed an AIP file into the local folder. Do you need --verbose?
|
Thats the expected output. So no more continual upload / download ? |
For the one file I tested, it's OK. I'll do a few more tests tonight, maybe also put some files online and see how they propagate locally. |
Some more logs after waiting for some time and Onedrive detecting online changes. What's confusing is some files download with a counter from 0% to 100%, and the ISSUE 3070 message comes in between, not clear for which file (programs.xls)
|
This is because the code change for this has not been cleaned up ... the application output is brute force at the moment to ensure the code change is being hit, to ensure the change JSON structure is happening I will start cleaning up the PR If you stop using Please read: |
@erenoglu Please can you perform one last validation using the updated PR - the client version for the PR should be Please can you also read and validate the documentation changes. Once you confirm, I will merged this PR into 'master' |
OK, now onedrive version is onedrive v2.5.3-43-gbfbd788. with this, when synced and then monitor mode, and without disabling download validation:
then I disabled download validation, did a --sync --resync and tried --monitor again:
I checked the documents, they are OK. Hope MS can implement a data field to inform if a file is AIP protected so we could enable the download validation again. |
@erenoglu |
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
Today I noticed that I'm having a loop of a new pptx file being uploaded then downloaded over and over again in monitor mode due to "enrichment" feature of Onedrive, and this keeps on going till I break it.
Operating System Details
Client Installation Method
From Source
OneDrive Account Type
Business
What is your OneDrive Application Version
onedrive v2.5.3-29-gc7037f83
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'
What are all your local file system partition types
How do you use 'onedrive'
Onedrive is shared with Windows systems and also web editing, but none were active at the time of the bug report (computers off)
Steps to reproduce the behaviour
compile onedrive from source, do --sync --resync
When completed, do --monitor
Add a pptx file to a folder
Observe that onedrive client will upload it, then detect enrichment, so re-download it, then detect it as a new file, upload it, then download it again due to enrichment, and this goes on in a loop till interrupted.
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: