RClone issue authorizing with Zoho "No Region"

What is the problem you are having with rclone?

RClone comes back with "No region set" when trying to use "rclone authorize "zoho" " - seems to be the same issue as 5178 on github which is marked closed?

What is your rclone version (output from rclone version)

rclone v1.56.0-beta.5481.6ef7178ee (Latest?)
go/version: go1.16.3

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

Windows 10 Pro 64bit

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

Zoho

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

 "rclone authorize "zoho" "

The rclone config contents with secrets removed.

None - During setup

A log from the command with the -vv flag

rclone authorize "zoho" -vv
2021/05/06 09:11:38 DEBUG : rclone: Version "v1.56.0-beta.5481.6ef7178ee" starting with parameters ["rclone" "authorize" "zoho" "-vv"]
2021/05/06 09:11:38 DEBUG : Using config file from "C:\\Users\\User\\.config\\rclone\\rclone.conf"
Error: no region set
Usage:
  rclone authorize [flags]

Flags:
      --auth-no-open-browser   Do not automatically open auth link in default browser
  -h, --help                   help for authorize

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/05/06 09:11:38 Fatal error: no region set

Are you running rclone config on a machine and trying to get authorized from another machine?

You need to specific what region it needs to connect to:

 felix@gemini:~$ rclone authorize zoho
2021/05/06 12:20:04 No region set
felix@gemini:~$ rclone authorize zoho --zoho-region=us
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=W0A_FO1GkotPrrP1t6wXig
Log in and authorize rclone for access
Waiting for code...
^C
1 Like

I may have spoken a tad too soon. Once authorized on the headless machine, if I run the command "rclone ls remote:"

I get back the following error:

~# rclone lsd remote:

2021/05/06 19:35:54 ERROR : : error listing: couldn't list files: HTTP error 401 (401 ) returned body: "{"errors":[{"id":"R008","title":"Unauthorized access"}]}"
2021/05/06 19:35:54 Failed to lsd with 2 errors: last error was: couldn't list files: HTTP error 401 (401 ) returned body: "{"errors":[{"id":"R008","title":"Unauthorized access"}]}"

Thanks ^^;

This should be fixed in the latest beta but you will need to use the beta for both sides so the one running rclone config and the one running rclone auth.

1 Like

That makes a lot of sense, I didn't think to update the version on the server. Apologies. I'm now running rclone v1.56.0-beta.5481.6ef7178ee on both the server and desktop. I have re-setup the profile for it, and it's gone a bit different this time (giving me a code on the authorize) however when I run "rclone lsd -v remote:" it still comes back with:

~# rclone lsd -v remote:
2021/05/07 12:02:54 ERROR : : error listing: couldn't list files: HTTP error 401 (401 ) returned body: 
"{\"errors\":[{\"id\":\"R008\",\"title\":\"Unauthorized access\"}]}"
2021/05/07 12:02:54 Failed to lsd with 2 errors: last error was: couldn't list files: HTTP error 401 
(401 ) returned body: "{\"errors\":[{\"id\":\"R008\",\"title\":\"Unauthorized access\"}]}"

I have also reached out to Zoho incase this is an issue on their end. I'm wondering if this is something to do with the fact that Zoho doesn't allow access to the root (per say?) and has a sub folder called "My Folders". I did try tagging it onto the command but it hasn't made much difference:

~# rclone lsd -v remote:"My Folders"
2021/05/07 12:08:35 Failed to create file system for "remote:My Folders": couldn't list files: 
HTTP error 401 (401 ) returned body: "{\"errors\":[{\"id\":\"R008\",\"title\":\"Unauthorized 
access\"}]}"

Apologies again, i'm new to rclone so i'm not really that well versed in it all, just going by the zoho page on the docs!

Thank you both for the help so far!

What does your config look like?

Mine looks like (rclone config show TestZoho)

[TestZoho]
type = zoho
region = eu
token = XXX
root_folder_id = 4xrzu9ece9a669c3c4d38a009ca405a67cce9

So there are two possible problems. One is that something is wrong with the auth - maybe the region didn't get set in the config file or that your root_folder_id is set wrong and you don't have access to that root folder for some reason.

You can try this to fix the root_folder_id

$ rclone-v1.55.1 config reconnect zoho2:
Already have a token - refresh?
y) Yes (default)
n) No
y/n> n
Choose a number from below, or type in your own value
 1 / rclone
   \ "4xrzuf5bbda0ee9724864a75bd4b8408a6d88"
Enter a Team Drive ID> 1
Choose a number from below, or type in your own value
 1 / General
   \ "4xrzu9ece9a669c3c4d38a009ca405a67cce9"
Enter a Workspace ID> 1

(Note you have to actively choose 1 not just press return)

1 Like

Hi Nick,

I've just been messing around with it and after looking at your post with the root folder id, I realised it looked similar to the id that's displayed before /privatespace/folders/files in the URL when you visit the page in a browser, so I changed the "root_folder_id" to and it comes back correctly with say "rclone about remote:" but "rclone ls remote:" comes back with Unauthorized access" again.

Config looks like the following;

