Skip to content
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

moving directories into synched folder (using sync_list) #658

Closed
OneLineTwoBugs opened this issue Sep 13, 2019 · 14 comments
Closed

moving directories into synched folder (using sync_list) #658

OneLineTwoBugs opened this issue Sep 13, 2019 · 14 comments
Labels
Bug Something isn't working Fixed
Milestone

Comments

@OneLineTwoBugs
Copy link

OneLineTwoBugs commented Sep 13, 2019

When moving a directory (using the onedrive web gui) that is currently not part of the sync (because it's parent folder is not listed in sync_list) into a folder that is part of the sync, that folder and all it's subfolders are created, but the files are not downloaded.

Edit: also, when m oving a folder out of a synched folder into a non-synched folder, it is not deleted.

OS: Debian Buster, Kernel 4.19.37 x86_64

config:

onedrive version                    = v2.3.9-10-ge32b8b3
Config path                         = /home/user/.config/onedrive
Config file found in config path    = true
Config option 'check_nosync'        = false
Config option 'sync_dir'            = /opt
Config option 'skip_dir'            =
Config option 'skip_file'           = ~*|.~*|*.tmp
Config option 'skip_dotfiles'       = true
Config option 'skip_symlinks'       = true
Config option 'monitor_interval'    = 45
Config option 'min_notify_changes'  = 5
Config option 'log_dir'             = /var/log/onedrive
Config option 'sync_root_files'     = false
Selective sync configured           = true
sync_list contents:
Linux_sync_dir
@abraunegg
Copy link
Owner

@OneLineTwoBugs
Please can you provide a debug log for this as you have not done so. Please follow these instructions:

https://github.com/abraunegg/onedrive/wiki/Generate-debug-log-for-support

@abraunegg
Copy link
Owner

@OneLineTwoBugs
Please also update your first post with the following as it is missing:

Application and Operating System Details:

  • Are you using a headless system (no gui) or with a gui installed?
  • OneDrive Account Type
  • DMD or LDC compiler version dmd --version or ldmd2 --version
  • Curl Version: Output of curl --version

@abraunegg
Copy link
Owner

@OneLineTwoBugs
Additionally, you have not indicated the mode of operation your running in, nor the command you are executing.

@abraunegg abraunegg added Bug Something isn't working In Progress Currently being worked on and removed Investigating More Information Needed Waiting on Response labels Sep 13, 2019
@abraunegg
Copy link
Owner

@OneLineTwoBugs
I am able to reproduce this locally - working on a fix at present

@abraunegg
Copy link
Owner

@OneLineTwoBugs
Please can you validate the following PR to resolve your issue:

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
git fetch origin pull/659/head:pr659
git checkout pr659
make clean; ./configure; make;

@abraunegg abraunegg added PR Provided - Needs Testing and removed In Progress Currently being worked on labels Sep 13, 2019
@abraunegg abraunegg added this to the v2.3.10 milestone Sep 14, 2019
@OneLineTwoBugs
Copy link
Author

OneLineTwoBugs commented Sep 14, 2019

@abraunegg thanks for your super quick response and fix. For the reacord, I'm running on a headless linux, so just onedrive --monitor.

It seems that with the new version you've provided, files are now downloaded when moved into a synched folder.

However, when moving a folder out of the synched folder into a non-synched onedrive folder, it is still not deleted. Furthermore, if that folder is then deleted on the linux side, onedrive sync will delete the folder at it's new place on onedrive.

So, I have \Linux_sync_dir\testfolder with some files in it. I use onedrive web gui (or my windows onedrive client) to move it to \testfolder, which makes it no longer part of the sync. This move doesn't delete /opt/Linux_sync_dir/testfolder on the linux fs. But, if I execute rm -rdf /opt/Linux_sync_dir/testfolder, onedrive --monitor removes \testfolder from onedrive.

@abraunegg
Copy link
Owner

@OneLineTwoBugs
Are you actually waiting for monitor mode to actually perform the 'next sync' - or are you expecting the changes to be done immediately when you move it on OneDrive ?

Note: Changes made on OneDrive are delayed and are governed by the following config option:

# monitor_interval = "45"

@OneLineTwoBugs
Copy link
Author

@abraunegg I've waited for an hour and restarted onedrive --monitor twice in between. It thinks it has processed all changes.

@abraunegg
Copy link
Owner

@OneLineTwoBugs
Can I suggest that you validate that you are running the right version - see below & with annotations using the PR #659:

alex@debian-x86-64:~/code/onedrive-pr659$ ./onedrive --display-config
onedrive version                    = v2.3.9-11-gaffcdb9
Config path                         = /home/alex/.config/onedrive
Config file found in config path    = true
Config option 'check_nosync'        = false
Config option 'sync_dir'            = /opt2
Config option 'skip_dir'            = 
Config option 'skip_file'           = ~*|.~*|*.tmp
Config option 'skip_dotfiles'       = false
Config option 'skip_symlinks'       = false
Config option 'monitor_interval'    = 45
Config option 'min_notify_changes'  = 5
Config option 'log_dir'             = /var/log/onedrive/
Config option 'sync_root_files'     = false
Selective sync configured           = true
sync_list contents:
Linux_sync_dir
alex@debian-x86-64:~/code/onedrive-pr659$ ./onedrive --monitor --verbose
Using Config Dir: /home/alex/.config/onedrive
Initializing the OneDrive API ...
Opening the item database ...
All operations will be performed in: /opt2
Application version: v2.3.9-11-gaffcdb9
Account Type: personal
Default Drive ID: 66d53be8a5056eca
Default Root ID: 66D53BE8A5056ECA!101
Remaining Free Space: 5341004861
Fetching details for OneDrive Root
OneDrive Root does not exist in the database. We need to add it.
Added OneDrive Root to the local database
Initializing the Synchronization Engine ...
Initializing monitor ...
OneDrive monitor interval (seconds): 45
Monitor directory: .
Monitor directory: ./Linux_sync_dir                                     <------ At this point I moved via OneDrive Web Interface, SMPP to Linux_sync_dir folder
Applying changes of Path ID: 66D53BE8A5056ECA!101
Processing 30 changes
Creating directory: Linux_sync_dir/SMPP
Downloading file Linux_sync_dir/SMPP/SMPP-IF-SPEC_v3_3-24858.pdf ... done.
Downloading file Linux_sync_dir/SMPP/SMPP_v3_4_Issue1_2-24857.pdf ... done.
Uploading differences of .
Processing root
The directory has not changed
Processing Linux_sync_dir
The directory has not changed
Processing SMPP
The directory has not changed
Processing SMPP-IF-SPEC_v3_3-24858.pdf
The file has not changed
Processing SMPP_v3_4_Issue1_2-24857.pdf
The file has not changed
Uploading new items of .
Skipping item - path excluded by sync_list: ./no-dir-sync
Applying changes of Path ID: 66D53BE8A5056ECA!101
Processing 30 changes
Monitor directory: Linux_sync_dir/SMPP
Applying changes of Path ID: 66D53BE8A5056ECA!101                         <------ At this point I moved via OneDrive Web Interface, SMPP out of Linux_sync_dir folder
Processing 30 changes
Trying to delete item Linux_sync_dir/SMPP/SMPP_v3_4_Issue1_2-24857.pdf
Deleting item Linux_sync_dir/SMPP/SMPP_v3_4_Issue1_2-24857.pdf
Trying to delete item Linux_sync_dir/SMPP/SMPP-IF-SPEC_v3_3-24858.pdf
Deleting item Linux_sync_dir/SMPP/SMPP-IF-SPEC_v3_3-24858.pdf
Trying to delete item Linux_sync_dir/SMPP
Deleting item Linux_sync_dir/SMPP
Applying changes of Path ID: 66D53BE8A5056ECA!101
Processing 30 changes
  • The move to 'Linux_sync_dir' downloaded the new files & folder
  • The move out of 'Linux_sync_dir' deleted the files & folders locally

So I am not seeing this issue you are seeing.

@abraunegg
Copy link
Owner

@OneLineTwoBugs

However, when moving a folder out of the synched folder into a non-synched onedrive folder, it is still not deleted. Furthermore, if that folder is then deleted on the linux side, onedrive sync will delete the folder at it's new place on onedrive.

This is because items are deleted by their OneDrive ID as per the API

Because your 'local' sync state is 'out-of-sync', when you delete the local item, it will delete on OneDrive 'wherever' it is - there is zero way to change this behaviour if the system is 'out-of-sync'

@abraunegg
Copy link
Owner

@OneLineTwoBugs
Can you provide an update as to if the PR solves your issue as I cannot replicate what you are saying. If you are still having issues, please can you provide a verbose debug log for analysis

@OneLineTwoBugs
Copy link
Author

@abraunegg I still have the issue, though I'm not sure if it's a different problem. My onedrive --monitor finds tons of changes every 45 seconds and has to work through all of them, but it doesn't actually ever do anything. This makes my whole onedrive account rate limited, which is why I've turned it off right now. I'll invest some more time in investigating this later, but for now, we can close this as your fix definitely helps when a folder is moved into a synched folder.

@abraunegg
Copy link
Owner

abraunegg commented Sep 15, 2019

@OneLineTwoBugs

I still have the issue, though I'm not sure if it's a different problem.

For whatever reason your 'refusing' to provide a verbose debug log so I can assist & work out what is going on. I have no idea why you are reluctant to do this.

finds tons of changes every 45 seconds and has to work through all of them, but it doesn't actually ever do anything.

The verbose debug log will clearly articulate what is going on and why it might not be processing something.

By not providing a verbose debug log this really impacts the ability to assist to work out 'why' this is not working for you.

I am going to mark this bug as fixed, as based on all my testing & based on your initial use case and as evidenced in my log output this is now fixed.

@lock
Copy link

lock bot commented Oct 15, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Oct 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Fixed
Projects
None yet
Development

No branches or pull requests

2 participants