Skip to content

Tailscale disconnectivity with unexpected error "log derp-1 does not know about peer" #11565

Open

Description

@suyuee

What is the issue?

  • it spreads across two of our clusters with very different sizes (~10 vs ~100+)
  • when it happens, the problematic node can't access some of the peers and can access some others
  • when the log stops, connections are resumed
  • it suddenly started from yesterday (with no change on our end) and become quite frequent today
Mar 29 21:53:32 146-235-225-157 tailscaled[1754]: [RATELIMIT] format("open-conn-track: timeout opening %v to node %v; online=%v, lastRecv=%v")
Mar 29 21:53:33 146-235-225-157 tailscaled[1754]: [unexpected] magicsock: derp-1 does not know about peer [R68An], removing route
Mar 29 21:53:34 146-235-225-157 tailscaled[1754]: Accept: TCP{100.93.234.70:54682 > 10.0.80.89:10250} 92 tcp non-syn
Mar 29 21:53:38 146-235-225-157 tailscaled[1754]: [unexpected] magicsock: derp-1 does not know about peer [R68An], removing route
Mar 29 21:53:43 146-235-225-157 tailscaled[1754]: [RATELIMIT] format("open-conn-track: timeout opening %v to node %v; online=%v, lastRecv=%v") (31 dropped)
Mar 29 21:53:43 146-235-225-157 tailscaled[1754]: open-conn-track: timeout opening (TCP 100.79.193.119:46489 => 10.0.42.131:443) to node [R68An]; online=no, lastseen=1248h33m43s, lastRecv=never
Mar 29 21:53:43 146-235-225-157 tailscaled[1754]: [RATELIMIT] format("open-conn-track: timeout opening %v to node %v; online=%v, lastRecv=%v")
Mar 29 21:53:43 146-235-225-157 tailscaled[1754]: [unexpected] magicsock: derp-1 does not know about peer [R68An], removing route
Mar 29 21:53:48 146-235-225-157 tailscaled[1754]: [unexpected] magicsock: derp-1 does not know about peer [R68An], removing route

Steps to reproduce

No response

Are there any recent changes that introduced the issue?

No response

OS

Linux

OS version

linux 5.15.0-101-generic and linux v6.2

Tailscale version

1.52.1

Other software

No response

Bug report

BUG-3f60dfef69f7d82d9ac990fd92d287e5f2acec980793e7013d6ce3c4ef698139-20240329215413Z-48a3a7403f53d0e8

Activity

  1. 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
  2. alexl4321 commented on Mar 30, 2024

    @alexl4321

    are you running custom derps maybe inside docker or lxd by any chance?

  3. suyuee commented on Mar 30, 2024

    @suyuee
    Author

    @alexl4321 no, we are not running custom derp or any customization, all default ones provided by tailscale

  4. alexl4321 commented on Mar 30, 2024

    @alexl4321

    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

  5. kelivel commented on Apr 26, 2024

    @kelivel
    Contributor

    Hi @suyuee, I see you're running version 1.52.1. Are you still seeing this behavior on the latest Tailscale version?

  6. added
    connectivity
    L2 Few
    P2 Aggravating
    T5 Usability
    and removed on Apr 26, 2024
  7. lukehsiao commented on May 24, 2024

    @lukehsiao

    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
    
  8. 27 remaining items

  9. daniellandau commented on Feb 17, 2025

    @daniellandau

    I found two behaviours:

    In both cases, node A is running a tailscale ping -c 1000 B

    1. 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.

    2. 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.

  10. tidux commented on Mar 26, 2025

    @tidux

    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.

  11. andreyrd commented on Mar 31, 2025

    @andreyrd

    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.

  12. andreyrd commented on Mar 31, 2025

    @andreyrd

    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..."
    
    while true; do
    
        # 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
    done
    
  13. expoli commented on Mar 31, 2025

    @expoli

    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..."

    while true; do

    # 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
    

    done

    nice !

  14. expoli commented on Mar 31, 2025

    @expoli

    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

    func (m *manualCertManager) getCertificate(hi *tls.ClientHelloInfo) (*tls.Certificate, error) {
    	if hi.ServerName != m.hostname && !m.noHostname {
    		return nil, fmt.Errorf("cert mismatch with hostname: %q", hi.ServerName)
    	}
        ...

    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.

    1. 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.
    2. DERPER_PORT[default:443]
      • The port that derper runs on, you can modify it according to your needs.
    3. 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.
    4. 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

    example docker run command⌘

    docker run -it --rm -e DOMAIN_NAME=test.com -e DERPER_PORT=2333 -p 2333:2333 ghcr.io/expoli/tailscale-derper:main
  15. BackendButters commented on Apr 18, 2025

    @BackendButters

    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

    		"OmitDefaultRegions": true,
    		"Regions": {
    			"900": {
    				"RegionID":   900,
    				"RegionCode": "region-1",
    				"Nodes": [
    					{
    						"Name":     "node1",
    						"RegionID": 900,
    						"HostName": "node1.mydomain",
    					},
    					{
    						"Name":     "node2",
    						"RegionID": 900,
    						"HostName": "node2.mydomain",
    					},
    				],
    			},
    		},
    

    to

    		"OmitDefaultRegions": true,
    		"Regions": {
    			"900": {
    				"RegionID":   900,
    				"RegionCode": "region-1",
    				"Nodes": [
    					{
    						"Name":     "node1",
    						"RegionID": 900,
    						"HostName": "node1.mydomain",
    					},
    				],
    			},
    			"901": {
    				"RegionID":   901,
    				"RegionCode": "region-2",
    				"Nodes": [
    					{
    						"Name":     "node2",
    						"RegionID": 901,
    						"HostName": "node2.mydomain",
    					},
    				],
    			},
    		},
    

    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?

  16. luckman212 commented on Jul 6, 2025

    @luckman212

    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.

  17. rasa commented on Jul 15, 2025

    @rasa

    Here's a version for OpenWRT:

    #!/bin/sh
    
    logger -s -t tailscaled-monitor "Monitoring tailscaled logs..."
    
    while true; do
    
        # Follow journal for tailscaled, ignoring any old lines
        logread -f -e tailscaled | while read line; do
    
            if echo "$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 fresh
                break
            fi
        done
    done
  18. electricsteve commented on Nov 25, 2025

    @electricsteve

    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)

  19. edrumm commented on May 22, 2026

    @edrumm

    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

    (1.98.3 / go1.26.3)

  20. zuavra commented on Jun 11, 2026

    @zuavra

    I also have this, on 1.98.4:

    magicsock: derp-26 does not know about peer [25vNr], removing route

    I'm also seeing #19852 .

  21. jae-heo commented on Oct 2, 2026

    @jae-heo

    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: 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:

    1. 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.
    2. Collect tailscale status --json on both nodes, using an independent LAN SSH path for Linux; observe the relay discrepancy above.
    3. From Linux, run tailscale ping <MAC_TS_IP>.
    4. 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.

    • Mac: BUG-2c31ef74444b8467726c20176a684e3d7e4fe2828650e9795bd1473ef98c4fc2-20261002172651Z-238c694c5e05ba19
    • Linux: BUG-fbb80ef066dd2b30d3e81ac18fed9fe1d330167636055fbe2eb7e9acd64091f4-20261002172659Z-5d3464be1493cdf0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    L2 FewP2 AggravatingT5 Usabilitybugconnectivitycontainerssupport

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions