Setting up OneDrive (personal)

FYI, I had a backup that used the old OneDrive API that I migrated to the v2 API. The only things I had to do were to change the storage type and generate a new authentication key. I did not have to change any paths, and the existing backup sets were recognized without any problems.

@warwickmm thank you for that confirmation. I know I am running a Beta version here so I don’t expect perfection. Though I do feedback anything I can about my experiences.

I have done plenty of beta testing of all kinds of odd products in my years. So understand the risks. This is why I am not using the Canary editions.

Hi everyone, I tried to change my current backups of Duplicati from OneDrive to OneDrive V2. Unfortunately this doesn’t work and I get the following error:

Failed to connect: BadRequest: Bad Request error from request https://graph.microsoft.com/v1.0/me/drive/root://#Backups/Test Method: GET, RequestUri: ‘https://graph.microsoft.com/v1.0/me/drive/root://#Backups/Test’, Version: 1.1, Content: <null>, Headers: { User-Agent: Duplicati/2.0.4.5 Authorization: Bearer ABC…XYZ } StatusCode: 400, ReasonPhrase: ‘Bad Request’, Version: 1.1, Content: System.Net.Http.StreamContent, Headers: { Cache-Control: private Transfer-Encoding: chunked request-id: 69f2e8f5-1da4-46ba-8bbc-60e758d4558c client-request-id: 69f2e8f5-1da4-46ba-8bbc-60e758d4558c x-ms-ags-diagnostic: {“ServerInfo”:{“DataCenter”:“West Europe”,“Slice”:“SliceC”,“Ring”:“5”,“ScaleUnit”:“002”,“Host”:“AGSFE_IN_61”,“ADSiteName”:“WEU”}} Duration: 3.7835 Strict-Transport-Security: max-age=31536000 Date: Fri, 21 Dec 2018 12:07:27 GMT Content-Type: application/json } { “error”: { “code”: “BadRequest”, “message”: “Resource not found for the segment ‘root:’.”, “innerError”: { “request-id”: “69f2e8f5-1da4-46ba-8bbc-60e758d4558c”, “date”: “2018-12-21T12:07:27” } } }

Does anyone know what I can do? I’ve already tried the slash, but unfortunately no success.

Thanks

Does that refer to the temporary workaround mentioned in Release: 2.0.3.12 (canary) 2018-10-23 pointing to Path on server needs / at beginning when configurations are edited #3460? If not, could you clarify it please?

Microsoft Graph error responses and resource types says

400 Bad Request Cannot process the request because it is malformed or incorrect.

Addressing resources in a drive on OneDrive explains its format. I’m not sure if a double slash is helping any, and what’s the # for (and is that character allowed)? I’m not a OneDrive expert, and can’t help more in depth.

The # looks suspect to me (my configuration doesn’t appear to have one). Also, did you generate a new AuthID when changing to OneDrive v2?

Yes, it refers to that workaround But that didn’t help. I’ve tried one slash in front and two slashes.

The # is for pure organization so that the folder stands at the beginning. With the old one drive setting it was no problem at all.

Yes I did. But that seems not to be the problem. Does anyone else have an idea on that?

Try removing the # from the folder name?

Maybe pick a different folder, or make a new one. Try to get something going, then study the differences.

I’ve tried everything and the OneDrive v2 doesn’t work with the # in front…v1 does, though. Sucks big time. I’ve got to backup all my Backups again to migrate to v2. But thanks to you guys anyways.

Found a workaround for my problem. I’ve just copied all backups from “#Backups/” to “_Backups” and changed the backup paths and everything works fine.

Thank you guys for the input.

I’m trying to migrate to OneDrive v2 in 2.0.4.6_canary_2018-12-11 and am getting an “Unauthorized” error message myself. Here are my Backup destination Storage Type and Path on server values:

Clipboard01

And here’s the error message I’m getting:

