traefik/traefik · warning · Error

Network error: ${response.status}

Error message

Network error: ${response.status}

What it means

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.

Source

Thrown at webui/src/contexts/version.tsx:31

  version: '',
  dashboardName: '',
})

type VersionProviderProps = {
  children: ReactNode
}

export const VersionProvider = ({ children }: VersionProviderProps) => {
  const [showHubButton, setShowHubButton] = useState(false)
  const [version, setVersion] = useState('')
  const [dashboardName, setDashboardName] = useState('')

  useEffect(() => {
    const fetchVersion = async () => {
      try {
        const response = await fetch(`${BASE_PATH}/version`)
        if (!response.ok) {
          throw new Error(`Network error: ${response.status}`)
        }
        const data: API.Version = await response.json()
        setShowHubButton(!data.disableDashboardAd)
        setVersion(data.Version)
        setDashboardName(data.dashboardName || '')
      } catch (err) {
        console.error(err)
      }
    }

    fetchVersion()
  }, [])

  return <VersionContext.Provider value={{ showHubButton, version, dashboardName }}>{children}</VersionContext.Provider>
}

View on GitHub (pinned to b51bd71e1f)

Solutions

  1. Open devtools and check the /version response: its status code tells you which branch failed.
  2. For 401/403, fix the api.dashboard security/auth middleware configuration so /version is reachable from the browser.
  3. 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.
  4. For network errors, confirm the Traefik instance hosting the dashboard is up.
  5. Optionally surface the error in the UI instead of only console.error so failures are discoverable.

Example fix

// before
} catch (err) {
  console.error(err)
}

// after
} catch (err) {
  console.error('Failed to fetch Traefik version:', err)
  setVersion('unknown')
}
Defensive patterns

Strategy: fallback

Try / catch

try {
  const response = await fetch(`${BASE_PATH}/version`)
  if (!response.ok) throw new Error(`Network error: ${response.status}`)
  const data: API.Version = await response.json()
} catch (err) {
  // already swallowed with console.error; provide fallback UI state (version = '', defaults)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of traefik/traefik@b51bd71e1f (2026-08-15). Data as JSON: /api/errors/6b29f2aea555b34b. Report an issue: GitHub.