Rclone update not allowing concurrent operations

Just a heads up - ever since updating Rclone to 1.61.0, I can’t run concurrent operations. Say if I do a restic mount - I can’t then also do restic snapshots or I’ll get:

rclone: 2022/12/22 13:42:22 Failed to restic: failed to init server: listen tcp 127.0.0.1:8080: bind: address already in use

Fatal: unable to open repository at rclone:spo:restic-db: error talking HTTP to rclone: exit status 1

Have you discussed this on the rclone side as well? Maybe this is something they can look into?

hi, make sure another instance of rclone is not running on that ip:port.

v1.61.0 has changed the library used for http
restic: Refactor to use lib/http

if you post at the rclone forum, can find me @asdffdsa

Not yet. I would think it’s how Restic is calling Rclone, because on Rclone I’d just specify a second port if I was going to do another mount operation. It seems as though they’ve changed how Rclone responds to being called. So I would think that Restic needs to tell Rclone to use another port if an existing port is already used? I have no idea, but it made me assume I might want to post here first to see what I should do next.

So nothing was running at first, but then I did a restic mount, and the new version of Rclone mentions rclone: 2022/12/22 19:37:22 NOTICE: OneDrive root 'restic-db': Serving restic REST API on [http://127.0.0.1:8080/] every time I run a Restic command now.

I just tested by opening two terminals. I did “restic snapshots” on both at the same time. The first one responded:

rclone: 2022/12/22 19:38:11 NOTICE: OneDrive root ‘restic-db’: Serving restic REST API on [http://127.0.0.1:8080/]

And listed the snapshots. The second responded:

rclone: 2022/12/22 19:38:12 Failed to restic: failed to init server: listen tcp 127.0.0.1:8080: bind: address already in use

Fatal: unable to open repository at rclone:spo:restic-db: error talking HTTP to rclone: exit status 1

And failed. This is on a different computer, no “mount” commands running. Just two “restic snapshot” calls.

If you use restic -r rclone:..., restic doesn’t access rclone via http, but starts a rclone serve restic --stdio and communicates via stdin/stdout.
rclone before 1.61 did not try to listen to a port when run with --stdio. I think this may be an effect of the rclone refactor @asdffdsa mentioned - at least rclone seems to work differently when using --stdio.

(A workaround is to manually start rclone serve restic (without --stdio, but maybe setting the adress/port via --addr) and then using the REST backend, see rclone serve restic)

EDIT: The workaround doesn’t work with rclone 1.61 - seems rclone serve restic is broken in 1.61, see the link to the rclone issue below and the references therein!

2 Likes

See rclone serve restic ignores --stdio option and serves via tcp/ip instead · Issue #6646 · rclone/rclone · GitHub

2 Likes

This appears to be fixed as of Rclone v1.61.1 :slight_smile: