Jotta Cloud stopped working after rclone upgrade - empty token found

Hi,

I have recently updated rclone versoin (ARM beta) from v1.45-069-g7ee7bc87-beta to v1.46.0-023-g240c1588-beta and, with this new version Jotta mount stopped working

if I try now to mount Jotta, it generates the following error:

Failed to create file system for “dRock-Jotta:dataRock64/duplicacy/data”: Failed to configure Jottacloud oauth client: empty token found - please run rclone config again

I run “rclone config” again :slight_smile: , but after finishing, it shows the following message:

Failed to get resource token: HTTP error 400 (400 Bad Request) returned body: “{“error”:“invalid_grant”,“error_description”:“The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.”}”

I have a backup of the old rclone binary so after restore it back and try to mount, it returned to work like a charm.

Any idea what has changed on the way to login to Jotta? I guess there is nothing to blame to Jotta as with the old binary it works.

Any suggestion will be much appreciated.

Did you refresh the token? That is the vital step.

I was unable to find a way to refresh, so I recreated the config. Seemed to work just fine.
Did a backup of .rclone config before of course :slight_smile:

WHen you do rclone config at the end it asks you whether to refresh the token or not.

An excellent workaround!

1 Like

I guess I did not expressed myself correctly :smiley: . I run “config” again, it’s true that it asked me to refresh the token but when I said “Y”, it showed the second (above) error about the URL that does not match.

I will try to delete it again and recreated from scratch (I did not want to mess it up without being sure asking first or without the proper backup).

My workaround has been keeping two copies of rclone (rclone and rclone.jotta) and call to mount jotta using the rclone.jotta (version v1.45.069) and the new rclone version (updated to v1.46.0-023) for hubic, opendrive & onedrive.

I like people which share solutions, right @mindtripper ? :wink: :smiley:

Has it been any deep change in the way we obtain the token from Jotta?

Oh, I see…

What you can do is create a new remote and if it works delete the old one and rename the new one.

Yes is the short answer!

Thanks team,

I did not have time till now to re-create the JottaCloud config, but removing the configuration and starting from scratch worked like a charm. You rock!

Thanks to both @ncw and @mindtripper . we can mark it a solved!!

sorry to bother you again guys… looks like the error is returning.

After some time running a backup (or accessing Jotta storage) , it just fail again with

2019/02/20 19:07:55 Failed to create file system for “Jotta:/”: couldn’t get account info: failed to get endpoint url: error 401: org.springframework.security.authentication.BadCredentialsException: No username for this token. (Unauthorized)

If I refresh again the token, it start working again but after some time (couple of hours or so), it returns to show above error listing the files.

I made some tests on this regards as follows.

I kept a backup of the old conf, not updating the token and also of the rclone binary.

As follows:

 [oDroid-Jottaold]
 type = jottacloud
 user = myuser
 pass = blablabla
 mountpoint = Archive
 token = {"access_token":" blablabla}
 
 
 [oDroid-Jottanew]
 type = jottacloud
 user = myuser
 mountpoint = Archive
 pass = blablabla
 token = {"access_token":"blablabla"}

and I have also kept both rclone versions as follows:
a) this works with jottaold

# rclone.good version
rclone v1.45-069-g7ee7bc87-beta

  • os/arch: linux/arm64
  • go version: go1.11.4

b) this does not work with old or new setups

# rclone version
rclone v1.46.0-027-g8f4ea77c-beta

  • os/arch: linux/arm64
  • go version: go1.12rc1

This is the test:

With version 1.46 and the net setup… below error.

# rclone ls oDroid-Jottanew:/
2019/02/20 19:24:29 Failed to create file system for “oDroid-Jottaold:/”: couldn’t get account info: failed to get endpoint url: Get https://www.jottacloud.com/jfs/myusername: oauth2: cannot fetch token: 400 Bad Request
Response: {“error”:“invalid_grant”,“error_description”:“The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.”}

b) with version 1.45 and old conf… Everything works.

# rclone.good ls oDroid-Jottaold:/
452 Duplicacy/dataDroid/chunks/eb836bd47f4de2ea304a6e4737d60a5018ecb476f14d10d901a38eec7a868ae2
842 Duplicacy/dataDroid/config

As per above test, with the old version of both rclone and config, I can list and work with files.

I have noticed also in the old jotta config it is saved the password (encrypted) while in the new, there is no reference and always ask for it with a message like “it will not be saved”.

With new current version (v1.46.0-027-g8f4ea77c-beta) I cannot work with the Jotta Cloud for more than two hours, while with both old rclone and config, I can properly work.

Do not take me wrong, I am not complaining, just informing :smiley: I can update my scripts to use the rclone.good binary meanwhile a solution is found, I will keep the old binary and conf for Jotta while I use the newest features for the rest of storage providers.

Thanks for your continues updates and good work!!

Seems like a bug when refreshing the token. I am experiencing the same issue. Recreating the remote only works for a certain amount of time until the error appears again.

