{"record":{"id":"f59a918003c7cb1a","repo":"tailscale/tailscale","slug":"getappliedconnection-w","errorCode":null,"errorMessage":"getAppliedConnection: %w","messagePattern":"getAppliedConnection: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"net/dns/nm.go","lineNumber":128,"sourceCode":"\terr = nm.CallWithContext(\n\t\tctx, \"org.freedesktop.NetworkManager.GetDeviceByIpIface\", 0,\n\t\tm.interfaceName,\n\t).Store(&devicePath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"getDeviceByIpIface: %w\", err)\n\t}\n\tdevice := conn.Object(\"org.freedesktop.NetworkManager\", devicePath)\n\n\tvar (\n\t\tsettings nmConnectionSettings\n\t\tversion  uint64\n\t)\n\terr = device.CallWithContext(\n\t\tctx, \"org.freedesktop.NetworkManager.Device.GetAppliedConnection\", 0,\n\t\tuint32(0),\n\t).Store(&settings, &version)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"getAppliedConnection: %w\", err)\n\t}\n\n\t// Frustratingly, NetworkManager represents IPv4 addresses as uint32s,\n\t// although IPv6 addresses are represented as byte arrays.\n\t// Perform the conversion here.\n\tvar (\n\t\tdnsv4 []uint32\n\t\tdnsv6 [][]byte\n\t)\n\tfor _, ip := range config.Nameservers {\n\t\tb := ip.As16()\n\t\tif ip.Is4() {\n\t\t\tdnsv4 = append(dnsv4, binary.NativeEndian.Uint32(b[12:]))\n\t\t} else {\n\t\t\tdnsv6 = append(dnsv6, b[:])\n\t\t}\n\t}\n","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/tailscale/tailscale/blob/6e0912f97994f927632b34ae9e63b53d6516a6ac/net/dns/nm.go#L110-L146","documentation":"nmManager.trySet fetches the device's currently applied connection via org.freedesktop.NetworkManager.Device.GetAppliedConnection to read and later modify its DNS settings. This error wraps that D-Bus call failing: the device has no applied connection (not activated), D-Bus policy rejects the caller, or NM returns an internal error. The fetched settings plus version are prerequisites for the later Reapply call.","triggerScenarios":"device.CallWithContext(GetAppliedConnection, uint32(0)) fails: the tailscale interface exists as a device but is unactivated/unmanaged (state != connected), polkit denies org.freedesktop.NetworkManager.device.* to the caller, or NM hit an internal error serializing the connection.","commonSituations":"The interface was created raw (ip tuntap) and NM never activated a connection on it; tailscaled running as a user without the needed polkit grants; NM plugins (ifupdown/keyfile) not managing the device so nothing is 'applied'.","solutions":["Check device state: `nmcli device show tailscale0` — if it is unmanaged/disconnected, bring it to a connected state or let NM manage it.","Run tailscaled as root or grant the D-Bus/polkit permissions for NetworkManager device methods.","Ensure an address is assigned first — NM only allows setting DNS on 'active' connections (the SetDNS comment calls this out).","Retry after NM settles; if it persists, `systemctl restart NetworkManager`."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"Retry the full read-modify-write cycle: getAppliedConnection failures from not-yet-activated devices usually clear once NM finishes activation. Distinguish permission errors (polkit) from state errors by inspecting the wrapped D-Bus name — permissions need a fix, state needs a retry.","preventionTips":["Ensure the device reaches 'connected' state before DNS is set (NM only allows DNS on active connections).","Grant the caller D-Bus/polkit rights for NetworkManager device methods.","Avoid deleting/recreating the connection concurrently with DNS updates."],"tags":["linux","dbus","networkmanager","connection"],"backgroundTag":"networkmanager-dbus-call-failed","analyzedSha":"6e0912f97994f927632b34ae9e63b53d6516a6ac","analyzedAt":"2026-08-18T08:17:25.280Z","contentChangedAt":"2026-08-18T08:17:25.280Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}