20.04 LTS OneDrive Issues Linking account

I was able to get my OneDrive working about two weeks ago on Ubuntu 20.04 LTS OS. I was messing around and messed my OS up. So I decided to wipe and start fresh. When I was trying to set my laptop up again, my OneDrive was having issues and keeps pushing this code out. I was curious if anyone has ran into this issue before?

onedrive.OneDriveException@src/onedrive.d(874): HTTP request returned status code 400 (Bad Request)
{
    "correlation_id": "b9d141bf-d601-42e8-9b43-91fa1a9e62f2",
    "error": "invalid_grant",
    "error_codes": [
        70000
    ],
    "error_description": "AADSTS70000: The provided value for the 'code' parameter is not valid.\r\nTrace ID: bb17a3b0-ac2a-4e31-96a9-f05574966600\r\nCorrelation ID: b9d141bf-d601-42e8-9b43-91fa1a9e62f2\r\nTimestamp: 2020-08-17 15:55:02Z",
    "error_uri": "https:\/\/login.microsoftonline.com\/error?code=70000",
    "timestamp": "2020-08-17 15:55:02Z",
    "trace_id": "bb17a3b0-ac2a-4e31-96a9-f05574966600"
}
----------------
??:? [0x5642287239d9]
??:? [0x564228722cb5]
??:? [0x564228723b65]
??:? [0x564228721f58]
??:? [0x5642287218c5]
??:? [0x56422872f7a8]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x7fb49121c9db]
??:? _d_run_main2 [0x7fb49121c7ee]
??:? _d_run_main [0x7fb49121c65d]
??:? __libc_start_main [0x7fb490e080b2]
??:? [0x5642286fa5ed]

I click on the link, sign into my account and then copy the link and put it in the terminal. This was the output on the terminal after I clicked enter. Any ideas?


Solution 1:

I had the same issue. I tried to install onedrive using sudo apt install onedrive and building it myself from the repository https://github.com/skilion/onedrive. BUT the 'skilion' repo was abandoned in 2018 and contains many defects.

The latest and maintained code of onedrive for linux can be found here: https://github.com/abraunegg/onedrive. I followed the instructions from there and installed onedrive under Ubuntu 20.04 LTS and now it works like a charm :)

Solution 2:

I also faced the same problem for a long time, Then I find out that onedrive installed from the default ppa is quite old and installing it from the following ppa resolved the issue for me.

sudo add-apt-repository ppa:yann1ck/onedrive
sudo apt install onedrive

This is the developer created ppa
https://launchpad.net/~yann1ck/+archive/ubuntu/onedrive