{"record":{"id":"b7917be99781c629","repo":"milvus-io/milvus","slug":"server-error","errorCode":null,"errorMessage":"Server error","messagePattern":"Server error","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/http/webui/telemetry.html","lineNumber":1549,"sourceCode":"\n            // Create Basic Auth token\n            authToken = 'Basic ' + btoa(username + ':' + password);\n\n            // Test auth by making a request\n            try {\n                const resp = await fetch(`${API_BASE}/_telemetry/clients`, {\n                    headers: { 'Authorization': authToken }\n                });\n\n                if (resp.status === 401) {\n                    errorDiv.textContent = 'Invalid username or password';\n                    errorDiv.style.display = 'block';\n                    authToken = '';\n                    return;\n                }\n\n                if (!resp.ok) {\n                    throw new Error('Server error');\n                }\n\n                // Save auth\n                sessionStorage.setItem('milvusAuth', authToken);\n                sessionStorage.setItem('milvusUser', username);\n                showApp(username);\n            } catch (error) {\n                errorDiv.textContent = 'Connection error: ' + error.message;\n                errorDiv.style.display = 'block';\n                authToken = '';\n            }\n        }\n\n        function showApp(username) {\n            document.getElementById('loginPage').style.display = 'none';\n            document.getElementById('appContainer').style.display = 'block';\n            document.getElementById('currentUser').textContent = username;\n            loadData();","sourceCodeStart":1531,"sourceCodeEnd":1567,"githubUrl":"https://github.com/milvus-io/milvus/blob/b43a76673a9fe5f01f158979731dc8fd542df81f/internal/http/webui/telemetry.html#L1531-L1567","documentation":"Thrown by the Milvus WebUI telemetry login flow in telemetry.html. After POSTing credentials to GET /_telemetry/clients with the computed Basic auth token, any non-2xx response other than 401 (which is handled separately as a bad-credential message) raises this generic 'Server error'. It means the HTTP request reached a server that refused it for a reason other than authentication: typically 500 (telemetry handler panic or embedded etcd/proxy not ready), 403, or a proxy/gateway in front returning 502/503.","triggerScenarios":"Calling the WebUI login when the Milvus proxy is up but the telemetry HTTP server has an internal error (500), when the auth config (webui auth username/password or proxy.authEnabled) is inconsistent so the server returns 403, or when a reverse proxy returns 502/503 while Milvus is starting. Any resp.status not in 2xx and not 401 hits this branch.","commonSituations":"Milvus still starting up (proxy listens before the telemetry handler is fully wired); mismatch between the credentials expected by the server and those typed in; a load balancer / ingress intercepting /_telemetry/* routes; telemetry disabled via config so the handler errors.","solutions":["Open the same URL /_telemetry/clients with curl -u user:pass -i and read the actual status code and body, which the UI discards.","If 500: check the Milvus proxy logs for a panic or stack trace around the telemetry handler and restart the component if it crashed.","If 403/401-loop: verify web auth settings (common.security.authorizationEnabled, proxy auth) and that the WebUI is served by the same Milvus instance you are authenticating against.","If behind a proxy: ensure /_telemetry/* is passed through to Milvus unchanged, including the Authorization header.","Retry after Milvus is fully healthy (healthz/metrics endpoints respond)."],"exampleFix":"// before\nif (!resp.ok) {\n    throw new Error('Server error');\n}\n\n// after - surface the real status/body so the cause is diagnosable\nif (!resp.ok) {\n    const body = await resp.text().catch(() => '');\n    throw new Error(`Server error: HTTP ${resp.status} ${body.slice(0, 200)}`);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const resp = await fetch(`${API_BASE}/_telemetry/clients`, { headers: { 'Authorization': authToken } });\n  if (resp.status === 401) { /* bad credentials */ }\n  if (!resp.ok) {\n    const body = await resp.text().catch(() => '');\n    throw new Error(`Server error: HTTP ${resp.status} ${body.slice(0, 200)}`);\n  }\n} catch (e) {\n  // distinguish network failure (TypeError) from HTTP failure\n  showError(e instanceof TypeError ? 'Cannot reach Milvus WebUI endpoint' : e.message);\n}","preventionTips":["Confirm Milvus is fully healthy (curl the metrics endpoint) before logging into the telemetry UI.","Keep the WebUI on the same origin as the Milvus instance or proxy /_telemetry/* with the Authorization header intact.","Include the HTTP status and truncated body in every thrown message instead of a generic string."],"tags":["javascript","http","authentication","webui","telemetry"],"backgroundTag":null,"analyzedSha":"b43a76673a9fe5f01f158979731dc8fd542df81f","analyzedAt":"2026-08-15T10:29:28.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}