{"record":{"id":"526ca7a9c7e98c1a","repo":"juanfont/headscale","slug":"setting-approved-routes-w","errorCode":null,"errorMessage":"setting approved routes: %w","messagePattern":"setting approved routes: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/headscale/cli/nodes.go","lineNumber":504,"sourceCode":"\t\t\treturn apiError(resp.StatusCode(), resp.ApplicationproblemJSONDefault)\n\t\t}\n\n\t\treturn printOutput(cmd, resp.JSON200.Node, \"Node updated\")\n\t}),\n}\n\nvar approveRoutesCmd = &cobra.Command{\n\tUse:   \"approve-routes\",\n\tShort: \"Manage the approved routes of a node\",\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\troutes, _ := cmd.Flags().GetStringSlice(\"routes\")\n\n\t\tresp, err := client.SetApprovedRoutesWithResponse(ctx, strconv.FormatUint(identifier, util.Base10), clientv1.SetApprovedRoutesJSONRequestBody{\n\t\t\tRoutes: &routes,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"setting approved routes: %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 updated\")\n\t}),\n}\n","sourceCodeStart":486,"sourceCodeEnd":514,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/cmd/headscale/cli/nodes.go#L486-L514","documentation":"Error \"setting approved routes: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at cmd/headscale/cli/nodes.go:504 when the library encounters an invalid state.","commonSituations":"Setting approved routes failed. Verify the node ID exists and the routes are among the routes the node advertises.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (setting approved routes); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (setting approved routes); 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"}