{"record":{"id":"8939e46cfe3dbd48","repo":"JuliusBrussee/caveman","slug":"want-provider-https-host","errorCode":null,"errorMessage":"want provider=https://host","messagePattern":"want provider=https://host","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cmd/cache-replay/main.go","lineNumber":58,"sourceCode":"\treturn nil\n}\n\ntype baseURLValues map[string]string\n\nfunc (values *baseURLValues) String() string {\n\tkeys := make([]string, 0, len(*values))\n\tfor key := range *values {\n\t\tkeys = append(keys, key)\n\t}\n\tsort.Strings(keys)\n\treturn strings.Join(keys, \",\")\n}\n\nfunc (values *baseURLValues) Set(value string) error {\n\tprovider, raw, ok := strings.Cut(value, \"=\")\n\tprovider = strings.ToLower(strings.TrimSpace(provider))\n\tif !ok || provider == \"\" || strings.TrimSpace(raw) == \"\" {\n\t\treturn errors.New(\"want provider=https://host\")\n\t}\n\tif *values == nil {\n\t\t*values = map[string]string{}\n\t}\n\tif _, exists := (*values)[provider]; exists {\n\t\treturn fmt.Errorf(\"duplicate provider %q\", provider)\n\t}\n\t(*values)[provider] = strings.TrimSpace(raw)\n\treturn nil\n}\n\ntype runManifest struct {\n\tSchema        string                            `json:\"schema\"`\n\tStatus        string                            `json:\"status\"`\n\tPublishable   bool                              `json:\"publishable\"`\n\tTraceSHA256   string                            `json:\"trace_sha256\"`\n\tStartedAt     string                            `json:\"started_at\"`\n\tCompletedAt   string                            `json:\"completed_at,omitempty\"`","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/cacheengine/cmd/cache-replay/main.go#L40-L76","documentation":"Returned by (*baseURLValues).Set, the flag.Value implementation for cache-replay's repeatable -base-url flag. Each occurrence must have the form provider=https://host; the value is split on the first '=' and both sides are trimmed, so the error fires when there is no '=', when the provider side is empty, or when the URL side trims to empty. This is purely command-line syntax validation before any URL is used.","triggerScenarios":"Running cache-replay with -base-url openai.example.com (missing '='), -base-url =https://host (empty provider), -base-url openai= (empty host), or -base-url with only whitespace around one side. Shell quoting that swallows the '=' is not the issue here since Cut splits on the first '='.","commonSituations":"Assuming the flag takes a space-separated pair (-base-url openai https://host); pasting a URL without the provider prefix; trailing-whitespace copy-paste from docs; typos like -base-url openai:https://host.","solutions":["Use the exact form: -base-url provider=https://host, e.g. -base-url openai=https://api.staging.example.com","Provider is lower-cased automatically, but it must be non-empty; host must be non-empty after trimming","Repeat the flag for multiple providers; do not comma-separate values in one occurrence","If you also get 'custom base URLs require -allow-custom-base-url', add that flag too"],"exampleFix":"# before\ncache-replay -trace /abs/t.jsonl -base-url openai.example.com\n\n# after\ncache-replay -trace /abs/t.jsonl -base-url openai=https://openai.example.com -allow-custom-base-url","handlingStrategy":"validation","validationCode":"func parseBaseURL(v string) (provider, host string, err error) {\n\tp, raw, ok := strings.Cut(v, \"=\")\n\tp, raw = strings.ToLower(strings.TrimSpace(p)), strings.TrimSpace(raw)\n\tif !ok || p == \"\" || raw == \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"want provider=https://host, got %q\", v)\n\t}\n\treturn p, raw, nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Document the provider=https://host form next to every -base-url usage in runbooks","When generating commands programmatically, build them as provider + \"=\" + host rather than concatenating user text"],"tags":["go","cli","flag-parsing","configuration"],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}