Dropbox expired_access_token

What is the problem you are having with rclone?

expired_access_token

Run the command 'rclone version' and share the full output of the command.

rclone v1.60.1

  • os/version: slackware 15.0+ (64 bit)
  • os/kernel: 5.19.17-Unraid (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.19.3
  • go/linking: static
  • go/tags: none

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

Dropbox

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

rclone copy --human-readable --max-duration=5m -v --bwlimit 25M /mnt/user/data/test/ crypt:/
 --log-file /mnt/user/log/rclone//$(date +"%Y_%m_%d_%T")_rclone.log

The rclone config contents with secrets removed.

[dropbox]
type = dropbox
token = XXXX
client_id = YYYY
client_secret = ZZZZ

[crypt]
type = crypt
remote = dropbox:/crypt
password = XXXX
password2 = YYYY

A log from the command with the -vv flag

2022/12/22 08:21:40 INFO  : Starting bandwidth limiter at 25Mi Byte/s
2022/12/22 08:21:40 DEBUG : rclone: Version "v1.60.1" starting with parameters ["rcloneorig" "--config" "/boot/config/plugins/rclone/.rclone.conf" "copy" "--human-readable" "--max-duration=5m" "-vv" "--bwlimit" "25M" "/mnt/user/data/test/" "crypt:/ "--log-file" "/mnt/user/log/rclone//2022_12_22_08:21:40_rclone.log"]
2022/12/22 08:21:40 DEBUG : Creating backend with remote "/mnt/user/data/test/"
2022/12/22 08:21:40 DEBUG : Using config file from "/boot/config/plugins/rclone/.rclone.conf"
2022/12/22 08:21:41 DEBUG : Creating backend with remote "crypt:/"
2022/12/22 08:21:41 DEBUG : Creating backend with remote "dropbox:/crypt/udedo1k6186ub30i374kra14s0"
2022/12/22 08:21:41 DEBUG : Creating backend with remote "dropbox:/crypt/udedo1k6186ub30i374kra14s0"
2022/12/22 08:21:41 Failed to create file system for "crypt:/sonarr": failed to make remote "dropbox:/crypt" to wrap: get current account failed: expired_access_token/

I contacted Dropbox about it, first they said they no longer offer the option for creating new long-lived access tokens.
But they have OAuth and their documentation, which is not in layman at all, and has no examples either, which I told them, so they asked for more information, like the registered API app, version number of the application, how to reproduce this, and the error text, and the answer was to talk the Rclone about it, so I'm trying here.

The links they sent me:
basic outline of processing this flow
information on this migration
OAuth Guide
authorization documentation

You should be able to run rclone config reconnect dropbox: and follow the instructions to remake the token.

This assumes your client_id is set up correctly - it will need the redirect_url set to http://localhost:53682/

You can use rclone's cient_id if you comment out the client_id and client_secret before running rclone config reconnect.

I can make it work. But since I want it to synchonize to it daily, it's annoying that I have to do it every time.
Is there a way to make it work permanently so I don't have to reconnect it every time?

There should be no need to reconnect it daily. Once you have a token with a refresh_token then rclone can refresh it automatically.

token = {"access_token":"XXX","token_type":"bearer","refresh_token":"XXX","expiry":"2022-11-09T16:58:51.510035441Z"}

Well, how do I get that? 'Cause mine expires.

Check your client ID is in production.

I need an icon for that...
I'll figure something out on that in a few days since it's Christmas soon.

Thank you so far though :slight_smile:

1 Like

I use development for my 2 app ids on dropbox and never have had an issue.

I use them for mounts and they run 24x7 though and refresh without a problem.

They chaned to that OAuth stuff 30th of september or something. Because it was working with the trial I tested with in the beginning of november, but now, it doesn't.

I don't know why it's not working for me :confused:

You'd want to be connected and have it working and share a debug log when the actual problem happens.

It's not working, and I did share the debug log.
Do you want something else?

Yes, reconnect the token and keep it debug log, share the log of when it breaks.

When it's already broken and the log is there, there is not much to tell.

I already posted a debug log?

Feels like we're circling a bit here.

If you don't want to post when the issue happens, don't.

If you want to try to figure out what's going on, keep debug on and post a log when the issue actually occurs.

The log you posted, as I've said a few times, is already not working so there's nothing to see there.

I use dropbox and have for over a year plus now and my app is not in production and I have no issues with tokens refreshing.

I don't get it then.....

Am I supposed to show a log of it working, and then when it doens't work?
This is what it looks like when it doesn't work.

Or do you want me to run the command with -vv and log it so I can see what's going on the second it stops working, or?`

The issue started in december for me, the free trial I used in november for testing worked just fine. It's that OAuth change they did.

Run it in debug as it'll be working until something in the log will show it's not working.

If there is a repeatable path to recreate it, share the steps you are doing to recreate it.

I don't use my Google Drive as an example as I only do testing with that so it'll refresh a token.

felix@gemini:/opt/rclone$ rclone about GD: -vv
2022/12/29 09:48:56 DEBUG : Setting --config "/opt/rclone/rclone.conf" from environment variable RCLONE_CONFIG="/opt/rclone/rclone.conf"
2022/12/29 09:48:56 DEBUG : rclone: Version "v1.61.1" starting with parameters ["rclone" "about" "GD:" "-vv"]
2022/12/29 09:48:56 DEBUG : Creating backend with remote "GD:"
2022/12/29 09:48:56 DEBUG : Using config file from "/opt/rclone/rclone.conf"
2022/12/29 09:48:56 DEBUG : GD: Loaded invalid token from config file - ignoring
2022/12/29 09:48:56 DEBUG : Saving config "token" in section "GD" of the config file
2022/12/29 09:48:56 DEBUG : Keeping previous permissions for config file: -rwxrwxr-x
2022/12/29 09:48:56 DEBUG : GD: Saved new token in config file
Total:   16 GiB
Used:    1.863 GiB
Free:    10.775 GiB
Trashed: 545 B
Other:   3.362 GiB
2022/12/29 09:48:56 DEBUG : 6 go routines active

So this?

Or do you want me to refresh it, add the extra v for debugging and write it to a file, and post it when it stops working?

 rclone about dropbox: -vv
2022/12/29 15:55:03 DEBUG : rclone: Version "v1.61.1" starting with parameters ["rcloneorig" "--config" "/boot/config/plugins/rclone/.rclone.conf" "about" "dropbox:" "-vv"]
2022/12/29 15:55:03 DEBUG : Creating backend with remote "dropbox:"
2022/12/29 15:55:03 DEBUG : Using config file from "/boot/config/plugins/rclone/.rclone.conf"
2022/12/29 15:55:04 DEBUG : 6 go routines active
2022/12/29 15:55:04 INFO  : Dropbox root '': Committing uploads - please wait...
2022/12/29 15:55:04 Failed to about: about call failed: expired_access_token/

Do you run it once a day? Once a week? Once a month?

No mounts and only a copy that runs? The more details you can provide, the more I can try to recreate whatever you are facing.

What does your app look like?

It runs once a day at midnight (my time).
Mounted it with this at array startup:

rclone mount --max-read-ahead 1024k --allow-other dropbox: /mnt/disks/dropbox &

And this at array stop:

fusermount -u /mnt/disks/dropbox

This is my app settings on Dropbox:

I think you need to set the oauth redirct url to http://localhost:53682/ and then run through rclone config and do the oauth. I suspect you are just using that page to generate a token - these only live 24 hours I think.