You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tailscale disconnectivity with unexpected error "log derp-1 does not know about peer" #11565
changed the title [-]Tailscale disconnectivity and unexpected error log derp-1 does not know about peer[/-][+]Tailscale disconnectivity with unexpected error "log derp-1 does not know about peer"[/+]on Mar 29, 2024
reason i am asking is i used to annoy @bradfitz with issue #9525 and eventually gave up (same happens in docker btw) but what i recall is random nodes dropping out, being reachable by some nodes but not others and completely random stuff and just coming back etc. same like you AND i had the same "does not know about peer removing route" error msgs related to exactly these nodes. these were nodes that had direct connections, no firewall etc. one thing though they had ipv6 enabled on the system but no ipv6 connectivity / ips setup. in case any of this helps
This happened to us last night, leaving one node unreachable for about 8 hours.
May 23 00:25:01 arctic tailscaled[1357248]: [RATELIMIT] format("[unexpected] magicsock: derp-%d does not know about peer %s, removing route") (6 dropped)
May 23 00:25:01 arctic tailscaled[1357248]: [unexpected] magicsock: derp-2 does not know about peer [a/xh6], removing route
May 23 00:25:01 arctic tailscaled[1357248]: [unexpected] magicsock: derp-5 does not know about peer [RSzNP], removing route
May 23 00:25:01 arctic tailscaled[1357248]: [RATELIMIT] format("[unexpected] magicsock: derp-%d does not know about peer %s, removing route")
May 23 00:25:04 arctic tailscaled[1357248]: Accept: TCP{100.93.147.151:51229 > 100.99.58.27:22} 52 tcp non-syn
May 23 00:25:11 arctic tailscaled[1357248]: [RATELIMIT] format("[unexpected] magicsock: derp-%d does not know about peer %s, removing route") (7 dropped)
May 23 00:25:11 arctic tailscaled[1357248]: [unexpected] magicsock: derp-2 does not know about peer [a/xh6], removing route
May 23 00:25:11 arctic tailscaled[1357248]: [unexpected] magicsock: derp-11 does not know about peer [6ApL1], removing route
May 23 00:25:11 arctic tailscaled[1357248]: [RATELIMIT] format("[unexpected] magicsock: derp-%d does not know about peer %s, removing route")
May 23 00:25:14 arctic tailscaled[1357248]: Accept: TCP{100.99.58.27:22 > 100.103.86.100:59090} 144 ok out
❯ tailscale --version
1.66.4
tailscale commit: 067defc641850791142cc83a44dadae29709344a
other commit: 49481b7d0a74595aec90f60e4d9b784ed0036281
go version: go1.22.3
In both cases, node A is running a tailscale ping -c 1000 B
When I do a tailscale ping A, from node B, the running ping from A finds a direct connection. It works for a while, but the connection is lost after a while of being idle.
When I disable IPv6 on node A, the running ping from A gets a couple of derp ping responses, and then finds a direct connection. This keeps stable so that after some idle time a fresh tailscale ping again gets a couple of derp responses and then a direct connection.
Node B only has an IPv4 address, node A has both initially.
I think this is related to relay servers. I have two machines, local near the SEA relay and remote near the ORD relay. I was getting this error trying to connect to my machine near ORD over Tailscale, but I could SSH into its public address, and `ssh back into my laptop over Tailscale just fine. That asymmetry is weird, which means there's probably a clue.
If anyone is monitoring the log to restart tailscaled as a workaround, the error message no longer has [unexpected] in it as of commit a00623e. While I would love to take this to mean that the bug is now fixed, I can't really risk testing it on my own network, so if anyone else finds the bug no longer exists, let us know. I believe the latest tailscale client has some improvements in the area of DERP.
I also have a few improvements on the systemd unit and script that @expoli posted above. Namely, it no longer Requires= tailscaled, but just uses After= so that the monitor stays up even while tailscaled restarts. It also uses a different looping mechanism that avoids catching rapid multiples of the same error message - triggering multiple restarts:
tailscaled-monitor.service:
[Unit]
Description=Handle various bugs in tailscale (such as DERP bug here https://github.com/tailscale/tailscale/issues/11565) by monitoring tailscaled logs, looking for failures, and restarting the appropriate service
After=network.target tailscaled.service
[Service]
ExecStart=/bin/bash /usr/bin/tailscaled-monitor.sh
Restart=always
User=root
StandardOutput=journal
StandardError=journal
TimeoutSec=0
RestartSec=60s
[Install]
WantedBy=multi-user.target
tailscaled-monitor.sh:
#!/bin/bash
logger -t tailscaled-monitor -p user.info "Monitoring tailscaled logs..."whiletrue;do# Follow journal for tailscaled, ignoring any old lines
journalctl --follow --lines=0 -u tailscaled.service |whileread line;doifecho"$line"| grep -q "magicsock: derp-[0-9]* does not know about peer";then
logger -t tailscaled-monitor -p user.info "DERP Bug detected. Restarting tailscaled..."echo"restarted tailscaled"
systemctl restart tailscaled
# give the service a chance to restart
sleep 10
# break out of inner loop to discard any additional logs and start listening freshbreakfidonedone
I also have a few improvements on the systemd unit and script that @expoli posted above. Namely, it no longer Requires= tailscaled, but just uses After= so that the monitor stays up even while tailscaled restarts. It also uses a different looping mechanism that avoids catching rapid multiples of the same error message - triggering multiple restarts:
tailscaled-monitor.service:
[Unit]
Description=Handle various bugs in tailscale (such as DERP bug here https://github.com/tailscale/tailscale/issues/11565) by monitoring tailscaled logs, looking for failures, and restarting the appropriate service
After=network.target tailscaled.service
[Service]
ExecStart=/bin/bash /usr/bin/tailscaled-monitor.sh
Restart=always
User=root
StandardOutput=journal
StandardError=journal
TimeoutSec=0
RestartSec=60s
[Install]
WantedBy=multi-user.target
# Follow journal for tailscaled, ignoring any old lines
journalctl --follow --lines=0 -u tailscaled.service | while read line; do
if echo "$line" | grep -q "magicsock: derp-[0-9]* does not know about peer"; then
logger -t tailscaled-monitor -p user.info "DERP Bug detected. Restarting tailscaled..."
echo "restarted tailscaled"
systemctl restart tailscaled
# give the service a chance to restart
sleep 10
# break out of inner loop to discard any additional logs and start listening fresh
break
fi
done
The original tailscale-derper tool added the validation mechanism of the SSL certificate, which made the self-signed certificate unusable, and the following validation mechanism was turned off to make the Derper tool run normally.
The image integrates the automatic certificate generator and automatically generates the SSL self-signed certificate of the corresponding configured domain name according to the CMD parameters in the Dokcerfile, and the default CMD parameters are:
You can control the working behavior of the derper through environment variables.
By default, four environment variables are received, and the specific names and functions are as follows.
DOMAIN_NAME[dafault:derper.example.com]
You should modify this environment variable according to your own needs, notice it is a self-signed SSL certificate.
The default storage location for certificates is /opt/ssl/ You can pass in the certificates you need as needed.
Self-signed IP address certificates are supported.
DERPER_PORT[default:443]
The port that derper runs on, you can modify it according to your needs.
COMMAND_LINE
For additional derper argument commands, you should enter the derper command arguments as they are, and multiple arguments should be included in double quotes.
ADVANCED_MODE[default:false]
SSL certificates are not automatically generated in advanced mode, and you need to manually specify all the Derper run parameters explicitly in command_line
I was using multiple nodes in my Derp config and recently read somewhere in the Tailscale docs that you can only have one node per region (for some reason I'm unable to find now where I read it). So I changed my config from
It has been working without any issue and without that error message for almost a week now, by far the longest I've ever seen. Maybe that was the core issue here?
Over in #15389 I noted that I'm seeing this issue as well, but the logspam itself appears to be "normal" and occurs when the system attempts to open a connection to a Tailscale peer that's offline.
#!/bin/sh
logger -s -t tailscaled-monitor "Monitoring tailscaled logs..."whiletrue;do# Follow journal for tailscaled, ignoring any old lines
logread -f -e tailscaled |whileread line;doifecho"$line"| grep -q "magicsock: derp-[0-9]* does not know about peer";then
logger -s -t tailscaled-monitor "DERP Bug detected. Restarting tailscaled..."
/etc/init.d/tailscale restart
logger -s -t tailscaled-monitor "tailscaled restarted."# give the service a chance to restart
sleep 10
# break out of inner loop to discard any additional logs and start listening freshbreakfidonedone
I am having this issue too. For me it happens when a program is trying to repeatedly connect to a node that is offline. (in my case HA openrgb trying to connect to my pc)
Thought I'd add to this as well, my log is getting absolutely hammered by tailscaled with the same message, also correlated with connectivity issues but the log spam hasn't stopped this time after connectivity came back
tailscaled[2783990] magicsock: derp-8 does not know about peer [1D7Yx], removing route over and over and over and over again
Adding a macOS/Linux observation that resembles the reverse-direction ping recovery described in this earlier comment. I have not established that the underlying cause is the same.
On 2026-10-02, approximately 16:35–16:42 UTC, a Mac could not reach one Linux peer, although both reported Online: true and BackendState: Running. Default tailscale ping, tailscale ping --tsmp, TCP/22, and TCP/6768 all timed out. The same Mac could reach another tailnet peer. Linux remained accessible over its LAN through an SSH jump host, and tailscaled was running.
During the failure, these independently collected status snapshots disagreed about the Linux peer's relay:
Mac's view of Linux: Relay: "tok", CurAddr: ""; transmit bytes increased while receive bytes stayed unchanged.
Linux's own status: Self.Relay: "sin". Its journal showed an active derp-3 connection and that it had changed home DERP from Tokyo to Singapore earlier, at 15:49:10 UTC.
Mac repeatedly logged derp-7 does not know about peer [LINUX_PEER], removing route.
Selected log excerpts below have timestamps normalized to UTC and identifiers/addresses redacted:
Linux 2026-10-02T15:49:10Z magicsock: home is now derp-3 (sin)
Linux 2026-10-02T16:31:26Z magicsock: closing connection to derp-7 (idle), age 1h25m2s
Linux 2026-10-02T16:31:26Z magicsock: 1 active derp conns: derp-3=cr42m0s,wr42m0s
Mac 2026-10-02T16:35:22Z magicsock: derp-7 does not know about peer [LINUX_PEER], removing route
Mac 2026-10-02T16:39:39Z open-conn-track: timeout opening (TCP <MAC_TS_IP>:49377 => <LINUX_TS_IP>:22) to node [LINUX_PEER]; online=yes, lastRecv=4m24s
Mac 2026-10-02T16:40:19Z magicsock: derp-7 does not know about peer [LINUX_PEER], removing route
Via the LAN SSH connection, I ran tailscale ping --c 2 --timeout=3s <MAC_TS_IP>on Linux. It succeeded over a direct public IPv4 endpoint. Immediately afterward, Mac-to-Linux ping also succeeded directly (18–27 ms on subsequent probes), and the application WebSocket handshake succeeded. The desktop application subsequently worked again. Neither Tailscale nor the application service was restarted; no configuration was changed.
Expected: reachable online peers should establish or recover connectivity without an out-of-band login to initiate traffic in the opposite direction. The relay discrepancy is an observation, not a confirmed root cause; I cannot distinguish stale discovery/control information from another path-establishment problem with the evidence collected.
Steps to reproduce
I do not have a deterministic reproducer. The observed diagnostic/recovery sequence was:
During the outage, run default and TSMP tailscale ping from Mac to Linux; both time out. Direct TCP connection attempts to ports 22 and 6768 also time out.
Collect tailscale status --json on both nodes, using an independent LAN SSH path for Linux; observe the relay discrepancy above.
From Linux, run tailscale ping <MAC_TS_IP>.
Recheck from Mac: direct connectivity and the application connection recover without restarting services.
Are there any recent changes that introduced the issue?
The initiating event is unknown. The Linux home-DERP change preceded the observed outage by about 46 minutes, so I am not assuming it immediately triggered the outage. These versions have not been upgraded or tested against the latest release as part of this investigation.
OS
macOS, Linux
OS version
macOS 15.7.3 (24G419), Apple Silicon, Tailscale system-extension client.
Rocky Linux 9.5, kernel 5.14.0-503.14.1.el9_5.x86_64; host-level tailscaled managed by systemd, not containerized.
Tailscale version
Mac: 1.96.5-t4ee448d3a-g74ffbefc2
Linux: 1.96.4-t8cf541dfd-g62bc84ce7
Other software
Both hosts use Wi-Fi on separate LANs. Linux also has Docker networks. Linux Tailscale health reported the SELinux/Tailscale SSH warning, but the observed failure also affected default/TSMP ping and the application port. Mac tailscale netcheck reported UDP available, IPv4 available, no IPv6 connectivity, and MappingVariesByDestIP: false; it could reach Tokyo DERP. HTTP probes explicitly bypassed proxies. I have not audited the full firewall configuration.
Bug report
These markers were generated after recovery, around 17:27 UTC, about 45 minutes after the outage. No bugreport marker was captured while the failure was active. The incident window to investigate is 2026-10-02 16:35–16:42 UTC; the earlier Linux DERP change was at 15:49:10 UTC.
Activity
[-]Tailscale disconnectivity and unexpected error log derp-1 does not know about peer[/-][+]Tailscale disconnectivity with unexpected error "log derp-1 does not know about peer"[/+]alexl4321 commentedon Mar 30, 2024
are you running custom derps maybe inside docker or lxd by any chance?
suyuee commentedon Mar 30, 2024
@alexl4321 no, we are not running custom derp or any customization, all default ones provided by tailscale
alexl4321 commentedon Mar 30, 2024
reason i am asking is i used to annoy @bradfitz with issue #9525 and eventually gave up (same happens in docker btw) but what i recall is random nodes dropping out, being reachable by some nodes but not others and completely random stuff and just coming back etc. same like you AND i had the same "does not know about peer removing route" error msgs related to exactly these nodes. these were nodes that had direct connections, no firewall etc. one thing though they had ipv6 enabled on the system but no ipv6 connectivity / ips setup. in case any of this helps
kelivel commentedon Apr 26, 2024
Hi @suyuee, I see you're running version 1.52.1. Are you still seeing this behavior on the latest Tailscale version?
lukehsiao commentedon May 24, 2024
This happened to us last night, leaving one node unreachable for about 8 hours.
27 remaining items
daniellandau commentedon Feb 17, 2025
I found two behaviours:
In both cases, node A is running a
tailscale ping -c 1000 BWhen I do a
tailscale ping A, from node B, the running ping from A finds a direct connection. It works for a while, but the connection is lost after a while of being idle.When I disable IPv6 on node A, the running ping from A gets a couple of derp ping responses, and then finds a direct connection. This keeps stable so that after some idle time a fresh
tailscale pingagain gets a couple of derp responses and then a direct connection.Node B only has an IPv4 address, node A has both initially.
tidux commentedon Mar 26, 2025
I think this is related to relay servers. I have two machines, local near the SEA relay and remote near the ORD relay. I was getting this error trying to connect to my machine near ORD over Tailscale, but I could SSH into its public address, and `ssh back into my laptop over Tailscale just fine. That asymmetry is weird, which means there's probably a clue.
andreyrd commentedon Mar 31, 2025
If anyone is monitoring the log to restart tailscaled as a workaround, the error message no longer has
[unexpected]in it as of commit a00623e. While I would love to take this to mean that the bug is now fixed, I can't really risk testing it on my own network, so if anyone else finds the bug no longer exists, let us know. I believe the latest tailscale client has some improvements in the area of DERP.andreyrd commentedon Mar 31, 2025
I also have a few improvements on the systemd unit and script that @expoli posted above. Namely, it no longer Requires= tailscaled, but just uses After= so that the monitor stays up even while tailscaled restarts. It also uses a different looping mechanism that avoids catching rapid multiples of the same error message - triggering multiple restarts:
tailscaled-monitor.service:
tailscaled-monitor.sh:
expoli commentedon Mar 31, 2025
nice !
expoli commentedon Mar 31, 2025
I also create a tailscale derp build docker image, the repo url is https://github.com/expoli/tailscale-derper
The original tailscale-derper tool added the validation mechanism of the SSL certificate, which made the self-signed certificate unusable, and the following validation mechanism was turned off to make the Derper tool run normally.
https://github.com/tailscale/tailscale/blob/main/cmd/derper/cert.go
The image integrates the automatic certificate generator and automatically generates the SSL self-signed certificate of the corresponding configured domain name according to the CMD parameters in the Dokcerfile, and the default CMD parameters are:
You can control the working behavior of the derper through environment variables.
By default, four environment variables are received, and the specific names and functions are as follows.
DOMAIN_NAME[dafault:derper.example.com]DERPER_PORT[default:443]COMMAND_LINEADVANCED_MODE[default:false]example docker run command⌘
BackendButters commentedon Apr 18, 2025
I was using multiple nodes in my Derp config and recently read somewhere in the Tailscale docs that you can only have one node per region (for some reason I'm unable to find now where I read it). So I changed my config from
to
It has been working without any issue and without that error message for almost a week now, by far the longest I've ever seen. Maybe that was the core issue here?
luckman212 commentedon Jul 6, 2025
Over in #15389 I noted that I'm seeing this issue as well, but the logspam itself appears to be "normal" and occurs when the system attempts to open a connection to a Tailscale peer that's offline.
rasa commentedon Jul 15, 2025
Here's a version for OpenWRT:
electricsteve commentedon Nov 25, 2025
I am having this issue too. For me it happens when a program is trying to repeatedly connect to a node that is offline. (in my case HA openrgb trying to connect to my pc)
edrumm commentedon May 22, 2026
Thought I'd add to this as well, my log is getting absolutely hammered by tailscaled with the same message, also correlated with connectivity issues but the log spam hasn't stopped this time after connectivity came back
tailscaled[2783990] magicsock: derp-8 does not know about peer [1D7Yx], removing routeover and over and over and over again(1.98.3 / go1.26.3)
zuavra commentedon Jun 11, 2026
I also have this, on 1.98.4:
magicsock: derp-26 does not know about peer [25vNr], removing routeI'm also seeing #19852 .
jae-heo commentedon Oct 2, 2026
What is the issue?
Adding a macOS/Linux observation that resembles the reverse-direction ping recovery described in this earlier comment. I have not established that the underlying cause is the same.
On 2026-10-02, approximately 16:35–16:42 UTC, a Mac could not reach one Linux peer, although both reported
Online: trueandBackendState: Running. Defaulttailscale ping,tailscale ping --tsmp, TCP/22, and TCP/6768 all timed out. The same Mac could reach another tailnet peer. Linux remained accessible over its LAN through an SSH jump host, andtailscaledwas running.During the failure, these independently collected status snapshots disagreed about the Linux peer's relay:
Relay: "tok",CurAddr: ""; transmit bytes increased while receive bytes stayed unchanged.Self.Relay: "sin". Its journal showed an activederp-3connection and that it had changed home DERP from Tokyo to Singapore earlier, at 15:49:10 UTC.derp-7 does not know about peer [LINUX_PEER], removing route.Selected log excerpts below have timestamps normalized to UTC and identifiers/addresses redacted:
Via the LAN SSH connection, I ran
tailscale ping --c 2 --timeout=3s <MAC_TS_IP>on Linux. It succeeded over a direct public IPv4 endpoint. Immediately afterward, Mac-to-Linux ping also succeeded directly (18–27 ms on subsequent probes), and the application WebSocket handshake succeeded. The desktop application subsequently worked again. Neither Tailscale nor the application service was restarted; no configuration was changed.Expected: reachable online peers should establish or recover connectivity without an out-of-band login to initiate traffic in the opposite direction. The relay discrepancy is an observation, not a confirmed root cause; I cannot distinguish stale discovery/control information from another path-establishment problem with the evidence collected.
Steps to reproduce
I do not have a deterministic reproducer. The observed diagnostic/recovery sequence was:
tailscale pingfrom Mac to Linux; both time out. Direct TCP connection attempts to ports 22 and 6768 also time out.tailscale status --jsonon both nodes, using an independent LAN SSH path for Linux; observe the relay discrepancy above.tailscale ping <MAC_TS_IP>.Are there any recent changes that introduced the issue?
The initiating event is unknown. The Linux home-DERP change preceded the observed outage by about 46 minutes, so I am not assuming it immediately triggered the outage. These versions have not been upgraded or tested against the latest release as part of this investigation.
OS
macOS, Linux
OS version
5.14.0-503.14.1.el9_5.x86_64; host-leveltailscaledmanaged by systemd, not containerized.Tailscale version
1.96.5-t4ee448d3a-g74ffbefc21.96.4-t8cf541dfd-g62bc84ce7Other software
Both hosts use Wi-Fi on separate LANs. Linux also has Docker networks. Linux Tailscale health reported the SELinux/Tailscale SSH warning, but the observed failure also affected default/TSMP ping and the application port. Mac
tailscale netcheckreported UDP available, IPv4 available, no IPv6 connectivity, andMappingVariesByDestIP: false; it could reach Tokyo DERP. HTTP probes explicitly bypassed proxies. I have not audited the full firewall configuration.Bug report
These markers were generated after recovery, around 17:27 UTC, about 45 minutes after the outage. No bugreport marker was captured while the failure was active. The incident window to investigate is 2026-10-02 16:35–16:42 UTC; the earlier Linux DERP change was at 15:49:10 UTC.
BUG-2c31ef74444b8467726c20176a684e3d7e4fe2828650e9795bd1473ef98c4fc2-20261002172651Z-238c694c5e05ba19BUG-fbb80ef066dd2b30d3e81ac18fed9fe1d330167636055fbe2eb7e9acd64091f4-20261002172659Z-5d3464be1493cdf0