"Couldn't decode response" when pasting in code for headless authorisation

When I attempt to configure RClone it doesn't accept the code for headerless authorisation

What is your rclone version (output from rclone version)

Version 1.56.2

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

OneDrive

The command you were trying to run

rclone configure

The rclone config contents with secrets removed.

[Office365-OneDrive]
type = onedrive
client_id = 1111-2222-3333-4444
client_secret = ~A-client-SECRET-1234

The problem occurs when I have gone through the basic configuration and (because I'm running on a remote terminal) I need to run the rclone authorise "one drive" "--some cryptext--" on my local machine. That works correctly, but then when I get the token back I copy everything between Paste the following into your remote machine ---> and <---End paste back over to the server and I get an error that says:

Couldn't decode response - try again (make sure you are using a matching version of rclone on both sides: invalid character 'e' looking for beginning of value

Error: failed to configure OneDrive: empty token found - please run "rclone config reconnect Office365-OneDrive:"

A log from the command with the -vv flag

2021/11/01 15:02:27 DEBUG : Office365-OneDrive: config in: state="*oauth-authorize,choose_type,,", result="ey123--long-cryptext-token-copied-from-local-system--"
2021/11/01 15:02:27 DEBUG : Office365-OneDrive: config out: out=&{State:*oauth-authorize,choose_type,, Option:<nil> OAuth:<nil> Error:Couldn't decode response - try again (make sure you are using a matching version of rclone on both sides: invalid character 'e' looking for beginning of value
 Result:}, err=<nil>
Couldn't decode response - try again (make sure you are using a matching version of rclone on both sides: invalid character 'e' looking for beginning of value

2021/11/01 15:02:27 DEBUG : Office365-OneDrive: config in: state="*oauth-authorize,choose_type,,", result=""
2021/11/01 15:02:27 DEBUG : Office365-OneDrive: config out: out=&{State:*oauth-done,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2021/11/01 15:02:27 DEBUG : Office365-OneDrive: config in: state="*oauth-done,choose_type,,", result=""
2021/11/01 15:02:27 DEBUG : Office365-OneDrive: config out: out=&{State:choose_type Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2021/11/01 15:02:27 DEBUG : Office365-OneDrive: config in: state="choose_type", result=""
2021/11/01 15:02:27 DEBUG : Office365-OneDrive: config out: out=<nil>, err=failed to configure OneDrive: empty token found - please run "rclone config reconnect Office365-OneDrive:"
Error: failed to configure OneDrive: empty token found - please run "rclone config reconnect Office365-OneDrive:"

The only thing I notice here (and this could be an artefact of logging) in the config in line the token it logs is shorter than the token that I pasted in. The original token is approximately 7400 characters long.

The version on both my server (Debian 10) and my local machine (MacOS Darwin 11.6 on ARM) are 1.56.2, downloaded and installed just now.

hello and welcome to the forum,

not sure the exact issue.

a possible workaround is to create the config file on local computer and copy it to the remote computer.

1 Like

Simply run the configuration process locally and then copy the rclone.conf file across to the other machine?

yes, that will work.

the rclone.conf can be copied to any machine that runs rclone.

2 Likes

OneDrive authorization blobs for passing between consoles are pretty long strings. Some terminals had problems with copy-pasting them.
In attempt to overcome the problem we changed the blob format in rclone v1.55. The change was not backwards compatible so blobs generated with rclone authorize onedrive on rclone v1.54 will not work with rclone config on v1.56 and vice versa.
However the rclone.conf config format stayed the same, only the one-time blob was affected.
Consequently you can:

  1. Produce complete rclone.conf on desktop machine and distribute to the work machine. If it works for you, you won't need steps 2-3 anymore.
  2. Ensure that rclone version outputs the same rclone version on the two machines
  3. When you copy-paste the blob between terminals, check carefully that the string does not get corrupted in process. I usually verify that 3 first and 3 last characters match between source and target console windows.
1 Like

Thanks for this, very informative.

The versions are definitely the same, and the string as pasted looks the same, so I'm not sure what was happening in that regard- it appeared to be rejecting the first character of the blob, though there were loads of e characters in there so it could be somewhere else.

I have copied the .conf across and that is working fine, so the problem is solved for me, but there's definitely either something up with that process or the documentation for it as things stand.

Glad it worked
We have ongoing thread about similar case on the tracker

1 Like

Good to have it marked down. I think the problem must be something to do with the decoding rather than the size of the paste buffer because I pasted the contents of the config file between terminals to get it working.

1 Like

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