{"record":{"id":"c2761141942a266e","repo":"milvus-io/milvus","slug":"failed-to-delete-command","errorCode":null,"errorMessage":"Failed to delete command","messagePattern":"Failed to delete command","errorType":"http","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/http/webui/telemetry.html","lineNumber":1966,"sourceCode":"                    </div>\n                `;\n            }).join('');\n        }\n\n        async function deleteCommand(commandId) {\n            try {\n                const resp = await fetch(`${API_BASE}/_telemetry/commands/${commandId}`, {\n                    method: 'DELETE',\n                    headers: authToken ? { 'Authorization': authToken } : {}\n                });\n\n                if (resp.status === 401) {\n                    logout();\n                    return;\n                }\n\n                if (!resp.ok) {\n                    throw new Error('Failed to delete command');\n                }\n\n                // Refresh from server\n                await loadServerCommands();\n                showToast('Command deleted', 'success');\n            } catch (error) {\n                showToast('Error: ' + error.message, 'error');\n            }\n        }\n\n        // Client Errors Modal\n        async function showClientErrors(clientId) {\n            event.stopPropagation();\n            document.getElementById('errorModalClientId').textContent = clientId;\n            document.getElementById('errorModalContent').innerHTML = '<div class=\"empty-state\" style=\"padding: 20px;\"><p>Loading errors...</p></div>';\n            document.getElementById('errorModal').style.display = 'flex';\n\n            try {","sourceCodeStart":1948,"sourceCodeEnd":1984,"githubUrl":"https://github.com/milvus-io/milvus/blob/b43a76673a9fe5f01f158979731dc8fd542df81f/internal/http/webui/telemetry.html#L1948-L1984","documentation":"Thrown by the WebUI telemetry page when a DELETE to /_telemetry/commands/{commandId} returns a non-2xx status other than 401 (401 logs the user out instead). The server-side command store rejected the delete: the command id no longer exists (already consumed, expired past its TTL, or removed by another operator), or the telemetry server hit an internal error.","triggerScenarios":"Clicking 'Delete' on a telemetry command row whose TTL already expired or that a client heartbeat already consumed and purged; issuing delete twice from two browser tabs; server-side 500 while the command registry is being written.","commonSituations":"Stale WebUI view listing commands that the server has already reaped (TTL_seconds elapsed); racing with a client heartbeat; Milvus restart wiping the in-memory command store while the page stayed open.","solutions":["Reload the command list (the page refreshes via loadServerCommands) and retry the delete only if the id still appears - an expired command needs no deletion.","Check the proxy logs for the corresponding DELETE /_telemetry/commands/<id> status: 404 means already gone (safe to ignore), 500 means inspect the stack trace.","If it persists, verify the command id in the URL matches the one shown in the row (copy/paste or encoding issues with ids containing special characters)."],"exampleFix":"// before\nif (!resp.ok) {\n    throw new Error('Failed to delete command');\n}\n\n// after - treat 404 as already-deleted\nif (resp.status === 404) {\n    await loadServerCommands();\n    showToast('Command no longer exists (already expired or consumed)', 'info');\n    return;\n}\nif (!resp.ok) {\n    const err = await resp.json().catch(() => ({}));\n    throw new Error(err.error || `Failed to delete command (HTTP ${resp.status})`);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const resp = await fetch(url, { method: 'DELETE', headers });\n  if (resp.status === 401) { logout(); return; }\n  if (resp.status === 404) { await loadServerCommands(); showToast('Already gone', 'info'); return; }\n  if (!resp.ok) throw new Error(`Delete failed: HTTP ${resp.status}`);\n} catch (e) { showToast(e.message, 'error'); }","preventionTips":["Treat 404 on command deletion as success - the goal state (command absent) is already achieved.","Refresh the command list before deleting to avoid acting on expired/consumed ids.","Avoid deleting from multiple tabs simultaneously."],"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"}