{"record":{"id":"79f7d5a61ede731f","repo":"juanfont/headscale","slug":"registering-node-w-79f7d5","errorCode":null,"errorMessage":"registering node: %w","messagePattern":"registering node: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/headscale/cli/nodes.go","lineNumber":81,"sourceCode":"\tAliases: []string{\"node\"},\n}\n\nvar registerNodeCmd = &cobra.Command{\n\tUse:        \"register\",\n\tShort:      \"Registers a node to your network\",\n\tDeprecated: \"use 'headscale auth register --auth-id <id> --user <user>' instead\",\n\tRunE: clientRunE(func(ctx context.Context, client *clientv1.ClientWithResponses, cmd *cobra.Command, args []string) error {\n\t\tuser, _ := cmd.Flags().GetString(\"user\")\n\t\tregistrationID, _ := cmd.Flags().GetString(\"key\")\n\n\t\tparams := &clientv1.RegisterNodeParams{\n\t\t\tUser: &user,\n\t\t\tKey:  &registrationID,\n\t\t}\n\n\t\tresp, err := client.RegisterNodeWithResponse(ctx, params)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"registering 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\tnode := resp.JSON200.Node\n\n\t\treturn printOutput(\n\t\t\tcmd,\n\t\t\tnode,\n\t\t\tfmt.Sprintf(\"Node %s registered\", node.GivenName),\n\t\t)\n\t}),\n}\n\nvar listNodesCmd = &cobra.Command{\n\tUse:     cmdList,","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/cmd/headscale/cli/nodes.go#L63-L99","documentation":"Error \"registering node: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at cmd/headscale/cli/nodes.go:81 when the library encounters an invalid state.","commonSituations":"The gRPC RegisterNode call failed. Verify the headscale server is reachable via the configured socket/address and that the node key or pre-auth key is valid.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (registering 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 (registering 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"}