rclone / rclone-webui-react

A full fledged UI for the rclone cloud sync tool
MIT License
1.26k stars 161 forks source link

Create Config crash #43

Open cron410 opened 4 years ago

cron410 commented 4 years ago

I have this running inside the rclone/rclone:beta docker image, listening on 0.0.0.0:5572 instead of 127.0.0.1:5572

docker run -it --rm -p 5572:5572 rclone/rclone:beta rcd --rc-web-gui --rc-addr 0.0.0.0:5572 --rc-user=test --rc-pass=test --rc-serve

When creating an rclone config for GDrive from the WebUI, it tries to launch the autoconfig on a local webserver at 127.0.0.1 which does not work in a docker container.

2019/10/31 18:13:37 NOTICE: A new release for gui is present at https://github.com/rclone/rclone-webui-react/releases/download/v0.0.12/currentbuild.zip
2019/10/31 18:13:37 NOTICE: Downloading webgui binary. Please wait. [Size: 4646670, Path :  /root/.cache/rclone/webgui/v0.0.12.zip]
2019/10/31 18:13:37 NOTICE: Unzipping
2019/10/31 18:13:38 NOTICE: Serving remote control on http://[::]:5572/
2019/10/31 18:14:03 NOTICE: Config file "/config/rclone/rclone.conf" not found - using defaults
2019/10/31 18:16:03 NOTICE: Bandwidth limit set to 1G
Remote config
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine
Auto confirm is set: answering Yes, override by setting config parameter config_is_local=false
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=MvVlbj7m7OS-hTSOiRT6Jg
Log in and authorize rclone for access
Waiting for code...
Remote config
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine
Auto confirm is set: answering Yes, override by setting config parameter config_is_local=false
2019/10/31 18:21:23 Failed to configure token: failed to start auth webserver: listen tcp 127.0.0.1:53682: bind: address already in use

We would need a way to have the autoconfig honor the --rc-addr flag or otherwise know how to configure the autoconfig listening address.

ncw commented 4 years ago

failed to start auth webserver: listen tcp 127.0.0.1:53682: bind: address already in use

It looks like your previous attempt at config was still running which is why the bind failed rather than some problem with docker.

Note this message:

Auto confirm is set: answering Yes, override by setting config parameter config_is_local=false

Which means you can set config_is_local=false to answer N to the question and use the remote flow?

Sorry just noticed this was a WebUI issue so the above advice might not be very helpful.

hjyoung1 commented 4 years ago

Facing same issue.

SubrataM3 commented 4 years ago

This is a basic issue and not fixed yet? 👎

devswhiz commented 4 years ago

run this command ip addr flush dev eth0

then restart your server

this works for me

hjyoung1 commented 4 years ago

Any updates on this? @negative0

negative0 commented 4 years ago

Currently, the webui does not handle any of the auth flow, it just waits for the auth to complete,

ideally, we will have to modify this process a bit by allowing rclone to delegate the process of opening the required GDrive or any other endpoint to the webui, so that it can then open the proper url.

Any thoughts @ncw ?

0-0eth0 commented 4 years ago

@negative0 is there any updates on this? i am facing this issue, cant create config properly. it will be great if you add autoconfig option off for headless.

robertolanuti commented 4 years ago

I have tried to connect my google drive account and I can see the following log at the end of the command line procedure (remote / headless machine):

Verify URL: https://accounts.google.com/o/oauth2/auth?accesstype=offline&clientid=xxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com&redirecturi=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&responsetype=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=vksM362XUdfNk5ab9dNeXQ

I'm wondering if we can get that url (from the server side logs) and perform the redirect by the web UI (by the local browser).

In this way we might be able to use the webui tool as well (if I'm not wrong) without changing the normal behaviour. What do you think about something similar?

chiqui3d commented 3 years ago

I'm using docker and I don't understand why it opens another port 53682to check Google Drive, so I can't generate the Google Drive configuration through the panel?

  | 2021-05-01 00:21:41 | stdout | Waiting for code...
-- | -- | -- | --
  | 2021-05-01 00:21:41 | stdout | Log in and authorize rclone for access
  | 2021-05-01 00:21:41 | stdout | If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=hD2QapZGg5EBCAu_WRw8uA
  | 2021-05-01 00:21:41 | stdout | Auto confirm is set: answering Yes, override by setting config parameter config_is_local=false
  | 2021-05-01 00:21:41 | stdout | * Say N if you are working on a remote or headless machine
  | 2021-05-01 00:21:41 | stdout | * Say Y if not sure
  | 2021-05-01 00:21:41 | stdout | Use auto config?
  | 2021-05-01 00:21:41 | stdout | Remote config

Currently I can't access that url, because I only have the default rclone port open 5572 and also with a subdomain, I'm really at a bit of a loss, I don't know what to do.

dillfrescott commented 2 years ago

Having this issue as well

Error: config failed to refresh token: failed to start auth webserver...

On Windows 11.


EDIT: Fixed it with a reboot.

realtebo commented 2 years ago

The problem is due to an already listening rclone instance on the same port.

If happens again, to avoid a reboot, run

netstat -ano | findstr 53682

You will find as last number the pid number of a rclone.exe process already listening on that port

Simply kill this pid.

On windows 10/11 you can open task manager, go into details tab and kill every rclone.exe processes you find.

imthenachoman commented 2 years ago

Is there any update on this? When running the GUI from a Docker container, the auth window never opens.

sayalraza commented 11 months ago

Ideally when the port is busy, rclone should close the 53682 port and start a new listener, right?