Troubleshoot a first sync
The errors people meet on a first sync, what they mean and what to do.
A host added by hand never answers
The sync waits, then stops with one of two messages. When no address was ever published for the ID, which is the usual case for a wrong one:
irsync: ~/Photos: gave up after 5 attempts: the daemon never answered: connecting to 4a29f16a4f80a3fd171ef5573c106dbda470ec24f5a97933752746b567ab9aff: no address found for it. Is this the daemon's EndpointId? On the server, `irsync id show --daemon` prints it (plain `irsync id show` prints the client's). Also check that the daemon is running there.
When an address is known but nothing answers there, for example a daemon that has stopped:
irsync: ~/Photos: gave up after 5 attempts: the daemon never answered: connecting to 4a29f16a4f80a3fd171ef5573c106dbda470ec24f5a97933752746b567ab9aff: timed out; if you added this server's ID by hand, it must be the daemon's EndpointId: on the server, irsync id show --daemon prints it (plain irsync id show prints the client's). Also check that the daemon is running there
The listing, irsync myserver:, ends with the same advice.
Cause. Most often the client was given the server’s client ID instead
of its daemon’s. A server has two keys: plain irsync id show prints the one
it uses as a client; clients must connect to the daemon’s. Nothing answers to
the wrong one, so the client can only wait. The other cause is a daemon that
is not running.
Fix. On the server, print the daemon’s ID:
irsync id show --daemon
On the client, save it under the server’s name, replacing the old one:
irsync server add myserver <daemon-id>
Then check that irsync daemon is running on the server.
A server paired with irsync pair did not answer
The sync’s error ends like this, after what it tried:
irsync: ...; myserver did not answer. On myserver, check that the daemon is running: systemctl --user status irsync (Linux) or launchctl list org.irsync.daemon (macOS). Its log: journalctl --user -u irsync for a systemd service, else ~/.local/state/irsync/daemon.log. To start it again from here: irsync pair myserver
Cause. The daemon is not running or cannot be reached. A sync never uses ssh, so it cannot start the daemon for you.
Fix. Do what the message says. On the server, check the service. Its log is
in journalctl --user -u irsync when a systemd service runs the daemon, and
in ~/.local/state/irsync/daemon.log for the launchd agent on macOS and when
pair started it in the background.
A background daemon does not survive a reboot. To start the daemon again from
the client, run:
irsync pair myserver
On a Mac, the agent starts after a reboot only once someone logs in there.
A sync names a server irsync does not know
irsync: myserver is not a saved server or an EndpointId (saved servers are in ~/.config/irsync/irsync.toml). To set it up over ssh: irsync pair myserver. To add it by hand: irsync server add myserver <daemon-id>
Cause. A sync, push, pull or listing never uses ssh, so it does not set a
server up. myserver is not in your saved servers, or it was mistyped.
Fix. Check the spelling. If the name is right and ssh myserver works, run
irsync pair myserver. Otherwise add the server by hand, as in
Your first sync. A name
saved as a client only gets a similar message: this machine has never dialled
its daemon, so run irsync pair for it.
pair could not reach the daemon over iroh
irsync pair: myserver is set up and saved, but this machine could not reach its daemon over iroh within 30 s. The daemon there is running (home relay https://euc1-1.relay.n0.iroh.link./; direct addresses 192.168.1.5:41641), but the lookups have not found it yet; a daemon that has just started can take a minute to be found. Run `irsync pair myserver` again to check once more; it keeps what was set up.
Cause. The server is set up and its daemon runs, but this machine cannot
find it the way a sync looks for it. Right after the daemon started, the
lookups may not know it yet, above all when only the DHT looks it up
(--no-dns, or dns = false on this machine). Or something between the two machines
blocks iroh: a firewall that drops UDP, or no route to a relay. When the
message says the daemon reported no relay and no direct address, the
daemon itself is not on the network: read the log it names.
Fix. Wait a minute and run irsync pair myserver again. It sets nothing
up twice and only checks once more. If it still fails, see
Connect directly or through a relay. To check one path,
pass it to the check: irsync pair --address 192.168.1.5:41641 myserver
dials that address only.
pair stops: the server runs another OS or CPU
irsync: pairing with myserver over ssh
irsync: pairing with myserver over ssh failed: myserver runs linux aarch64, this irsync is macos aarch64 and a development build (0.1.0-beta.1 (1a2b3c4, dirty)). Only release builds install on another OS or CPU. Install irsync on both machines and set the server up by hand: https://irsync.org/book/tutorial/first-sync#set-the-server-up-by-hand
Cause. When the server’s OS or CPU differs from the client’s, irsync pair
installs the release binary of the client’s own version. That needs a
client that is itself a release: a build from source has no matching release
binary. The same stop, worded “there is no release binary for that
platform”, comes for a server no release is built for, such as an Intel Mac.
Fix. Use a released irsync on the client
(Install), or install irsync on the server
yourself and
set the server up by hand.
Installing it on the server does not make pair work, unless you run
with --no-ssh-install: pair otherwise uses its own copy of the client’s
exact build.
Other messages from this step:
need curl or wget on this machine to download the release binary, ortar failed (it must be able to read .xz): the client downloads and unpacks the release itself. Install the missing tool on the client.could not download …: the client could not reach GitHub. Check the network and run again.GitHub answered with an error for …: either GitHub is having trouble (run again later), or there is no release with the client’s version number, which means the client is a development build. Then use a released irsync.release v… is not this build: the client is a development build that carries a release’s version number. Use a released irsync.the release binary for … does not run on myserver: the server could not run the binary, for example because its home directory is mountednoexec. Install irsync on the server yourself and set it up by hand.the download of … is damaged (SHA-256 does not match): run again.the release … has no signature for sha256.sum, or GitHub answered with an error: run again later, in case GitHub had a problem. If the message stays, or it isthe release … failed the signature check, the release on GitHub is not signed the way this irsync expects, so it refuses to use it. Report it on GitHub Issues, and set the server up by hand meanwhile. If you built irsync yourself, this is expected: only release builds install on another OS or CPU.
Nothing on the server is changed in any of these cases.
pair says there are no release files for this build
irsync: downloading irsync v0.1.0-beta.1 for macos aarch64
irsync: no release files for this build (could not download release v0.1.0-beta.1: …); installing this machine's own files
This is a notice, not an error. The server has the same OS and CPU as the
client, so when the download fails, or the release is another build,
pair sends the client’s own files instead. pair goes on. fileset and
the manual pages come along only if they sit beside the client’s irsync;
the summary says when they did not.
pair stops on the server
These stop pair after the files reached the server:
could not unpack irsync on myserver (it needs tar and a writable home directory). Nothing was changed there.: the server has notar, orpaircannot write its work directory in your home there. Installtar, or check that you own your home directory and can write to it, then run again.the installer failed on myserver; see its message above: the installer script ran on the server and stopped. Its own message, printed just before, says why, for example a~/.local/binyou cannot write to. Fix that and run again.
pair stops: –no-ssh-install
irsync: pairing with myserver over ssh failed: --no-ssh-install: myserver has no irsync 0.1.0-beta.1 (ae5ebe5) at ~/.local/bin/irsync (found none). Install that version there, or run without --no-ssh-install (or set ssh_install = true in the config). Nothing was changed.
Cause. With --no-ssh-install, or ssh_install = false in the config file,
pair copies nothing. It needs the client’s exact build at
~/.local/bin/irsync on the server, and found another version there
(found irsync …) or none.
Fix. Install the same version as the client on the server, in
~/.local/bin. Or let pair install it: run without --no-ssh-install, and
remove ssh_install = false from the config file if it is there.
The daemon rejected this client’s key
irsync: the daemon rejected this client's key: no access to myserver:photos/. On the daemon's machine, irsync grant list a3e4753e5ea74e64e745e9c4d10b0fd751dbe03049d742eb0ea545c89703dfba shows what this key may reach; irsync grant add EXPORT a3e4753e5ea74e64e745e9c4d10b0fd751dbe03049d742eb0ea545c89703dfba grants an export, irsync export add NAME:PATH exports a directory (irsync id show prints this id)
Cause. The daemon answered, but no grant lets this client reach that path: the client was never granted an export, the path lies outside every export it may use, or a grant was removed.
Fix. On the server, grant the export to the client’s ID, which the message names:
irsync grant add photos <client-id>
irsync pair does not fix this. Pairing again never changes the grants a client has lost. The refusal
is on purpose, and irsync never adds back an all_paths you removed. See
Identity and trust.
The transfer is slow and says relay
The live block (--progress), and the summary line at the end of each session (-vv), name the
path the connection took: direct or relay. See
Connect directly or through a relay.
Cause. The two machines could not reach each other directly (hole punching failed, often when both sit behind strict NATs), so the data goes through a relay server. Relays are a fallback and much slower than a direct path.
Fix. Connections explains when hole punching fails. When the connection has to stay on a relay, run your own relay close to both machines.
Tune the kernel for long-distance links
A sync starts with a warning like this, about the client, the server or both:
irsync: warning: the kernel on myserver limits UDP buffers to 208 KiB; irsync asks for 7 MiB.
irsync: warning: On a link with a long round trip, such as across an ocean, that loses packets and slows the sync down. To fix it on myserver:
irsync: warning: sudo sysctl -w net.core.rmem_max=16777216 net.core.wmem_max=16777216
irsync: warning: then restart the daemon there: systemctl --user restart irsync
irsync: warning: see "Tune the kernel for long-distance links" in the manual
The daemon logs the same at startup, about its own machine.
Cause. irsync sends over UDP. Each of its sockets asks the kernel for a 7 MiB buffer, but the kernel gives no more than its limit, and Linux’s default limit is 208 KiB. The buffer has to hold everything sent but not yet acknowledged. That is about the transfer rate times the round trip: 20 MB/s over a 143 ms round trip is about 3 MB. So the round trip matters more than the speed. With a small buffer, the receiver drops packets, and the sync slows down to make up for them. On one link from California to Europe, a 2.5 GB push took 9 minutes 47 seconds with the default limit and 3 minutes 12 seconds with the limit raised.
Fix. Raise the limit on the machine the warning names. On Linux:
sudo sysctl -w net.core.rmem_max=16777216 net.core.wmem_max=16777216
On macOS and FreeBSD:
sudo sysctl -w kern.ipc.maxsockbuf=16777216
A socket keeps the size it got when it was made. A sync makes new ones each
time, but a daemon makes its own when it starts, so restart the daemon after
raising its limit. On Linux, under the user service irsync pair set up:
systemctl --user restart irsync
Anywhere, SIGHUP does it too: the daemon reloads and binds new sockets.
kill -HUP $(pgrep -f 'irsync daemon')
irsync pair is no fix here: it leaves a running daemon of the same version
alone.
sysctl -w lasts until the next reboot. To keep the setting, write it to a
file. On Linux, put these two lines in /etc/sysctl.d/90-irsync.conf and
run sudo sysctl --system:
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
On macOS and FreeBSD, add kern.ipc.maxsockbuf=16777216 to
/etc/sysctl.conf.