googleapis/mcp-toolbox · warning
empty web_server_url in versions payload
Error message
empty web_server_url in versions payload
What it means
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.
Source
Thrown at internal/sources/looker/looker.go:347
urlStr = defaultURL
}
err := s.lastFetchErr
s.hostURLMu.RUnlock()
return urlStr, err
}
s.hostURLMu.RUnlock()
logger, err := util.LoggerFromContext(ctx)
if err != nil {
return defaultURL, err
}
// Perform network call outside of locks to prevent blocking concurrent readers
versionInfo, err := sdk.Versions("", s.ApiSettings)
if err != nil || versionInfo.WebServerUrl == nil || *versionInfo.WebServerUrl == "" {
fetchErr := err
if fetchErr == nil {
fetchErr = fmt.Errorf("empty web_server_url in versions payload")
}
s.hostURLMu.Lock()
s.lastFetchFailed = true
s.lastFetchTime = time.Now()
s.lastFetchErr = fetchErr
// DO NOT overwrite s.cachedHostURL on transient errors; keep the stale valid URL for stale fallbacks
s.hostURLMu.Unlock()
if err != nil {
logger.WarnContext(ctx, fmt.Sprintf("unable to retrieve host_url via versions, using stale/default fallback: %v", err))
} else {
logger.DebugContext(ctx, "versions web_server_url is empty, using stale/default fallback")
}
return "", fetchErr
}
// Validate the retrieved host_url is a valid absolute HTTP/HTTPS URL
valURL := *versionInfo.WebServerUrlView on GitHub (pinned to 8cc6e09de2)
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
Defensive patterns
Strategy: fallback
Validate before calling
if versionInfo.WebServerUrl == nil || *versionInfo.WebServerUrl == "" {
// rely on stale cached host URL; log warning
} Try / catch
_, err := src.GetHostURL(ctx, sdk)
if err != nil && strings.Contains(err.Error(), "empty web_server_url") {
logger.Warn("using stale cached host URL; will retry versions fetch")
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- unable to parse Timeout string as time.Duration: %s
- client_id and client_secret need to be specified
- client id or client secret not valid
- invalid web_server_url format: %q
- description is required for tool %q
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/119ffd2e60387af3.
Report an issue: GitHub.