{"record":{"id":"05399ebfe0d7ce95","repo":"juanfont/headscale","slug":"disabling-node-expiry-w","errorCode":null,"errorMessage":"disabling node expiry: %w","messagePattern":"disabling node expiry: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/headscale/cli/nodes.go","lineNumber":191,"sourceCode":"\tShort: \"Expire (log out) a node in your network\",\n\tLong: `Expiring a node will keep the node in the database and force it to reauthenticate.\n\nUse --disable to disable key expiry (node will never expire).`,\n\tAliases: []string{\"logout\", aliasExp, \"e\"},\n\tRunE: clientRunE(func(ctx context.Context, client *clientv1.ClientWithResponses, cmd *cobra.Command, args []string) error {\n\t\tidentifier, _ := cmd.Flags().GetUint64(\"identifier\")\n\t\tdisableExpiry, _ := cmd.Flags().GetBool(\"disable\")\n\t\tnodeID := strconv.FormatUint(identifier, util.Base10)\n\n\t\t// Handle disable expiry - node will never expire.\n\t\tif disableExpiry {\n\t\t\tdisable := true\n\n\t\t\tresp, err := client.ExpireNodeWithResponse(ctx, nodeID, clientv1.ExpireNodeJSONRequestBody{\n\t\t\t\tDisableExpiry: &disable,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"disabling node expiry: %w\", err)\n\t\t\t}\n\n\t\t\tif resp.StatusCode() != http.StatusOK {\n\t\t\t\treturn apiError(resp.StatusCode(), resp.ApplicationproblemJSONDefault)\n\t\t\t}\n\n\t\t\treturn printOutput(cmd, resp.JSON200.Node, \"Node expiry disabled\")\n\t\t}\n\n\t\texpiry, _ := cmd.Flags().GetString(\"expiry\")\n\n\t\tnow := time.Now()\n\n\t\texpiryTime := now\n\n\t\tif expiry != \"\" {\n\t\t\tvar err error\n","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/cmd/headscale/cli/nodes.go#L173-L209","documentation":"Error \"disabling node expiry: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at cmd/headscale/cli/nodes.go:191 when the library encounters an invalid state.","commonSituations":"The request to disable node expiry failed. Confirm the node ID exists and the node actually has an expiry set.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (disabling node 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 (disabling node 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"}