{"record":{"id":"119ffd2e60387af3","repo":"googleapis/mcp-toolbox","slug":"empty-web-server-url-in-versions-payload","errorCode":null,"errorMessage":"empty web_server_url in versions payload","messagePattern":"empty web_server_url in versions payload","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/sources/looker/looker.go","lineNumber":347,"sourceCode":"\t\t\t\turlStr = defaultURL\n\t\t\t}\n\t\t\terr := s.lastFetchErr\n\t\t\ts.hostURLMu.RUnlock()\n\t\t\treturn urlStr, err\n\t\t}\n\t\ts.hostURLMu.RUnlock()\n\n\t\tlogger, err := util.LoggerFromContext(ctx)\n\t\tif err != nil {\n\t\t\treturn defaultURL, err\n\t\t}\n\n\t\t// Perform network call outside of locks to prevent blocking concurrent readers\n\t\tversionInfo, err := sdk.Versions(\"\", s.ApiSettings)\n\t\tif err != nil || versionInfo.WebServerUrl == nil || *versionInfo.WebServerUrl == \"\" {\n\t\t\tfetchErr := err\n\t\t\tif fetchErr == nil {\n\t\t\t\tfetchErr = fmt.Errorf(\"empty web_server_url in versions payload\")\n\t\t\t}\n\t\t\ts.hostURLMu.Lock()\n\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","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/looker/looker.go#L329-L365","documentation":"GetHostURL calls sdk.Versions to learn the Looker web_server_url used as the host URL. If the API call errors, or the payload lacks a non-empty WebServerUrl, this synthetic error is recorded as lastFetchErr while the stale cached URL is preserved. It is a transient-fetch failure, not necessarily fatal to the request.","triggerScenarios":"sdk.Versions(\"\", s.ApiSettings) returns err == nil but versionInfo.WebServerUrl is nil or an empty string; or the Versions API call itself fails (which then surfaces the original err instead).","commonSituations":"Looker instance misconfigured (no web_server_url set in the Looker admin settings); API versions endpoint returning a trimmed/unexpected payload; network proxies stripping fields or intermittent API failures.","solutions":["Check the Looker instance Admin > General settings and set the correct Web Server URL","Retry the operation — the source keeps the last valid host URL and will re-fetch later","Verify network/proxy connectivity from the toolbox to the Looker API","Pin to a Looker API version that reliably returns web_server_url in the versions payload"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if versionInfo.WebServerUrl == nil || *versionInfo.WebServerUrl == \"\" {\n    // rely on stale cached host URL; log warning\n}","typeGuard":null,"tryCatchPattern":"_, err := src.GetHostURL(ctx, sdk)\nif err != nil && strings.Contains(err.Error(), \"empty web_server_url\") {\n    logger.Warn(\"using stale cached host URL; will retry versions fetch\")\n}","preventionTips":["Ensure Web Server URL is set in Looker Admin > General settings","Alert on repeated host-url fetch failures in logs","Add retry/backoff around Versions calls"],"tags":["looker","api-response","config"],"backgroundTag":"empty-api-response-field","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"}