{"record":{"id":"299a037953e825a6","repo":"JuliusBrussee/caveman","slug":"vertex-base-url-invalid-w","errorCode":null,"errorMessage":"vertex base url invalid: %w","messagePattern":"vertex base url invalid: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/providers/vertex/routing.go","lineNumber":53,"sourceCode":"\t\treturn nil, fmt.Errorf(\"vertex request path %q does not name a publisher, model, and method\", req.URL.Path)\n\t}\n\tif !methodAllowed(publisher, method) {\n\t\treturn nil, fmt.Errorf(\"vertex method %q is not allowed for publisher %q\", method, publisher)\n\t}\n\tif !publisherAllowed(publisher) {\n\t\treturn nil, fmt.Errorf(\"vertex publisher %q is not on the allowlist\", publisher)\n\t}\n\tif !modelAllowed(model) {\n\t\treturn nil, fmt.Errorf(\"vertex model %q is not on the allowlist\", model)\n\t}\n\n\tbaseURL := a.BaseURL\n\tif route.BaseURL != \"\" {\n\t\tbaseURL = route.BaseURL\n\t}\n\tbase, err := url.Parse(baseURL)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"vertex base url invalid: %w\", err)\n\t}\n\tbase.Path = strings.TrimRight(base.Path, \"/\") + strings.TrimPrefix(req.URL.Path, \"/vertex\")\n\tbase.RawQuery = req.URL.RawQuery\n\n\t// SSRF/host validation on the resolved endpoint. Active in managed (prod)\n\t// mode; local/self-hosted (stub) endpoints are permitted so the dry-run and\n\t// examples can target the provider-stub.\n\tif env.IsProduction() {\n\t\tif err := ssrf.ValidateURL(ctx, base.String(), ssrf.ManagedConfig()); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif host := base.Hostname(); !isVertexHost(host) {\n\t\t\treturn nil, fmt.Errorf(\"vertex endpoint host %q is not an aiplatform host\", host)\n\t\t}\n\t}\n\treturn base, nil\n}\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/proxy/providers/vertex/routing.go#L35-L71","documentation":"url.Parse rejected the configured Vertex base URL (route override or a.BaseURL), so no upstream endpoint could be constructed. This is a configuration error: the URL string itself is syntactically invalid, distinct from later SSRF/host validation of a parseable URL.","triggerScenarios":"Thrown at proxy/providers/vertex/routing.go:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the syntax of the Vertex base URL in configuration or the route override","Ensure the URL includes scheme and host, e.g. https://aiplatform.googleapis.com"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}