NOTICE: Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config

What is the problem you are having with rclone?

During setup of rclone on a Raspberry Pi I type Y as an answer to use auto config and get the warning as follows:

NOTICE: Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config.
NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=5l4XXXXXXXXX-Iw
NOTICE: Log in and authorize rclone for access
NOTICE: Waiting for code...

The tutorial I'm using to set this all up Mounting Google Drive on Raspberry Pi | by Artur Klauser | Medium suggest this is a headless machine issue but the machine I'm using is not headless

After this message appears Chrome opens to a page saying This app's request is invalid. Error 400: redirect_uri_mismatch

One other point of interest, on the RPi I have Chrome open and my google Sync is pause and it syas sign in again but I've tried multiple times to sign in and it always remains as Sync is paused. Simultaneously on my windows computer I am logged in to google under the same account and everything is OK.

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

v1.59.2

  • os version: raspbian 10.6
  • os kernel: 5.4.72-v7+ (armv7l)
  • os type: linux
  • os arch: arm
  • go version: go1.18.6
  • go linking: static
  • go tags: none

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

Google Drive

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

rclone config

The rclone config contents with secrets removed.

Current remotes:

Name                 Type
====                 ====
gdrive               drive

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> e

Select remote.
Choose a number from below, or type in an existing value.
 1 > gdrive
remote> 1

Editing existing "gdrive" remote with options:
- type: drive
- client_id: paste into raspberry pi console
- client_secret: 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
- scope: drive

Option client_id.
Google Application Client Id
Setting your own is recommended.
See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
If you leave this blank, it will use an internal key which is low performance.
Enter a string value. Press Enter for the default (paste into raspberry pi console).
client_id> 672799602169-2pvbpgve60di8derb8108gso0utbv6as.apps.googleusercontent.com

Option client_secret.
OAuth Client Secret.
Leave blank normally.
Enter a string value. Press Enter for the default (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).
client_secret>

Option scope.
Scope that rclone should use when requesting access from drive.
Choose a number from below, or type in your own string value.
Press Enter for the default (drive).
 1 / Full access all files, excluding Application Data Folder.
   \ (drive)
 2 / Read-only access to file metadata and file contents.
   \ (drive.readonly)
   / Access to files created by rclone only.
 3 | These are visible in the drive website.
   | File authorization is revoked when the user deauthorizes the app.
   \ (drive.file)
   / Allows read and write access to the Application Data folder.
 4 | This is not visible in the drive website.
   \ (drive.appfolder)
   / Allows read-only access to file metadata but
 5 | does not allow any access to read or download file content.
   \ (drive.metadata.readonly)
scope> 1

Option service_account_file.
Service Account Credentials JSON file path.
Leave blank normally.
Needed only if you want use SA instead of interactive login.
Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
Enter a value. Press Enter to leave empty.
service_account_file>

Edit advanced config?
y) Yes
n) No (default)
y/n> n

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

2022/12/17 14:01:28 NOTICE: Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config.
2022/12/17 14:01:28 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=2zDU2i7VsW6Mw5f_q6baBQ
2022/12/17 14:01:28 NOTICE: Log in and authorize rclone for access
2022/12/17 14:01:28 NOTICE: Waiting for code...

A log from the command with the -vv flag

OAuth consent screen

User type
External

App name
my-rclone

Support email
xxxxxxxxxxxxxxxxxxx@gmail.com
App logo
Not provided

Application Homepage link
Not provided

Application Privacy Policy link
Not provided

Application Terms of Service link
Not provided

Authorised domains
Not provided

Contact email addresses
xxxxxxxxxxxxxxxxxxxxx@gmail.com
Scopes
API
Google Drive API

Scope
.../auth/drive

User-facing description
See, edit, create and delete all of your Google Drive files

Test users
1 user (1 test, 0 other) / 100 user cap
Filter
User information
xxxxxxxxxxxxxxxxxxxxxxxxx@gmail.com	


When you set up your client_id at google, you need to put the redirect URL in there

It doesn't actually seem to say that in the instructions which it probably should!

Thank you. I have continued on with limited success using the tutorial mentioned in post 1 as it seems more geared toward a headless application.

I am now using the tutorial from the rclone site but the issue I am presently facing is that I try to open http://127.0.0.1:53682/ and I get a message saying that it refused to connect. I gave it a try in different browsers and also with the firewall turned off but no success. Any idea what's going on with that?

You need to run a browser on the same machine/server/computer that rclone is running on.

If not, you need to follow the remote setup.

Basically, for oAuth, you need a working browser on the same machine you run the rclone config or if remote, the same machine you run rclone authorize.

Thanks for your assistance with this. I'm trying to get it up and running using a browser on the RPi and it all goes well until it tries the open the browser for the oAuth and it comes back with a message saying Access blocked: authorisation error, and a note saying The oAuth client was deleted.

I logged in but couldn't find anything relating to oAuth. Is there something I'm missing here?

Thanks
David

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