[remote]
type = zoho
region = eu
token = {"access_token":"TOKEN","refresh_token":"TOKEN","expiry":"2021-05- 
07T12:00:29.5427661+01:00"}
root_folder_id = 4yfg.....ID (Not sure if this is private or not so I haven't posted it?)

I did try pressing the method you discribed during config, but when I entered 1, it just came back with "Enter a Workspace ID" again over and over, so I added that root_folder_id manually in the rclone.conf file on my system.

Hopefully that makes sense!
Thanks for sticking with me on this, I feel i'm close to having it sorted, apologies if i've been dumb and miss read something you've put!

Can you paste what you did when trying rclone config reconnect? Add the -vv flag and it will tell you more stuff.

I suspect you've got the wrong ID which is why it isn't working.

1 Like

Hi Nick,

(Sorry, realised that I left an ID in the previous post and it shows edits, so have deleted it and reposted! )

I wasn't entirely sure what you meant by rclone config reconnect, so i've just gone ahead and done "rclone config -vv" Doing this all on my local machine for the moment so we tick one thing off at once.

C:\Users\User\rclone-beta-latest-windows-amd64\rclone-v1.56.0-beta.5480.9ff6f48d7-windows-amd64>rclone config -vv
2021/05/09 18:33:25 DEBUG : rclone: Version "v1.56.0-beta.5480.9ff6f48d7" starting with parameters ["rclone" "config" "-vv"]
2021/05/09 18:33:25 DEBUG : Using config file from "C:\\Users\\User\\.config\\rclone\\rclone.conf"
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> remote
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
(Removed the other 39 to avoid spamming!)
40 / Zoho
   \ "zoho"
41 / http Connection
   \ "http"
42 / premiumize.me
   \ "premiumizeme"
43 / seafile
   \ "seafile"
Storage> 40
** See help for zoho backend at: https://rclone.org/zoho/ **

OAuth Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id>
OAuth Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret>
Zoho region to connect to. You'll have to use the region you organization is registered in.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
 1 / United states / Global
   \ "com"
 2 / Europe
   \ "eu"
 3 / India
   \ "in"
 4 / Australia
   \ "com.au"
region> 2
Edit advanced config? (y/n)
y) Yes
n) No (default)
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 (default)
n) No
y/n> y
2021/05/09 18:33:42 DEBUG : Starting auth server on 127.0.0.1:53682
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=qcCHL1RuH5uKZtyMGKYiDQ
Log in and authorize rclone for access
Waiting for code...
2021/05/09 18:33:46 DEBUG : Redirecting browser to: https://accounts.zoho.eu/oauth/v2/auth?access_type=offline&client_id=<ID>&prompt=consent&redirect_uri=http%3A%2F%2Flocalhost%3A53682%2F&response_type=code&scope=aaaserver.profile.read+WorkDrive.team.READ+WorkDrive.workspace.READ+WorkDrive.files.ALL&state=qcCHL1RuH5uKZtyMGKYiDQ
2021/05/09 18:33:48 DEBUG : Received GET request on auth server to "/"
Got code
2021/05/09 18:33:48 DEBUG : Saving config "token" = "{\"access_token\":\"TOKEN HIDDEN\",\"token_type\":\"Bearer\",\"refresh_token\":\"TOKEN HIDDEN\",\"expiry\":\"2021-05-09T19:33:48.4429983+01:00\"}" in section "remote" of the config file
2021/05/09 18:33:48 DEBUG : Keeping previous permissions for config file: -rw-rw-rw-
2021/05/09 18:33:48 DEBUG : remote: Saved new token in config file
2021/05/09 18:33:48 DEBUG : Closing auth server
2021/05/09 18:33:48 DEBUG : Closed auth server with error: accept tcp 127.0.0.1:53682: use of closed network connection
2021/05/09 18:33:48 DEBUG : Saving config "token" = "{\"access_token\":\"TOKEN HIDDEN\",\"token_type\":\"Zoho-oauthtoken\",\"refresh_token\":\"TOKEN HIDDEN\",\"expiry\":\"2021-05-09T19:33:48.4429983+01:00\"}" in section "remote" of the config file
2021/05/09 18:33:48 DEBUG : Keeping previous permissions for config file: -rw-rw-rw-
2021/05/09 18:33:48 DEBUG : remote: Saved new token in config file
Choose a number from below, or type in your own value
 1 / Company Name
   \ "4yfg0<hidden middle part incase it's private!>29"
Enter a Team Drive ID> 1
Choose a number from below, or type in your own value
Enter a Workspace ID> 1 <-- doesn't work
Enter a Workspace ID> 0 <-- doesn't work
Enter a Workspace ID>  <-- blank works
2021/05/09 18:34:21 DEBUG : Saving config "root_folder_id" = "" in section "remote" of the config file in section "remote" of the config file
2021/05/09 18:34:21 DEBUG : Keeping previous permissions for config file: -rw-rw-rw-
--------------------
[remote]
type = zoho
region = eu
token = {"access_token":"TOKEN HIDDEN","token_type":"Zoho-oauthtoken","refresh_token":"TOKEN HIDDEN","expiry":"2021-05-09T19:33:48.4429983+01:00"}
root_folder_id = 
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
2021/05/09 18:34:25 DEBUG : Keeping previous permissions for config file: -rw-rw-rw-
Current remotes:

Name                 Type
====                 ====
remote               zoho

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
2021/05/09 18:34:52 DEBUG : rclone: Version "v1.56.0-beta.5480.9ff6f48d7" finishing with parameters ["rclone" "config" "-vv"]

I realised midway through creating this that the workspace ID I was entering was the same as the Team Drive ID, so now i'm stumped as to what to put into the "root_folder_id = " part.

Hopefully that all helps!
Thanks,

Hmm, so there are no workspace IDs - that is odd.

@buengese do you have any ideas?

1 Like

Hmm it looks like "My Folder" doesn't actually show up under workspaces. There is a separate API call that can be used to retrieve its ID, so that would be a simple fix. However it looks we can't use the standard list API to list its contents which is really annoying. I'll look into it.

1 Like

I merged the new config stuff into master otherwise it is going to cause a mess for this kind of change! Testing appreciated :slight_smile: