{"record":{"id":"adc2e423e751089e","repo":"juanfont/headscale","slug":"command-aborted-by-user","errorCode":null,"errorMessage":"command aborted by user","messagePattern":"command aborted by user","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"cmd/headscale/cli/policy.go","lineNumber":22,"sourceCode":"\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n\n\tclientv1 \"github.com/juanfont/headscale/gen/client/v1\"\n\t\"github.com/juanfont/headscale/hscontrol/db\"\n\t\"github.com/juanfont/headscale/hscontrol/policy\"\n\t\"github.com/juanfont/headscale/hscontrol/types\"\n\t\"github.com/spf13/cobra\"\n\t\"tailscale.com/types/views\"\n)\n\nconst (\n\tbypassFlag = \"bypass-server-and-access-database-directly\" //nolint:gosec // not a credential\n)\n\nvar errAborted = errors.New(\"command aborted by user\")\n\n// bypassDatabase opens the database directly, bypassing the running server.\n// The caller must close the returned handle.\nfunc bypassDatabase() (*db.HSDatabase, error) {\n\tcfg, err := types.LoadServerConfig()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"loading config: %w\", err)\n\t}\n\n\td, err := db.NewHeadscaleDatabase(cfg)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"opening database: %w\", err)\n\t}\n\n\treturn d, nil\n}\n\n// openBypassDB confirms the destructive bypass action and opens the database","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/cmd/headscale/cli/policy.go#L4-L40","documentation":"HTTP 501 emitted by noiseServer.NotImplementedHandler for any route registered inside the noise mux that headscale has not implemented (the handler logs the exact path at trace level). It is a deliberate stub: the TS2021 protocol defines endpoints headscale's control server does not serve, so unimplemented paths land here instead of 404.","triggerScenarios":"A tailscaled feature requesting a control-plane endpoint inside the noise tunnel that headscale never implemented (e.g. newer or optional coordination endpoints); manually probing the noise mux with crafted requests to unknown paths.","commonSituations":"Newer tailscale clients exercising features (e.g. future tailcfg endpoints) that headscale does not support yet; curiosity-driven scanning of /ts2021 inner routes; custom clients calling nonstandard paths.","solutions":["Confirm the requested path from the server's trace log ('not implemented handler hit', path field) and check headscale release notes/changelog whether that endpoint is supported in a newer version.","If the path corresponds to a client feature, disable that feature on the client or upgrade headscale once the endpoint ships.","If you are developing a client, restrict calls to documented endpoints (map, registration, ping response, etc.).","Ignore it if it is a one-off probe — it is a stub response, not a fault."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"resp, err := client.Do(req)\nif err == nil && resp.StatusCode == http.StatusNotImplemented {\n    // endpoint is a deliberate stub in headscale: degrade gracefully, do not retry the same path\n    log.Printf(\"endpoint %s not implemented by this headscale; feature unavailable\", req.URL.Path)\n}","preventionTips":["Treat 501 from the noise mux as 'feature unsupported', not transient — never auto-retry it.","Gate optional client features on headscale's advertised capabilities/version.","Report missing endpoints upstream if a current tailscale client needs them."],"tags":["http","noise","not-implemented","protocol"],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}