milvus-io/milvus · error

Failed to query status

Error message

Failed to query status

What it means

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.

Source

Thrown at internal/http/webui/telemetry.html:2816

                    },
                    body: JSON.stringify({
                        command_type: 'collection_metrics',
                        target_client_id: targetScope === 'client' ? targetClient : '',
                        target_database: targetScope === 'database' ? targetDatabase : '',
                        payload: '', // Empty payload to query status
                        ttl_seconds: 300,
                        persistent: false
                    })
                });

                if (resp.status === 401) {
                    logout();
                    return;
                }

                if (!resp.ok) {
                    const error = await resp.json();
                    throw new Error(error.error || 'Failed to query status');
                }

                const result = await resp.json();

                // Refresh commands from server
                await loadServerCommands();

                // Start polling for the response
                // For database scope, pass null since we're targeting multiple clients in that database
                pollForCommandReply(result.command_id, targetScope === 'client' ? targetClient : null, 'collection');

            } catch (error) {
                showToast('Error: ' + error.message, 'error');
                document.getElementById('collectionStatusContent').innerHTML = `<p style="color: var(--danger);">Error: ${escapeHtml(error.message)}</p>`;
            }
        }

        // =====================================================

View on GitHub (pinned to b43a76673a)

Solutions

  1. Check the toast for the server error text and fix the named cause (usually target selection).
  2. Refresh clients/collections and resubmit with a target that has a recent heartbeat.
  3. Verify client and server versions both support the query_status command (newer WebUI against older Milvus fails here).
Defensive patterns

Strategy: try-catch

Validate before calling

if (targetScope === 'client' && !targetClient) { showToast('Select a client first', 'error'); return; }

Try / catch

try {
  const resp = await fetch(url, { method: 'POST', headers, body });
  if (resp.status === 401) { logout(); return; }
  if (!resp.ok) {
    const error = await resp.json().catch(() => ({}));
    throw new Error(error.error || `Failed to query status (HTTP ${resp.status})`);
  }
  const result = await resp.json();
  pollForCommandReply(result.command_id, targetScope === 'client' ? targetClient : null, 'collection');
} catch (e) { showToast(e.message, 'error'); }

Prevention

When it happens

Trigger: Clicking query-status for a client that has since disconnected; database-scope query against a database with no registered telemetry clients; payload validation failure.

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

Related errors


AI-assisted analysis of milvus-io/milvus@b43a76673a (2026-08-15). Data as JSON: /api/errors/5e28ea0d24c45d3e. Report an issue: GitHub.