Jottacloud on two machines: Invalid grant

What is the problem you are having with rclone?

Jottacloud mounted on Linux using machine A. It remains mounted successfully. Attempting to upload files to the same Jottacloud on machine B is resulting in errors after a while. Both machines are using the same config, and if I refresh the token as outlined, machine A loses access and the cycle starts all over again. If I transfer the config from machine A to machine B, it works for a while longer, then I get the same error. I'm assuming that when I click generate on the jottacloud website it creates a new authentication token, but why are two machines which are using the same token having issues? Is there a way to solve this? Transfering the config file from machine A to machine B right now will result in transfers being successful for the next few hours to day, then the process repeats.

What is your rclone version (output from rclone version)

Both running Rclone v1.54.0

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

Ubuntu 20.04x64, Windows 10 x64

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

Jottacloud

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

rclone sync "y:\ftp\audiobooks" "kn4crc:/ftp/audiobooks" --fast-list --transfers=40 --checkers=40 --tpslimit=10 --drive-chunk-size=1M --max-backlog 300000 --verbose --log-file=rclone1.log -vv

The rclone config contents with secrets removed.

[kn4crc]
type = jottacloud
tokenURL = https://id.jottacloud.com/auth/realms/jottacloud/protocol/openid-connect/token
token = {"access_token":"<token","token_type":"bearer","refresh_token":,"<refresh token","expiry":"2021-01-26T02:34:04.3990498-06:00"}
configVersion = 1

A log from the command with the -vv flag

2021/02/28 16:55:28 DEBUG : rclone: Version "v1.54.0" starting with parameters ["rclone" "sync" "y:\\ftp\\audiobooks" "kn4crc:/ftp/audiobooks" "--fast-list" "--transfers=40" "--checkers=40" "--tpslimit=10" "--drive-chunk-size=1M" "--max-backlog" "300000" "--verbose" "--log-file=rclone1.log" "-vv"]
2021/02/28 16:55:28 DEBUG : Creating backend with remote "y:\\ftp\\audiobooks"
2021/02/28 16:55:28 DEBUG : Using config file from "C:\\rclone\\rclone.conf"
2021/02/28 16:55:28 INFO  : Starting HTTP transaction limiter: max 10 transactions/s with burst 1
2021/02/28 16:55:28 DEBUG : fs cache: renaming cache item "y:\\ftp\\audiobooks" to be canonical "//?/y:/ftp/audiobooks"
2021/02/28 16:55:28 DEBUG : Creating backend with remote "kn4crc:/ftp/audiobooks"
2021/02/28 16:55:28 DEBUG : kn4crc: Loaded invalid token from config file - ignoring
2021/02/28 16:55:28 DEBUG : kn4crc: Token refresh failed try 1/5: oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_grant","error_description":"Stale token"}
2021/02/28 16:55:29 DEBUG : kn4crc: Loaded invalid token from config file - ignoring
2021/02/28 16:55:29 DEBUG : kn4crc: Token refresh failed try 2/5: oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_grant","error_description":"Stale token"}
2021/02/28 16:55:30 DEBUG : kn4crc: Loaded invalid token from config file - ignoring
2021/02/28 16:55:30 DEBUG : kn4crc: Token refresh failed try 3/5: oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_grant","error_description":"Stale token"}
2021/02/28 16:55:31 DEBUG : kn4crc: Loaded invalid token from config file - ignoring
2021/02/28 16:55:32 DEBUG : kn4crc: Token refresh failed try 4/5: oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_grant","error_description":"Stale token"}
2021/02/28 16:55:33 DEBUG : kn4crc: Loaded invalid token from config file - ignoring
2021/02/28 16:55:33 DEBUG : kn4crc: Token refresh failed try 5/5: oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_grant","error_description":"Stale token"}
2021/02/28 16:55:34 DEBUG : jottacloud root 'ftp/audiobooks': Token expired but no uploads in progress - doing nothing
2021/02/28 16:55:34 Failed to create file system for "kn4crc:/ftp/audiobooks": couldn't get customer info: Get "https://api.jottacloud.com/account/v1/customer": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect kn4crc:": oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_grant","error_description":"Stale token"}

hi,
--drive-chunk-size is for gdrive, not jotta.
tho that is not the cause of the problem.

It looks like jotta is invalidating a re-used refresh token (box does this too).

So if you want to copy the config file, then

  • rclone config reconnect jotta: (or whatever your remote is called`
  • copy the config file
  • now do this *again so the machine gets another refresh token
  • rclone config reconnect jotta:

Or you can use the remote auth option

Hello,
So - reconnect on machine A, copy the config, reconnect on machine A again to get a new token?
What's the command to have a link sent so I can open it on a local machine if the target machine is headless? --auth, according to https://rclone.org/commands/rclone_authorize/
Will give this a look when I get time later.
thanks for the help.

1 Like

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