{"record":{"id":"7cfb107661577206","repo":"juanfont/headscale","slug":"machines-registered-with-cli-do-not-support-expiry","errorCode":null,"errorMessage":"machines registered with CLI do not support expiry","messagePattern":"machines registered with CLI do not support expiry","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hscontrol/handlers.go","lineNumber":101,"sourceCode":"\n// HTTPError represents an error that is surfaced to the user via web.\ntype HTTPError struct {\n\tCode int    // HTTP response code to send to client; 0 means 500\n\tMsg  string // Response body to send to client\n\tErr  error  // Detailed error to log on the server\n}\n\nfunc (e HTTPError) Error() string { return fmt.Sprintf(\"http error[%d]: %s, %s\", e.Code, e.Msg, e.Err) }\nfunc (e HTTPError) Unwrap() error { return e.Err }\n\n// NewHTTPError returns an HTTPError containing the given information.\nfunc NewHTTPError(code int, msg string, err error) HTTPError {\n\treturn HTTPError{Code: code, Msg: msg, Err: err}\n}\n\nvar errMethodNotAllowed = NewHTTPError(http.StatusMethodNotAllowed, \"method not allowed\", nil)\n\nvar ErrRegisterMethodCLIDoesNotSupportExpire = errors.New(\n\t\"machines registered with CLI do not support expiry\",\n)\n\nfunc parseCapabilityVersion(req *http.Request) (tailcfg.CapabilityVersion, error) {\n\tclientCapabilityStr := req.URL.Query().Get(\"v\")\n\n\tif clientCapabilityStr == \"\" {\n\t\treturn 0, NewHTTPError(http.StatusBadRequest, \"capability version must be set\", nil)\n\t}\n\n\tclientCapabilityVersion, err := strconv.Atoi(clientCapabilityStr)\n\tif err != nil {\n\t\treturn 0, NewHTTPError(http.StatusBadRequest, \"invalid capability version\", fmt.Errorf(\"parsing capability version: %w\", err))\n\t}\n\n\treturn tailcfg.CapabilityVersion(clientCapabilityVersion), nil\n}\n","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/hscontrol/handlers.go#L83-L119","documentation":"Error \"machines registered with CLI do not support expiry\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at hscontrol/handlers.go:101 when the library encounters an invalid state.","commonSituations":"Nodes registered with 'headscale nodes register' (CLI registration) cannot have an expiry set. Register the node with a pre-auth key or interactive login if expiry is needed.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (machines registered with CLI do not support expiry); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (machines registered with CLI do not support expiry); retry the operation after fixing the input, configuration, or environment.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}