{"record":{"id":"6b29f2aea555b34b","repo":"traefik/traefik","slug":"network-error-response-status","errorCode":null,"errorMessage":"Network error: ${response.status}","messagePattern":"Network error: (.+?)","errorType":"console","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"webui/src/contexts/version.tsx","lineNumber":31,"sourceCode":"  version: '',\n  dashboardName: '',\n})\n\ntype VersionProviderProps = {\n  children: ReactNode\n}\n\nexport const VersionProvider = ({ children }: VersionProviderProps) => {\n  const [showHubButton, setShowHubButton] = useState(false)\n  const [version, setVersion] = useState('')\n  const [dashboardName, setDashboardName] = useState('')\n\n  useEffect(() => {\n    const fetchVersion = async () => {\n      try {\n        const response = await fetch(`${BASE_PATH}/version`)\n        if (!response.ok) {\n          throw new Error(`Network error: ${response.status}`)\n        }\n        const data: API.Version = await response.json()\n        setShowHubButton(!data.disableDashboardAd)\n        setVersion(data.Version)\n        setDashboardName(data.dashboardName || '')\n      } catch (err) {\n        console.error(err)\n      }\n    }\n\n    fetchVersion()\n  }, [])\n\n  return <VersionContext.Provider value={{ showHubButton, version, dashboardName }}>{children}</VersionContext.Provider>\n}\n","sourceCodeStart":13,"sourceCodeEnd":47,"githubUrl":"https://github.com/traefik/traefik/blob/b51bd71e1f794f8cca5d2da0b4d0b151dfa05793/webui/src/contexts/version.tsx#L13-L47","documentation":"Thrown by the WebUI's VersionProvider when GET {BASE_PATH}/version returns a non-2xx status. It is a deliberate, self-contained guard: the thrown Error is immediately caught by the surrounding try/catch and logged to console.error, so the only user-visible symptom is an empty version string, missing dashboard name, and default hub-button visibility in the UI.","triggerScenarios":"Loading the dashboard when /version answers 401/403 (auth middleware in front of the API), 404 (BASE_PATH mismatch or the /version endpoint unavailable in the running Traefik build), or 5xx during startup/reload. A network-level failure (connection refused, DNS) rejects the fetch itself and lands in the same catch.","commonSituations":"Dashboard exposed behind an authenticating proxy so the browser's first /version call is unauthorized; serving only the static WebUI without wiring the api provider; BASE_PATH misconfiguration; hitting the dashboard while Traefik is restarting or the entrypoint is not ready.","solutions":["Open devtools and check the /version response: its status code tells you which branch failed.","For 401/403, fix the api.dashboard security/auth middleware configuration so /version is reachable from the browser.","For 404, verify the dashboard is served by Traefik itself with api.dashboard enabled and that BASE_PATH in webui/src/libs/utils matches the deployment.","For network errors, confirm the Traefik instance hosting the dashboard is up.","Optionally surface the error in the UI instead of only console.error so failures are discoverable."],"exampleFix":"// before\n} catch (err) {\n  console.error(err)\n}\n\n// after\n} catch (err) {\n  console.error('Failed to fetch Traefik version:', err)\n  setVersion('unknown')\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const response = await fetch(`${BASE_PATH}/version`)\n  if (!response.ok) throw new Error(`Network error: ${response.status}`)\n  const data: API.Version = await response.json()\n} catch (err) {\n  // already swallowed with console.error; provide fallback UI state (version = '', defaults)\n}","preventionTips":["Ensure the dashboard origin can reach /version without auth prompts (fix api.dashboard middleware).","Treat an empty version string in the UI as 'version endpoint unreachable' and hint at it, rather than hiding the failure.","Verify BASE_PATH at deploy time so /version resolves to the Traefik API."],"tags":["webui","http","version","dashboard","react"],"backgroundTag":null,"analyzedSha":"b51bd71e1f794f8cca5d2da0b4d0b151dfa05793","analyzedAt":"2026-08-15T09:27:19.949Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}