Failed to connect: Unauthorized: Unauthorized error from request https://graph.microsoft.com/v1.0/me/drive/root:/PC Backup/DELLXPS8500 Method: GET, RequestUri: 'https://graph.microsoft.com/v1.0/me/drive/root:/PC Backup/DELLXPS8500', 
Version: 1.1, 
Content: <null>, 
Headers: { 
User-Agent: Duplicati/2.0.4.6 Authorization: Bearer ABC...XYZ } 
StatusCode: 401, 
ReasonPhrase: 'Unauthorized', 
Version: 1.1, 
Content: System.Net.Http.StreamContent, 
Headers: { request-id: b3605381-e3d0-4c0c-b9a3-8b92c91c4019 client-request-id: b3605381-e3d0-4c0c-b9a3-8b92c91c4019 x-ms-ags-diagnostic: {
"ServerInfo":{
"DataCenter":"North Central US",
"Slice":"SliceC",
"Ring":"3",
"ScaleUnit":"003",
"Host":"AGSFE_IN_54",
"ADSiteName":"NCU"
}} 
Strict-Transport-Security: max-age=31536000 Date: Thu, 27 Dec 2018 21:32:13 GMT WWW-Authenticate: Bearer realm="", 
authorization_uri="https://login.microsoftonline.com/common/oauth2/authorize", 
client_id="00000003-0000-0000-c000-000000000000" Content-Length: 265 Content-Type: application/json; charset=utf-8 
} { "error": { 
"code": "InvalidAuthenticationToken", 
"message": "CompactToken parsing failed with error code: 8004920A", 
"innerError": { 
"request-id": "b3605381-e3d0-4c0c-b9a3-8b92c91c4019", 
"date": "2018-12-27T21:32:13" 
} } } 

Based on the above, is the OneDrive v2 authentication link working properly? Every time I go to it, the autocomplete email address in my browser is the same one I used for Enterprise testing, not the personal one associated with my Office 365 Home OneDrive storage. This leads me to suspect that the v2 token portal might not cover consumer 365 subscriptions.

Also, do we have to revoke the previous OneDrive v1 token before using a new v2 one? If we do, I’m not sure how that would work as I didn’t store that token anywhere outside Duplicati.

Lastly, are there Advanced options that might help?

Any ideas?

Bump. Anyone at all?

If the auth link was broken in general others wouldn’t have been reporting successful transitions so I’m guessing it’s something specific to your situation.

Did you try getting another auth key since your current one isn’t working?

Although I would have expected a different error than “Unauthorized”, please be sure you fill this out with the address you want. It’s also simpler to click the “AuthID” link in Duplicati job’s “Destination” screen than to use manual access to Duplicati Oauth Handler (and have to copy the AuthID manually). It should work either way.

How we get along with OAuth explains how Duplicati doesn’t handle your username (email) or password, and looking at the “Sign in”, you will see it’s a Microsoft page. How do I enable and disable Autofill in my browser? explains how you can disable autofill for a test. Autofill: What web devs should know, but don’t is tech details.

The test I ran has both in operation, on different jobs, so at least here the answer is that revoke isn’t needed. This was on my consumer OneDrive, which I suspect is what you have. Is manual URL onedrive.live.com?

I did.

Did that too.

Yes, I use consumer OneDrive and that’s the URL. But the AuthID url is login.microsoftonline.com, which I’ve never seen before anywhere else. I think that’s what’s prompting the autofill (BTW, I don’t use the autofilled email address; I clear it from the field and use the intended consumer email address.) But I suspect the reason the Auth code is invalid is because the login.microsoftonline.com portal is not intended for Office 365 Home subscribers. Is there another one I should be using instead?

EDIT: I tried using a different browser instead and now I get this error message:

Failed to connect: Failed to authorize using the OAuth service: Invalid authid in query. If the problem persists, try generating a new authid token from: Duplicati OAuth Handler

Following the instructions just gives the same error message again.

Multiple times, on different browsers. Each new key is rejected in the same manner. The only thing that has changed the error message so far is switching to Chrome, but the login is still rejected on that browser too. Do you know if the Auth link is specific only to a certain type of OneDrive account? Mine is an Office 365 Home annual subscription. Is it supposed to work for that account type, or is there a different URL for users like myself?

Just tried a different browser profile so that I’d have to sign into OneDrive from scratch and got the same error message.

Another thing: my OneDrive is protected by 2FA. Does this AuthID method support that?

I think I saw some other people mention having issues with two factor authentication - though I think that was before the switch to the new API.

Have you checked out this to topic yet?

1 Like

The v1 API supported 2FA just fine. Literally all my problems with connecting started after it was deprecated.

1st time seeing that thread. I’ve commented there asking the person who managed to solve the issue on their end how they did it. Thanks for the link.