Failed to configure dropbox: "empty token found" on linux but works fine on Windows

#1

Hi !

I’m trying to setup rclone with dropbox, but hit an issue under linux (tried Alpine linux 3.6 and Debian Stretch) with rClone 1.47.0.

When running:
rclone copy test.txt dropbox_test:test.txt

I get
2019/04/18 09:33:56 Failed to create file system for “dropbox_test:test.txt”: failed to configure dropbox: empty token found - please run rclone config again

The very same command with the very same config file works well under Windows.

Here’s my (obfuscated) config :

[dropbox_test]
type = dropbox
client_id = ***************
client_secret = ***************
access_token = {"access_token":"****************************************************************","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}

I also tried with rclone 1.40.
It looks like the config file isn’t properly parsed… I checked the line endings, but that didn’t help…

Any idea what could be happening ?

Thanks !

Olivier

#2

1.40 is ancient.

Stick with 1.47

It probably has to do with copying the file from Linux or WIndows and line feeds.

Why not just delete the config file and just run ‘rclone config’ and re-enter in your info?

#3

Hi,

Thanks for the answer. I tested with 1.47 too, tried with both line feeds variants, also tried to regenerated the config, but it still doesn’t work.

Here are all the steps I tried :

On the server (alpine 3.6, rclone 1.47.0) :

rclone config
name> dropbox_test
storage> dropbox 
client_id> *A*
client_secret> *B*
edit advanced> n
already have a token - refresh> y
use auto config> n

On my computer (Windows, rClone 1.47.0) rclone.exe authorize "dropbox" "*A*" "*B*"

I grant access in the browser, back to the console I get following string, which I copy.

{"access_token":"*C*","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}  

Back on the server, I paste the string, confirm it’s ok, and quit config.

This creates the following config file :

[dropbox_test]
type = dropbox
client_id = *A*
client_secret = *B*
token = {"access_token":"*C*","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}

Then, I test :

rclone copy -vvv test dropbox_test:test

Which yields :

2019/04/18 11:34:07 INFO  : dropbox_test: Converting token to new format
2019/04/18 11:34:07 Failed to create file system for "dropbox_test:test": failed to configure dropbox: invalid character 'r' after top-level value

So there’s definitely something wrong here…

In the meantime, I tested with 1.39, where everything seems to work (but the config file looks different, with app_key and app_secret instead of client_id/client_secret).

#4

1.39 is ancient and not helpful to really look at.

Are you trying to get this working on Linux or Windows?

Did you delete the rclone.conf on Windows and re-run rclone config?

#5

1.39 may not be helpful to look at, but it works…

As stated, I’m trying on Linux (alpine 3.6). I used windows just to get the token, following the normal procedure for a remote/headless server.

I did the steps above, so yes, I started from scratch.

#6

1.39 is from Dec 2017 and there were changes in dropbox auth back then so it’s like comparing an apple to a bazooka.

So what I would try is to make sure everything is on 1.47 and delete all your rclone.confs you have.
Create a rclone.conf completely on Windows and copy that file over the Linux and test that way as something is perhaps going wrong the pasting.

#7

That’s exactly what I did…

Do you have a working example of a dropbox config on a remote/headless linux server that works with 1.47 ? Could you share the config ?

By the way, the process to configure on a remote/headless server seems broken on 1.47, as even with a custom client id/secret, you are asked :

For this to work, you will need rclone available on a machine that has a web browser available.
Execute the following on your machine:
        rclone authorize "dropbox"

Without the client id/secret. In previous version, it (correctly) asked to execute :

        rclone authorize "dropbox" "*app_id*" "*app_secret*"

So, still using 1.39, but from the changelog, it seems it would be good to have 1.47 working.

#8

I created a new headless remote on Linux and had no issues. All on 1.47.

** See help for dropbox backend at: https://rclone.org/dropbox/ **

Dropbox App Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id>
Dropbox 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
y/n> 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
n) No
y/n> N
For this to work, you will need rclone available on a machine that has a web browser available.
Execute the following on your machine:
	rclone authorize "dropbox"
Then paste the result below:
result> {"access_token":"token-HKlinLjYQNdKG","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
--------------------
[TestDrop]
type = dropbox
token = {"access_token":"token-HKlinLjYQNdKG","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name                 Type
====                 ====
GD                   drive
TestDrop             dropbox
Union                union
gcache               cache
gcrypt               crypt
gmedia               crypt
mega                 mega

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q
[felix@gemini ~]$ rclone ls TestDrop:
      240 Get Started with Dropbox Paper.url
  1102331 Get Started with Dropbox.pdf
[felix@gemini ~]$
[felix@gemini ~]$
[felix@gemini ~]$ rclone copy /etc/hosts TestDrop:

My conf looks like:

[TestDrop]
type = dropbox
token = {"access_token":"token-HKlinLjYQNdKG","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
#9

Ohhh I finally got it, I had an RCLONE_DROPBOX_TOKEN env var interfering with my config file…

It would definitely be a good idea that config is also automatically loaded from env vars next to

2019/04/18 14:29:28 DEBUG : Using config file from "/home/user/.config/rclone/rclone.conf"

Thanks for your time and sorry for the noise.

#10

Ah!

That’s a good find so that’s awesome to share that.

No noise at all and happy you got it fixed!

closed #11

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