Open
Description
What is the problem you are having with rclone?
Linux rclone does not accept token generate by windows
What is your rclone version (output from rclone version)
1.56.1
Which OS you are using and how many bits (e.g. Windows 7, 64 bit)
Ubuntu 20 64bit
Windows 10 64bit
Which cloud storage system are you using? (e.g. Google Drive)
Onedrive
The command you were trying to run (e.g. rclone copy /tmp remote:tmp)
root@fr4:~# rclone -vv config reconnect onedrive_test:
A log from the command with the -vv flag (e.g. output from rclone -vv copy /tmp remote:tmp)
2021/09/26 09:16:29 DEBUG : rclone: Version "v1.56.1" starting with parameters ["rclone" "-vv" "config" "reconnect" "onedrive_test:"]
2021/09/26 09:16:29 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2021/09/26 09:16:29 DEBUG : onedrive_test: config in: state="", result=""
2021/09/26 09:16:29 DEBUG : onedrive_test: config out: out=&{State:*oauth,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2021/09/26 09:16:29 DEBUG : onedrive_test: config in: state="*oauth,choose_type,,", result=""
2021/09/26 09:16:29 DEBUG : onedrive_test: config out: out=&{State:*oauth-confirm,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2021/09/26 09:16:29 DEBUG : onedrive_test: config in: state="*oauth-confirm,choose_type,,", result=""
2021/09/26 09:16:29 DEBUG : onedrive_test: config out: out=&{State:*oauth-islocal,choose_type,, Option:true OAuth:<nil> Error: Result:}, err=<nil>
2021/09/26 09:16:29 DEBUG : onedrive_test: config: reading config parameter "config_is_local"
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> n
2021/09/26 09:16:30 DEBUG : onedrive_test: config in: state="*oauth-islocal,choose_type,,", result="false"
2021/09/26 09:16:30 DEBUG : onedrive_test: config out: out=&{State:*oauth-remote,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2021/09/26 09:16:30 DEBUG : onedrive_test: config in: state="*oauth-remote,choose_type,,", result=""
2021/09/26 09:16:30 DEBUG : sending client_id = "fe38556a-58d0-4181-88af-6a7b5acf1333"
2021/09/26 09:16:30 DEBUG : sending client_secret = "xSv7Q~kgVBoFpc2zoe.LERmQCGlFuvI6U07HV"
2021/09/26 09:16:30 DEBUG : onedrive_test: config out: out=&{State:*oauth-authorize,choose_type,, Option: OAuth:<nil> Error: Result:}, err=<nil>
2021/09/26 09:16:30 DEBUG : onedrive_test: config: reading config parameter "config_token"
For this to work, you will need rclone available on a machine that has
a web browser available.
For more help and alternate methods see: https://rclone.org/remote_setup/
Execute the following on the machine with the web browser (same rclone
version recommended):
rclone authorize "onedrive" "eyJjbGll..."
Then paste the result.
Enter a string value. Press Enter for the default ("").
config_token>
This value is required and it has no default.
Enter a string value. Press Enter for the default ("").
config_token> eyJ0eXAiOi....
2021/09/26 09:19:05 DEBUG : onedrive_test: config in: state="*oauth-authorize,choose_type,,", result="eyJ0eXAiOi....\",\"token_type\":\"Bearer\",\"refresh_token\":\"0.AS..."
2021/09/26 09:19:05 DEBUG : onedrive_test: 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/09/26 09:19:05 DEBUG : onedrive_test: config in: state="*oauth-authorize,choose_type,,", result=""
2021/09/26 09:19:05 DEBUG : onedrive_test: config out: out=&{State:*oauth-done,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2021/09/26 09:19:05 DEBUG : onedrive_test: config in: state="*oauth-done,choose_type,,", result=""
2021/09/26 09:19:05 DEBUG : onedrive_test: config out: out=&{State:choose_type Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2021/09/26 09:19:05 DEBUG : onedrive_test: config in: state="choose_type", result=""
2021/09/26 09:19:05 DEBUG : onedrive_test: config out: out=<nil>, err=failed to configure OneDrive: empty token found - please run "rclone config reconnect onedrive_test:"
Error: failed to configure OneDrive: empty token found - please run "rclone config reconnect onedrive_test:"
Usage:
rclone config reconnect remote: [flags]
Flags:
-h, --help help for reconnect
Use "rclone [command] --help" for more information about a command.
Use "rclone help flags" for to see the global flags.
Use "rclone help backends" for a list of supported services.
2021/09/26 09:19:05 Fatal error: failed to configure OneDrive: empty token found - please run "rclone config reconnect onedrive_test:"
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Activity
[-]Onedrive config_token generate by windows does work in Linux[/-][+]Onedrive config_token generated on Windows does Not work on Linux[/+]amidevous commentedon Sep 26, 2021
I admit you for onedrive I don't know but maybe try to update to v1.57
wget https://beta.rclone.org/rclone-beta-latest-linux-amd64.deb -O rclone-beta-latest-linux-amd64.deb
dpkg -i rclone-beta-latest-linux-amd64.deb
otherwise delete the config file and redo from 0
with the commands
rm -f /root/.config/rclone/rclone.conf
rclone config
as a reminder also it is not guaranteed that the configuration files
can be compatible between different operating system
also check if onedrive allows server ip if your ubuntu and a server which and very often the case can ban the ip
try to know you through the sock proxy browser
its will allow you to check if the ip and ban or not
tiantian1645 commentedon Sep 27, 2021
It can not be compatible between different operating system.
Same issue with rclone v1.57.0-beta.5664.1409b89f and rclone-v1.57.0-beta.5664.1409b89f6-windows-amd64
v1.55.1 works and token like
ncw commentedon Oct 1, 2021
1.56 introduces a different way of passing the config
It will either print something like this
or this
Either way you need to paste everything between the lines. In your example above it looks like you maybe only pasted the access token not the whole
{...}.The other thing that can go wrong is that cut and paste doesn't paste all the text - some OSes have a size limit, so double check the end of the paste is there too.
ivandeex commentedon Oct 16, 2021
let me reiterate
onedrive tokens are known for being very long
most probably you have a problem with your terminal eating part of copy-pasted buffer
please double check that your token was pasted in full
tiantian1645 commentedon Oct 16, 2021
I had checked many times before I write this issue.
And obviously the head of the token is different.
Please check it by yourself.
ivandeex commentedon Oct 17, 2021
Here my slightly redacted log from Linux:
Log from Windows:
Just followed instructions and copy-pasted when asked.
Success here.
What am I doing wrong?
ivandeex commentedon Oct 17, 2021
@tiantian1645
Maybe there is something special about chinese onedrive authentication?
Are you using chinese onedrive?
11 remaining items
ivandeex commentedon Oct 19, 2021
Indeed passed auth format differs between 1.54 and 1.56
It's not about OS, it's about rclone version
In 1.54 it was a piece of json.
In 1.56 it is base64 encoded json.
Passing from 1.56 to 1.54 won't work.
ivandeex commentedon Oct 19, 2021
Thanks all
ivandeex commentedon Nov 1, 2021
Update...
I encountered another confirmation of the problem on the forum at https://forum.rclone.org/t/couldnt-decode-response-when-pasting-in-code-for-headless-authorisation/27242/5
That ticket also provides a working workaround:
@Cnly @ncw
PTAL!
Could you consider some of the ideas like below?
This and following items will inevitably introduce the 3rd blob format to support, hopefully more resistant one 😞
loads of e characters- consecutiveecharacters bloat the blob and might confuse terminalsThanks
ncw commentedon Nov 2, 2021
The "official" doc for this is here: https://rclone.org/remote_setup/ it could be better signposted!
I think that is what is happening to get that
eerror, the fallback JSON decoder is running and we are getting the error from that rather than the new format decoder.rclone/lib/oauthutil/oauthutil.go
Lines 518 to 525 in 39e2af7
It might be better to return the error from the new format decoder, or maybe both the errors (eek!).
I'd like to reserve altering the format for last resort!
That is a good idea and we already remove all the whitespace in the decoder so it should be backwards compatible too. I'd probably go for slightly less than 80 char lines so it doesn't wrap in an 80x25 terminal.
That would make it much easier for users to see that the paste has gone wrong.
Cnly commentedon Dec 17, 2021
I've actually been thinking about this for a while, but am still concerned about backward compatibility. It's not the best thing to bring breaking changes to the same functionality twice in a row IMO... But maybe we can
[MUST USE RCLONE 1.58]at the beginning so it's easier for both machine and human to recognise the exact version of the token.What do you think?
Cnly commentedon Jan 9, 2022
See also #2732