abraunegg / onedrive

OneDrive Client for Linux
https://abraunegg.github.io
GNU General Public License v3.0
10.17k stars 865 forks source link

"Disk I/O error" after moving to 2-factor authentication #1064

Closed phrxmd closed 4 years ago

phrxmd commented 4 years ago

Note: Before submitting a bug report, please ensure you are running the latest 'onedrive' client as built from 'master' and by using the latest available DMD compiler. Refer to the readme on building the client for your system.

Bug Report Details

Describe the bug

After reconfiguring my Office 365 Business account to use two-factor authentication via MS Authenticator (rather than phone #) and re-authenticating OneDrive, I get the error message "A database statement execution error occurred: disk I/O error" until I manually remove the files items.sqlite3-shm items.sqlite3-wal from my ~/.config/onedrive directory.

Application and Operating System Details:

Note: Please generate a full debug log as per https://github.com/abraunegg/onedrive/wiki/Generate-debug-log-for-support and email to support@mynas.com.au

To Reproduce (Can't reproduce without configuring my entire O365 domain.)

Complete Verbose Log Output A clear and full log of the problem when running the application in the following manner (ie, not in monitor mode):

$ onedrive --synchronize
Configuring Global Azure AD Endpoints

ERROR: OneDrive returned an error with the following message:
  Error Message: HTTP request returned status code 400 (Bad Request)
  Error Reason:  AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '00000003-0000-0000-c000-000000000000'.
Trace ID: 4b986f75-b221-4a9c-80c3-b3670b9e3000
Correlation ID: 20322043-df48-441b-9558-75ce3f5c8c44
Timestamp: 2020-09-15 15:55:59Z

ERROR: OneDrive returned an error with the following message:
  Error Message: HTTP request returned status code 401 (Unauthorized)
  Error Reason:  Access token is empty.

ERROR: Check your configuration as your refresh_token may be empty or invalid. You may need to issue a --logout and re-authorise this client.

$ onedrive --logout     
Configuring Global Azure AD Endpoints
Authorize this app visiting:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=my-client-id&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient

Enter the response uri: https://login.microsoftonline.com/common/oauth2/nativeclient?code=long-code&session_state=session.state-uuid

Application has been successfully authorised, however no additional command switches were provided.

Please use --help for further assistance in regards to running this application.

$ onedrive --synchronize
Configuring Global Azure AD Endpoints

A database statement execution error occurred: disk I/O error

Please retry your command with --resync to fix any local database corruption issues.

$ onedrive --resync --synchronize         
Configuring Global Azure AD Endpoints

A database statement execution error occurred: disk I/O error

Please retry your command with --resync to fix any local database corruption issues.

$ cd ~/.config/onedrive 
$ ls
items.sqlite3  items.sqlite3-shm  items.sqlite3-wal  refresh_token
$ rm *shm *wal
$ ls -l
insgesamt 36
-rw-r--r-- 1 my-user-name users 28672 15. Sep 17:59 items.sqlite3
-rw-r--r-- 1 my-user-name users  1276 15. Sep 18:54 refresh_token
$ onedrive --resync --synchronize
Configuring Global Azure AD Endpoints
Initializing the Synchronization Engine ...
Syncing changes from OneDrive ...

Additional context Add any other context about the problem here.

Bug Report Checklist

abraunegg commented 4 years ago

@phrxmd

This issue primarily manifests itself when you have 2 x binaries running at the same time with the same configuration. The existing execution still has a lock on the files. You 'most likely' had a service file running the daemon which you did not stop.

By removing the files in the way that you did, would have caused the 'other' running process to fail in an ungraceful manner - thus, potentially put you in a data loss scenario. It is never advisable to manually remove those files.

Also, please upgrade your client. v2.4.3 contains issues which have been fixed - refer to https://github.com/abraunegg/onedrive/releases

Until the package is updated, you will need to build from source to uplift your client version.

@SchoolGuy

Please can you update the OpenSuSE package from v2.4.3 to v2.4.5, and keep a watch of releases to ensure the package is kept up-to-date.

SchoolGuy commented 4 years ago

@abraunegg I am deeply sorry. We talked about 2.4.5, I will do it after lunch asap.

SchoolGuy commented 4 years ago

Request for devel is open: https://build.opensuse.org/request/show/834898

SchoolGuy commented 4 years ago

Request to Tumbleweed is in the wild: https://build.opensuse.org/request/show/834937

SchoolGuy commented 4 years ago

@phrxmd Do you need this asap in Leap or do you use Tumbleweed? If not then I would talk to some people before submitting this to Leap.

abraunegg commented 4 years ago

Closing issue as not an issue, SuSE package update in-flight

phrxmd commented 4 years ago

@SchoolGuy Thank you. I'm on Tumbleweed, there is no great hurry.

github-actions[bot] commented 3 years ago

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.