{"record":{"id":"11fa85b8dd2f3d7d","repo":"juanfont/headscale","slug":"unknown-set-value-want-must-all","errorCode":null,"errorMessage":"unknown --set value (want must|all)","messagePattern":"unknown --set value \\(want must\\|all\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/hi/listversions.go","lineNumber":14,"sourceCode":"package main\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/creachadair/command\"\n\t\"github.com/juanfont/headscale/hscontrol/capver\"\n)\n\nvar (\n\terrUnknownSet    = errors.New(\"unknown --set value (want must|all)\")\n\terrUnknownFormat = errors.New(\"unknown --format value (want space|newline|json)\")\n)\n\n// ListVersionsConfig holds flags for the list-versions subcommand.\ntype ListVersionsConfig struct {\n\tSet     string `flag:\"set,default=must,Version set: must|all\"`\n\tExclude string `flag:\"exclude,Comma-separated versions to exclude (e.g. head,unstable)\"`\n\tFormat  string `flag:\"format,default=space,Output format: space|newline|json\"`\n}\n\nvar listVersionsConfig ListVersionsConfig\n\n// listVersions prints the Tailscale versions used by integration tests\n// in a format CI can shell out to. Mirrors integration/scenario.go\n// AllVersions and MustTestVersions: \"head\" and \"unstable\" are bare\n// tags, releases get a \"v\" prefix so each entry can be appended to\n// \"ghcr.io/tailscale/tailscale:\" directly.\nfunc listVersions(env *command.Env) error {","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/cmd/hi/listversions.go#L1-L32","documentation":"Wrapped error from doLoginURLWithClient when http.NewRequestWithContext fails to build the GET request for the login URL. This only happens on malformed URLs (unparseable by url.Parse after the URL was already stringified) or an invalid method/context — all unlikely because loginURL came from url.URL.","triggerScenarios":"loginURL.String() producing a URL that NewRequestWithContext rejects — e.g. a URL containing control characters or an empty scheme after redirect handling.","commonSituations":"A redirect Location header carried a relative or malformed URL that was stored in a *url.URL inconsistently; control characters injected into the URL by a mock/broken OIDC provider in tests.","solutions":["Log loginURL.String() and validate it parses (url.Parse) before calling.","Fix the source producing the malformed URL — usually the OIDC provider or redirect handling upstream."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"raw := loginURL.String()\nif _, err := url.Parse(raw); err != nil {\n    return fmt.Errorf(\"login URL unparseable: %q: %w\", raw, err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate URLs at the boundary where they are produced (redirect handling).","Avoid mutating url.URL structs into inconsistent states."],"tags":["integration","http","url-parsing","defensive"],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}