{"record":{"id":"5e28ea0d24c45d3e","repo":"milvus-io/milvus","slug":"failed-to-query-status","errorCode":null,"errorMessage":"Failed to query status","messagePattern":"Failed to query status","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/http/webui/telemetry.html","lineNumber":2816,"sourceCode":"                    },\n                    body: JSON.stringify({\n                        command_type: 'collection_metrics',\n                        target_client_id: targetScope === 'client' ? targetClient : '',\n                        target_database: targetScope === 'database' ? targetDatabase : '',\n                        payload: '', // Empty payload to query status\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 query status');\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                // For database scope, pass null since we're targeting multiple clients in that database\n                pollForCommandReply(result.command_id, targetScope === 'client' ? targetClient : null, 'collection');\n\n            } catch (error) {\n                showToast('Error: ' + error.message, 'error');\n                document.getElementById('collectionStatusContent').innerHTML = `<p style=\"color: var(--danger);\">Error: ${escapeHtml(error.message)}</p>`;\n            }\n        }\n\n        // =====================================================","sourceCodeStart":2798,"sourceCodeEnd":2834,"githubUrl":"https://github.com/milvus-io/milvus/blob/b43a76673a9fe5f01f158979731dc8fd542df81f/internal/http/webui/telemetry.html#L2798-L2834","documentation":"Thrown when the 'query status' command (used by the collection-metrics panel) fails to enqueue on /_telemetry/commands with a non-2xx, non-401 status. The server rejected the command: unknown target scope, invalid payload, or internal error. On success the UI would then pollForCommandReply; this error means polling never starts.","triggerScenarios":"Clicking query-status for a client that has since disconnected; database-scope query against a database with no registered telemetry clients; payload validation failure.","commonSituations":"Stale scope selector entries; Milvus restart clearing in-memory command state; version skew where the server does not yet know the query_status command type.","solutions":["Check the toast for the server error text and fix the named cause (usually target selection).","Refresh clients/collections and resubmit with a target that has a recent heartbeat.","Verify client and server versions both support the query_status command (newer WebUI against older Milvus fails here)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (targetScope === 'client' && !targetClient) { showToast('Select a client first', '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.ok) {\n    const error = await resp.json().catch(() => ({}));\n    throw new Error(error.error || `Failed to query status (HTTP ${resp.status})`);\n  }\n  const result = await resp.json();\n  pollForCommandReply(result.command_id, targetScope === 'client' ? targetClient : null, 'collection');\n} catch (e) { showToast(e.message, 'error'); }","preventionTips":["Only start pollForCommandReply after a confirmed 2xx enqueue.","Keep client and server versions aligned so query_status is recognized.","Handle 401 uniformly before other status checks."],"tags":["javascript","http","telemetry","commands","webui"],"backgroundTag":null,"analyzedSha":"b43a76673a9fe5f01f158979731dc8fd542df81f","analyzedAt":"2026-08-15T10:29:28.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}