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

Feature Request: Allow non-sync tasks while sync is running #2106

Closed
bpozdena opened this issue Aug 22, 2022 · 7 comments · Fixed by #2112
Closed

Feature Request: Allow non-sync tasks while sync is running #2106

bpozdena opened this issue Aug 22, 2022 · 7 comments · Fixed by #2112

Comments

@bpozdena
Copy link

bpozdena commented Aug 22, 2022

Is your feature request related to a problem? Please describe.

It is currently not possible to perform non-sync tasks such as --get-O365-drive-id , --get-file-link and --list-shared-folders while OneDrive is running in monitor mode.

$ onedrive --version 
onedrive v2.4.20
$ onedrive --get-O365-drive-id '*' 
Using config option for Global Azure AD Endpoints
Configuration file successfully loaded
Configuring Global Azure AD Endpoints
User Configured Rate Limit: 125000000

ERROR: onedrive application is already running - check system process list for active application instances
$ onedrive --list-shared-folders  
Using config option for Global Azure AD Endpoints
Configuration file successfully loaded
Configuring Global Azure AD Endpoints
User Configured Rate Limit: 125000000

ERROR: onedrive application is already running - check system process list for active application instances
$ onedrive --get-file-link test 
Using config option for Global Azure AD Endpoints
Configuration file successfully loaded
Configuring Global Azure AD Endpoints
User Configured Rate Limit: 125000000

ERROR: onedrive application is already running - check system process list for active application instances

Describe the solution you'd like

It would be beneficial to have the ability to perform non-sync tasks without having to stop OneDrive sync process.

Describe alternatives you've considered

The only workaround is to stop the monitor process, then run onedrive --list-shared-folders and finally start the monitor again.

Additional context

No response

@abraunegg
Copy link
Owner

@bpozdena
In-part already solved via #2076

@abraunegg abraunegg added this to the v2.4.21 milestone Aug 22, 2022
@abraunegg abraunegg added the In Progress Currently being worked on label Aug 22, 2022
@abraunegg abraunegg linked a pull request Aug 24, 2022 that will close this issue
@abraunegg
Copy link
Owner

@bpozdena
Please can you test the following PR to potentially resolve your issue:

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

To run the PR, you need to run the client from the PR build directory:

./onedrive <any options needed>

To install the PR, you will need to perform sudo make install to install the PR version.

When running the PR, your version should be: onedrive v2.4.20-22-gcfda01b or greater.

@bpozdena
Copy link
Author

bpozdena commented Aug 24, 2022

@abraunegg

Based on my tests, the first time I ran the --list-shared-folders option, it worked fine. It just showed a warning about locked DB.

~/Desktop/od_test/onedrive    pr2112 ?2  ./onedrive --list-shared-folders                                                                                                                    
Using config option for Global Azure AD Endpoints
Configuration file successfully loaded
Configuring Global Azure AD Endpoints
User Configured Rate Limit: 125000000
Initializing the Synchronization Engine ...

Listing available OneDrive Business Shared Folders:
---------------------------------------
Shared Folder:   socksbug
Shared By:       xxxxx
---------------------------------------
Shared Folder:   lab
Shared By:       xxxxxxx
---------------------------------------
Shared Folder:   mail
Shared By:      xxxxxxx
---------------------------------------
Shared Folder:   Shared Folder 1

The database is currently locked by another process - cannot sync

Unfortunately, all other attempts failed while the sync was still running:

 ~/Desktop/od_test/onedrive    pr2112 ?2  ./onedrive --list-shared-folders                                                                                                                        
Using config option for Global Azure AD Endpoints
Configuration file successfully loaded
Configuring Global Azure AD Endpoints
User Configured Rate Limit: 125000000

ERROR: onedrive application is already running - check system process list for active application instances

~/Desktop/od_test/onedrive    pr2112 ?2  onedrive --get-O365-drive-id '*'                                                                                                                    
Using config option for Global Azure AD Endpoints
Configuration file successfully loaded
Configuring Global Azure AD Endpoints
User Configured Rate Limit: 125000000

ERROR: onedrive application is already running - check system process list for active application instances

~/Desktop/od_test/onedrive    pr2112 ?2  ./onedrive --get-file-link test                                                                                                                     
Using config option for Global Azure AD Endpoints
Configuration file successfully loaded
Using dry-run database copy for OneDrive API query
Configuring Global Azure AD Endpoints
User Configured Rate Limit: 125000000

ERROR: onedrive application is already running - check system process list for active application instances

What's more, it caused the main sync process to freeze completely. I could not stop it with CTRL+C or by 'killall onedrive'. I had to do 'kill -9 <onedrive_pid>` .

Skipping item - excluded by skip_dir config: __pycache__
^CGot termination signal, performing clean up
Shutting down the HTTP instance



^[[A
^C


^C

^C^CGot termination signal, performing clean up
Shutting down the HTTP instance






^C


^Czsh: killed     ./onedrive --monitor -v

All future attempts to perform sync fail with the bellow errors:

./onedrive  --monitor --resync --resync-auth                                                                                                       
Using config option for Global Azure AD Endpoints
Configuration file successfully loaded
Using dry-run database copy for OneDrive API query
Deleting the saved application sync status ...
Configuring Global Azure AD Endpoints
User Configured Rate Limit: 125000000
Initializing the Synchronization Engine ...
Initializing monitor ...
OneDrive monitor interval (seconds): 300

ERROR: The local file system returned an error with the following message:
  Error Message:    ./.Trash-1000: Permission denied
Uploading differences of ~/OneDrive
Uploading new items of ~/OneDrive
^CGot termination signal, performing clean up
Shutting down the HTTP instance
Shutting down db connection and merging temporary data

UPDATE:
Had to sudo rm -rf .Trash-1000 in the sync_dir and all is good again. Not sure where it came from..

@abraunegg
Copy link
Owner

@bpozdena
Can you please retest the update PR. The updated client version should be: onedrive v2.4.20-25-gb12f37b

Had to sudo rm -rf .Trash-1000 in the sync_dir and all is good again. Not sure where it came from..

From your GUI Desktop .... something you deleted using your GUI

@bpozdena
Copy link
Author

Great job as always @abraunegg! All now works great with onedrive v2.4.20-25-gb12f37b.

@abraunegg
Copy link
Owner

Will push this into 'Master'

@abraunegg
Copy link
Owner

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.

Repository owner locked as resolved and limited conversation to collaborators Sep 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants