{"record":{"id":"2ec5190301a61d74","repo":"juanfont/headscale","slug":"renaming-node-w","errorCode":null,"errorMessage":"renaming node: %w","messagePattern":"renaming node: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/headscale/cli/nodes.go","lineNumber":250,"sourceCode":"\n\t\treturn printOutput(cmd, node, \"Node expiration updated\")\n\t}),\n}\n\nvar renameNodeCmd = &cobra.Command{\n\tUse:   \"rename NEW_NAME\",\n\tShort: \"Renames a node in your network\",\n\tRunE: clientRunE(func(ctx context.Context, client *clientv1.ClientWithResponses, cmd *cobra.Command, args []string) error {\n\t\tidentifier, _ := cmd.Flags().GetUint64(\"identifier\")\n\n\t\tnewName := \"\"\n\t\tif len(args) > 0 {\n\t\t\tnewName = args[0]\n\t\t}\n\n\t\tresp, err := client.RenameNodeWithResponse(ctx, strconv.FormatUint(identifier, util.Base10), newName)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"renaming node: %w\", err)\n\t\t}\n\n\t\tif resp.StatusCode() != http.StatusOK {\n\t\t\treturn apiError(resp.StatusCode(), resp.ApplicationproblemJSONDefault)\n\t\t}\n\n\t\treturn printOutput(cmd, resp.JSON200.Node, \"Node renamed\")\n\t}),\n}\n\nvar deleteNodeCmd = &cobra.Command{\n\tUse:     cmdDelete,\n\tShort:   \"Delete a node\",\n\tAliases: []string{aliasDel},\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\tnodeID := strconv.FormatUint(identifier, util.Base10)\n","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/cmd/headscale/cli/nodes.go#L232-L268","documentation":"Error \"renaming node: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at cmd/headscale/cli/nodes.go:250 when the library encounters an invalid state.","commonSituations":"Renaming the node failed. Ensure the node ID exists and the new name is unique and DNS-label-safe.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (renaming node); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (renaming node); 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"}