What is the problem you are having with rclone?
I have a local server that uses mDNS to publish its hostname as han.local
. After I configure rclone to use it (config below), and run rclone ls Han:/
, I get:
~ • rclone ls Han:/
2023/02/28 22:41:55 Failed to create file system for "Han:/": NewFs: couldn't connect SSH: dial tcp: lookup han.local on 127.0.0.53:53: server misbehaving
Regular old SSH (and SFTP) works fine:
~ • ssh han.local
Linux han 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l
The programs included with the Debian GNU/Linux system are free software;
[etc]
Avahi resolves it fine:
~ • avahi-resolve --name -4 han.local
han.local 192.168.1.101
Ping resolves it fine:
~ • ping han.local
PING han.local (192.168.1.101) 56(84) bytes of data.
64 bytes from han (192.168.1.101): icmp_seq=1 ttl=64 time=1.30 ms
Dig is not happy, but that's by design (note the warning):
~ • dig @127.0.0.53 han.local
; <<>> DiG 9.18.4-2ubuntu2.1-Ubuntu <<>> @127.0.0.53 han.local
; (1 server found)
;; global options: +cmd
;; Got answer:
;; WARNING: .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 43167
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;han.local. IN A
;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Tue Feb 28 23:21:38 AWST 2023
;; MSG SIZE rcvd: 38
/etc/resolv.conf
points to systemd's stub resolver:
~ • file /etc/resolv.conf
/etc/resolv.conf: symbolic link to /run/systemd/resolve/stub-resolv.conf
The non-comment contents are:
nameserver 127.0.0.53
options edns0 trust-ad
search .
Side question: how does rclone "know" to use 127.0.0.53
but without seeming to use the system resolver?
Run the command 'rclone version' and share the full output of the command.
~ • rclone version
rclone v1.61.1
- os/version: ubuntu 22.10 (64 bit)
- os/kernel: 5.19.0-31-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.19.4
- go/linking: static
- go/tags: none
Downloaded using the curl installation instructions. It is installed to a user directory, not /usr/bin
.
Which cloud storage system are you using? (eg Google Drive)
For this question, SFTP. Rclone on this machine works with Nextcloud, Drive and Backblaze B2 as well, though.
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
~ • rclone ls Han:/
2023/02/28 22:41:55 Failed to create file system for "Han:/": NewFs: couldn't connect SSH: dial tcp: lookup han.local on 127.0.0.53:53: server misbehaving
The rclone config contents with secrets removed.
[Nextcloud]
type = webdav
url = https://[redacted]/
vendor = nextcloud
user = [redacted]
pass = [redacted]
[Drive]
type = drive
client_id = [redacted]
client_secret = [redacted]
scope = drive
token = [redacted]
team_drive =
[Backblaze]
type = b2
account = [redacted]
key = [redacted]
[Han]
type = sftp
host = han.local
user = jason
pubkey_file = ~/.ssh/id_rsa.pub
key_use_agent = true
A log from the command with the -vv
flag
2023/02/28 23:35:31 DEBUG : rclone: Version "v1.61.1" starting with parameters ["rclone" "-vv" "ls" "Han:/"]
2023/02/28 23:35:31 DEBUG : Creating backend with remote "Han:/"
2023/02/28 23:35:31 DEBUG : Using config file from "/home/jason/.config/rclone/rclone.conf"
2023/02/28 23:35:31 DEBUG : pacer: low level retry 1/10 (error couldn't connect SSH: dial tcp: lookup han.local on 127.0.0.53:53: server misbehaving)
2023/02/28 23:35:31 DEBUG : pacer: Rate limited, increasing sleep to 200ms
2023/02/28 23:35:31 DEBUG : pacer: low level retry 2/10 (error couldn't connect SSH: dial tcp: lookup han.local on 127.0.0.53:53: server misbehaving)
2023/02/28 23:35:31 DEBUG : pacer: Rate limited, increasing sleep to 400ms
2023/02/28 23:35:31 DEBUG : pacer: low level retry 3/10 (error couldn't connect SSH: dial tcp: lookup han.local on 127.0.0.53:53: server misbehaving)
2023/02/28 23:35:31 DEBUG : pacer: Rate limited, increasing sleep to 800ms
2023/02/28 23:35:32 DEBUG : pacer: low level retry 4/10 (error couldn't connect SSH: dial tcp: lookup han.local on 127.0.0.53:53: server misbehaving)
2023/02/28 23:35:32 DEBUG : pacer: Rate limited, increasing sleep to 1.6s
2023/02/28 23:35:33 DEBUG : pacer: low level retry 5/10 (error couldn't connect SSH: dial tcp: lookup han.local on 127.0.0.53:53: server misbehaving)
2023/02/28 23:35:33 DEBUG : pacer: Rate limited, increasing sleep to 2s
2023/02/28 23:35:34 DEBUG : pacer: low level retry 6/10 (error couldn't connect SSH: dial tcp: lookup han.local on 127.0.0.53:53: server misbehaving)
2023/02/28 23:35:36 DEBUG : pacer: low level retry 7/10 (error couldn't connect SSH: dial tcp: lookup han.local on 127.0.0.53:53: server misbehaving)
2023/02/28 23:35:38 DEBUG : pacer: low level retry 8/10 (error couldn't connect SSH: dial tcp: lookup han.local on 127.0.0.53:53: server misbehaving)
2023/02/28 23:35:40 DEBUG : pacer: low level retry 9/10 (error couldn't connect SSH: dial tcp: lookup han.local on 127.0.0.53:53: server misbehaving)
2023/02/28 23:35:42 DEBUG : pacer: low level retry 10/10 (error couldn't connect SSH: dial tcp: lookup han.local on 127.0.0.53:53: server misbehaving)
2023/02/28 23:35:42 Failed to create file system for "Han:/": NewFs: couldn't connect SSH: dial tcp: lookup han.local on 127.0.0.53:53: server misbehaving
Other information
Running this on Ubuntu 22.10.
I had a good search for this issue, but surprisingly, did not find a lot of information about rclone interacting with mDNS. Probably because it's designed for cloud services, but in this case, I want to use it to synchronise files from a cloud service to a local SFTP server.
I also spent a... long... time trying to switch from Avahi to systemd's own mDNS resolver, in case that helped. It was beyond me. So I have not done that test yet.