OneDrive - Creating new remote fails - Failed to query available drives

What is the problem you are having with rclone?

The creation of a new OneDrive remote works till i get to the option to choose the type. When i choose "1" for "onedrive" the creation fails because the client got an unexpected response.

What is your rclone version (output from rclone version)

v1.51.0

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Ubuntu 18.04 - 64bit

Which cloud storage system are you using? (eg Google Drive)

OneDrive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone config

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

user@LinuxPC:~$ rclone config -vv
2020/04/28 15:56:38 DEBUG : rclone: Version "v1.51.0" starting with parameters ["rclone" "config" "-vv"]
2020/04/28 15:56:38 DEBUG : Using config file from "/home/user/.config/rclone/rclone.conf"
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> OneDrive1
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
...
23 / Microsoft OneDrive
\ "onedrive"
...
Storage> 23
** See help for onedrive backend at: https://rclone.org/onedrive/ **

Microsoft App Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id>
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret>
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n>
Remote config
Use auto config?

  • Say Y if not sure
  • Say N if you are working on a remote or headless machine
    y) Yes (default)
    n) No
    y/n>
    2020/04/28 15:56:50 DEBUG : Starting auth server on 127.0.0.1:53682
    If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=a-oTmIiX5lhTt1A8Ap6iFg
    Log in and authorize rclone for access
    Waiting for code...
    2020/04/28 15:57:06 DEBUG : Received GET request on auth server to "/"
    Got code
    2020/04/28 15:57:06 DEBUG : OneDrive1: Saved new token in config file
    2020/04/28 15:57:06 DEBUG : Closing auth server
    2020/04/28 15:57:06 DEBUG : Closed auth server with error: accept tcp 127.0.0.1:53682: use of closed network connection
    Choose a number from below, or type in an existing value
    1 / OneDrive Personal or Business
    \ "onedrive"
    2 / Root Sharepoint site
    \ "sharepoint"
    3 / Type in driveID
    \ "driveid"
    4 / Type in SiteID
    \ "siteid"
    5 / Search a Sharepoint site
    \ "search"
    Your choice> onedrive
    2020/04/28 15:57:12 Failed to query available drives: Get https://graph.microsoft.com/v1.0/me/drives: http: server gave HTTP response to HTTPS client
    user@LinuxPC:~$

I'd guess that is something like a firewall or something like that.

Try running with -vv --dump bodies and see if there is anything in there that looks useful. (There will be lots of stuff!)

user@LinuxPC:~$ rclone config -vv --dump bodies
2020/04/29 08:05:41 DEBUG : rclone: Version "v1.51.0" starting with parameters ["rclone" "config" "-vv" "--dump" "bodies"]
2020/04/29 08:05:41 DEBUG : Using config file from "/home/user/.config/rclone/rclone.conf"
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> OneDrive1
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
...
23 / Microsoft OneDrive
\ "onedrive"
...
Storage> 23
** See help for onedrive backend at: https://rclone.org/onedrive/ **

Microsoft App Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id>
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret>
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n>
Remote config
Use auto config?

  • Say Y if not sure
  • Say N if you are working on a remote or headless machine
    y) Yes (default)
    n) No
    y/n>
    2020/04/29 08:05:56 DEBUG : Starting auth server on 127.0.0.1:53682
    If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=t-o0wT-wsfczd1qaZtaPcg
    Log in and authorize rclone for access
    Waiting for code...
    2020/04/29 08:05:57 DEBUG : Received GET request on auth server to "/"
    Got code
    2020/04/29 08:05:58 DEBUG : OneDrive1: Saved new token in config file
    2020/04/29 08:05:58 DEBUG : Closing auth server
    2020/04/29 08:05:58 DEBUG : Closed auth server with error: accept tcp 127.0.0.1:53682: use of closed network connection
    2020/04/29 08:05:58 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
    Choose a number from below, or type in an existing value
    1 / OneDrive Personal or Business
    \ "onedrive"
    2 / Root Sharepoint site
    \ "sharepoint"
    3 / Type in driveID
    \ "driveid"
    4 / Type in SiteID
    \ "siteid"
    5 / Search a Sharepoint site
    \ "search"
    Your choice> 1
    2020/04/29 08:06:14 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    2020/04/29 08:06:14 DEBUG : HTTP REQUEST (req 0xc000611800)
    2020/04/29 08:06:14 DEBUG : GET /v1.0/me/drives HTTP/1.1
    Host: graph.microsoft.com
    User-Agent: rclone/v1.51.0
    Authorization: XXXX
    Accept-Encoding: gzip

2020/04/29 08:06:14 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2020/04/29 08:06:14 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2020/04/29 08:06:14 DEBUG : HTTP RESPONSE (req 0xc000611800)
2020/04/29 08:06:14 DEBUG : Error: tls: first record does not look like a TLS handshake
2020/04/29 08:06:14 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2020/04/29 08:06:14 Failed to query available drives: Get https://graph.microsoft.com/v1.0/me/drives: http: server gave HTTP response to HTTPS client
user@LinuxPC:~$

I thought about browser extensions like "https everywhere" or something, but they are all inactive. For my internet connection there is no special firewallsetting.

What that error looks like is that is that rclone connected over https but the response came back unencrypted as http.

What happens if you go to https://graph.microsoft.com/v1.0/me/drives in your browser?

How about if you try curl https://graph.microsoft.com/v1.0/me/drives

"graph.microsoft.com" was blocked on the router, but i don't know why yet. After setting it on the whitelist it was possible to create the remote. I'm sorry.

Glad you got it sorted :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.