{"record":{"id":"4721078469a79bce","repo":"googleapis/mcp-toolbox","slug":"invalid-web-server-url-format-q","errorCode":null,"errorMessage":"invalid web_server_url format: %q","messagePattern":"invalid web_server_url format: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/sources/looker/looker.go","lineNumber":368,"sourceCode":"\t\t\ts.lastFetchFailed = true\n\t\t\ts.lastFetchTime = time.Now()\n\t\t\ts.lastFetchErr = fetchErr\n\t\t\t// DO NOT overwrite s.cachedHostURL on transient errors; keep the stale valid URL for stale fallbacks\n\t\t\ts.hostURLMu.Unlock()\n\n\t\t\tif err != nil {\n\t\t\t\tlogger.WarnContext(ctx, fmt.Sprintf(\"unable to retrieve host_url via versions, using stale/default fallback: %v\", err))\n\t\t\t} else {\n\t\t\t\tlogger.DebugContext(ctx, \"versions web_server_url is empty, using stale/default fallback\")\n\t\t\t}\n\t\t\treturn \"\", fetchErr\n\t\t}\n\n\t\t// Validate the retrieved host_url is a valid absolute HTTP/HTTPS URL\n\t\tvalURL := *versionInfo.WebServerUrl\n\t\tu, err := url.Parse(valURL)\n\t\tif err != nil || (u.Scheme != \"http\" && u.Scheme != \"https\") || u.Host == \"\" {\n\t\t\tparseErr := fmt.Errorf(\"invalid web_server_url format: %q\", valURL)\n\t\t\ts.hostURLMu.Lock()\n\t\t\ts.lastFetchFailed = true\n\t\t\ts.lastFetchTime = time.Now()\n\t\t\ts.lastFetchErr = parseErr\n\t\t\ts.hostURLMu.Unlock()\n\t\t\tlogger.WarnContext(ctx, fmt.Sprintf(\"invalid host_url setting retrieved %q, using stale/default fallback: %v\", valURL, err))\n\t\t\treturn \"\", parseErr\n\t\t}\n\n\t\tresolvedURL := strings.TrimSuffix(valURL, \"/\")\n\n\t\ts.hostURLMu.Lock()\n\t\ts.cachedHostURL = resolvedURL\n\t\ts.lastFetchTime = time.Now()\n\t\ts.lastFetchFailed = false\n\t\ts.lastFetchErr = nil\n\t\ts.hostURLMu.Unlock()\n","sourceCodeStart":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/looker/looker.go#L350-L386","documentation":"After fetching web_server_url from the Looker versions endpoint, the value is parsed with url.Parse and must be an absolute http/https URL with a host. Values like relative paths, missing scheme, or whitespace fail validation and this error is stored as lastFetchErr; a stale/default fallback host URL is used with a warning.","triggerScenarios":"versionInfo.WebServerUrl parses to a URL with scheme other than http/https, or an empty Host (e.g. \"my.looker.com\" without https://, or \"/relative/path\").","commonSituations":"Looker web_server_url configured without the https:// scheme; misconfigured reverse proxies; typo in the Looker admin setting producing a malformed URL.","solutions":["Fix the Web Server URL in Looker Admin settings to a fully-qualified https:// URL (e.g. https://mycompany.looker.com)","Retry after fixing — the warning path keeps serving the stale URL until a good fetch succeeds","If a custom domain was recently changed, allow DNS/TLS to settle and verify the URL resolves"],"exampleFix":"// before (Looker admin setting)\nweb_server_url: mycompany.looker.com\n// after\nweb_server_url: https://mycompany.looker.com","handlingStrategy":"validation","validationCode":"u, err := url.Parse(webServerURL)\nif err != nil || (u.Scheme != \"http\" && u.Scheme != \"https\") || u.Host == \"\" {\n    return fmt.Errorf(\"looker web_server_url must be absolute http(s): %q\", webServerURL)\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"invalid web_server_url format\") {\n    // fix Looker admin setting; meanwhile stale URL is used\n    logger.Warn(\"looker web_server_url invalid; using fallback\")\n}","preventionTips":["Always configure the Looker web_server_url with an explicit https:// scheme","Validate the URL after any Looker instance or domain migration","Monitor warn logs for repeated invalid host_url fetches"],"tags":["looker","url-validation","config"],"backgroundTag":"invalid-url-format","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}