@cvillabrille In version 1.46 the authentication for Jottacloud was changed so that’s why it works for 1.45. Maybe stick to 1.45 until it’s fixed if you don’t need any of the stuff added in 1.46.

I created a issue #2992 on Github

buengese made a fix for this, try the latest beta from https://beta.rclone.org/

Sorry @olihey

unless there is a new version that I am not aware…

# rclone -V
rclone v1.46.0-028-g972e27a8-beta
- os/arch: linux/arm64
- go version: go1.12rc1

After deleting and creating it again:

[oDroid-Jotta]
type = jottacloud
user = myuser
mountpoint = Archive
token = {"access_token":"md5md5md5","token_type":"bearer","refresh_token":"moremd5moremd5moremd5","expiry":"2019-02-22T11:07:15.33259596+01:00"}
--------------------

same result.

2019/02/22 10:07:39 NOTICE: Serving remote control on http://127.0.0.1:5572/
2019/02/22 10:07:46 Failed to create file system for "oDroid-Jotta:Duplicacy/dataDroid": couldn't get account info: failed to get endpoint url: Get https://www.jottacloud.com/jfs/myusername: oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_grant","error_description":"The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."}

Thanks a lot for your efforts and help.

Quick question, are you using Jottacloud and rclone on more than one machine?

Yes I am,

in two different machines far away each from the other (two different countries). Not sharing same internet connection I mean.

But I have stopped the second connection, deleted and created back the storage on one, and same result.

2019/02/22 10:26:53 Failed to create file system for....

With old binary version, I am able to have two parallel connections in place, even uploading from both at the same time, I would like to do not lose this feature (if possible).

There is definilty a problem running rclone with the same Jottcloud account on more than one machine.
When I setup the remote on one machine it works fine. Right afterwards I create a remote with the same account on another machine works there just fine, but on this first machine I get

 ./rclone -vv lsd jc:/
2019/02/23 08:09:46 DEBUG : rclone: Version "v1.46.0-028-g972e27a8-beta" starting with parameters ["./rclone" "-vv" "lsd" "jc:/"]
2019/02/23 08:09:46 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2019/02/23 08:09:46 Failed to create file system for "jc:/": couldn't get account info: failed to get endpoint url: error 401: org.springframework.security.authentication.BadCredentialsException: No username for this token. (Unauthorized)

And if I re-create the remote on the first machine it fails afterwards on the second.

Now this is a bit tricky, as this seems to be a limitation on Jottacloud’s endpoint. I assume that’s because we share the same client_id/client_secret in rclone. Seems like we need to create a new “client” for each rclone instance running, see here: https://github.com/ttyridal/aiojotta/wiki/Jotta-protocol-3.-Authentication#token-authentication

Your error with the beta-028 I could not re-create. I get the same error when running a pre-1.46 version

hmmmm… weird if it is a limitation on Jotta side.

I can backup from both at the same time in pre 046.

Maybe implementing Jotta “Device” approach instead of “Archive”.

I can survive keeping the old binary. I have modified my backup scripts to use rclone.good (sorry for the naming convention :smile: I prefer thinking in positive :wink:), but I would like to do not lose the possibility of doing automated backups without manually renew the token.

Thanks @olihey for your comments and support. I am preparing another "flowers (and other pretty things) " for the team after my next payroll.

That’s because the entire communiction between rclone and Jottacloud was changed to OAuth based authentication. In version pre 1.46 it used simple basic authentication.

Makes sense. Improving sometimes causes more issues :smiley:

by “new client” do you mean within rclone? what about a new md5 client name per token? (just thinking). Jotta does not limit per device (as others) as long as the device name is different, isn’t?

Thanks for your improvements and time. Keep doing such good work.

@olihey, any update?

I am running some backups currently yet using v1.45-069-g7ee7bc87-beta version to Jotta, uploading to 12.83MB/s…

Not sure if the new validation will be able to improve such speed :smiley: but looking forward to see any advance.

Thanks for your support!

@olihey,

sorry to bother you again.

I am testing lastest version (v1.47.0-083-gf0e439de-beta-linux-arm) and looks like the issue still persist. I have two devices using JottaCloud.

After update the token (rclone config and "e) Edit existing remote", selecting Yes in "Do you want to create a machine specific API key?") the rclone ls (or mount) works for some hours (around 2) but then it stop working with the following message in both ARM boards:

2019/05/28 16:17:34 ERROR : jottacloud root 'newapproach/test': Statfs failed: Get https://www.jottacloud.com/jfs/jottaCloud_username: oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_grant","error_description":"The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."}

It works for two or three hours but then, suddenly stops again.
I guess related to the expiration date of the token:
"expiry":"2019-05-28T16:08:17.304790113+01:00"

is there any way to automatically extend the token? Any further attempt to mount or ls the jottacloud remote ends in the same error:

Response: {"error":"invalid_grant","error_description":"The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."}

Have you copied the config file elsewhere? I think you can only use each config in one place? If you have a long running mount and are using separate rclone commands that could be a problem too.