{"record":{"id":"4ce5813ee44e29ff","repo":"milvus-io/milvus","slug":"failed-to-request-errors","errorCode":null,"errorMessage":"Failed to request errors","messagePattern":"Failed to request errors","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/http/webui/telemetry.html","lineNumber":2006,"sourceCode":"                    headers: {\n                        'Content-Type': 'application/json',\n                        ...(authToken ? { 'Authorization': authToken } : {})\n                    },\n                    body: JSON.stringify({\n                        command_type: 'show_errors',\n                        target_client_id: clientId,\n                        payload: '{\"limit\": 100}',\n                        ttl_seconds: 300 // 5 minutes TTL\n                    })\n                });\n\n                if (resp.status === 401) {\n                    logout();\n                    return;\n                }\n\n                if (!resp.ok) {\n                    throw new Error('Failed to request errors');\n                }\n\n                document.getElementById('errorModalContent').innerHTML = `\n                    <div class=\"empty-state\" style=\"padding: 20px;\">\n                        <p>Error request sent to client.</p>\n                        <p style=\"font-size: 13px; color: var(--gray-500); margin-top: 8px;\">\n                            The show_errors command has been pushed to the client.\n                            Errors will be included in the client's next heartbeat response\n                            and can be viewed in the server logs.\n                        </p>\n                        <p style=\"font-size: 12px; color: var(--gray-400); margin-top: 12px;\">\n                            Note: Client errors are collected locally on each client and sent to the server\n                            when the show_errors command is received. Check the Milvus server logs for the error details.\n                        </p>\n                    </div>\n                `;\n            } catch (error) {\n                document.getElementById('errorModalContent').innerHTML = `","sourceCodeStart":1988,"sourceCodeEnd":2024,"githubUrl":"https://github.com/milvus-io/milvus/blob/b43a76673a9fe5f01f158979731dc8fd542df81f/internal/http/webui/telemetry.html#L1988-L2024","documentation":"Thrown by the WebUI when POSTing a 'show_errors' command to /_telemetry/commands targeting a specific client fails with a non-2xx, non-401 status. The telemetry command channel refused the request: usually the target client_id is unknown to the server (it has never heartbeat-ed or has been evicted), or the request payload failed server-side validation.","triggerScenarios":"Clicking 'Show errors' for a client that went offline and was removed from the server's client registry; client_id typo/encoding issue; command queue write failure (500) on the server.","commonSituations":"Client list is stale in the browser (opened before clients disconnected); short client eviction timeout so entries vanish between listing and command submission; Milvus restart clearing in-memory telemetry state.","solutions":["Refresh the client list and confirm the target client_id still appears with a recent heartbeat before re-sending.","If the client is gone, wait for it to reconnect and heartbeat, then retry.","Inspect the server response body (the code discards it) via browser devtools Network tab for the exact error string."],"exampleFix":"// before\nif (!resp.ok) {\n    throw new Error('Failed to request errors');\n}\n\n// after\nif (!resp.ok) {\n    const err = await resp.json().catch(() => ({}));\n    throw new Error(err.error || `Failed to request errors (HTTP ${resp.status})`);\n}","handlingStrategy":"try-catch","validationCode":"// verify the client is still registered before sending the command\nconst list = await (await fetch(`${API_BASE}/_telemetry/clients`, { headers: { 'Authorization': authToken } })).json();\nconst alive = (list.clients || []).some(c => c.client_id === clientId && Date.now() - c.last_heartbeat_ms < 60000);\nif (!alive) { showToast('Client is not connected; cannot request errors', 'warning'); return; }","typeGuard":null,"tryCatchPattern":"try {\n  const resp = await fetch(url, { method: 'POST', headers, body: JSON.stringify(payload) });\n  if (resp.status === 401) { logout(); return; }\n  if (!resp.ok) {\n    const err = await resp.json().catch(() => ({}));\n    throw new Error(err.error || `Failed to request errors (HTTP ${resp.status})`);\n  }\n} catch (e) { showToast(e.message, 'error'); }","preventionTips":["Check the client's last heartbeat before issuing client-scoped commands.","Always parse and surface the server error body; it names the actual rejection reason.","Handle 401 uniformly at the top of every telemetry fetch helper."],"tags":["javascript","http","telemetry","client-discovery","webui"],"backgroundTag":null,"analyzedSha":"b43a76673a9fe5f01f158979731dc8fd542df81f","analyzedAt":"2026-08-15T10:29:28.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}