{"record":{"id":"d27de3846a31048b","repo":"milvus-io/milvus","slug":"failed-to-fetch-errors","errorCode":null,"errorMessage":"Failed to fetch errors","messagePattern":"Failed to fetch errors","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/http/webui/telemetry.html","lineNumber":2900,"sourceCode":"                        ...(authToken ? { 'Authorization': authToken } : {})\n                    },\n                    body: JSON.stringify({\n                        command_type: 'show_errors',\n                        target_client_id: clientId,\n                        payload: JSON.stringify(payload),\n                        ttl_seconds: 300,\n                        persistent: false\n                    })\n                });\n\n                if (resp.status === 401) {\n                    logout();\n                    return;\n                }\n\n                if (!resp.ok) {\n                    const error = await resp.json();\n                    throw new Error(error.error || 'Failed to fetch errors');\n                }\n\n                const result = await resp.json();\n\n                // Refresh commands from server\n                await loadServerCommands();\n\n                // Start polling for the response\n                pollForCommandReply(result.command_id, clientId, 'errors');\n\n            } catch (error) {\n                showToast('Error: ' + error.message, 'error');\n                document.getElementById('errorsContent').innerHTML = `<p style=\"color: var(--danger);\">Error: ${escapeHtml(error.message)}</p>`;\n            }\n        }\n\n        // Poll for command reply\n        async function pollForCommandReply(commandId, clientId, type, aggregate) {","sourceCodeStart":2882,"sourceCodeEnd":2918,"githubUrl":"https://github.com/milvus-io/milvus/blob/b43a76673a9fe5f01f158979731dc8fd542df81f/internal/http/webui/telemetry.html#L2882-L2918","documentation":"Thrown when POSTing the fetch-errors command (client-scope show_errors with ttl 300s) to /_telemetry/commands fails with non-2xx, non-401 status. Identical failure family to the other command pushes: target client unknown/evicted, payload rejected, or server 500. The server's error body overrides the literal message when parseable.","triggerScenarios":"Clicking 'Fetch errors' on a client row for a client that disconnected and was evicted from the registry; malformed payload; command-store write failure.","commonSituations":"Client list stale in a long-open tab; ephemeral clients (CLI tools, short-lived SDK sessions) vanishing between list and command; Milvus restart.","solutions":["Refresh the client list and retry against a client with a current heartbeat.","Read the toast / devtools response body for the exact server-side reason.","If persistent, check proxy logs around POST /_telemetry/commands for a 500 stack trace."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!clientId) { showToast('No client selected', 'error'); return; }","typeGuard":null,"tryCatchPattern":"try {\n  const resp = await fetch(url, { method: 'POST', headers, body });\n  if (resp.status === 401) { logout(); return; }\n  if (resp.status === 404) { showToast('Client no longer registered; refresh the list', 'warning'); return; }\n  if (!resp.ok) {\n    const error = await resp.json().catch(() => ({}));\n    throw new Error(error.error || `Failed to fetch errors (HTTP ${resp.status})`);\n  }\n} catch (e) { showToast(e.message, 'error'); }","preventionTips":["Guard against client eviction: treat 404 on client-scoped commands as 'refresh and retry'.","Validate clientId is present before issuing the command.","Centralize the 401/404/non-ok handling in one fetch wrapper for all telemetry commands."],"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"}