{"record":{"id":"370c64e5598361d3","repo":"windmill-labs/windmill","slug":"errortext-failed-to-remove-token-from-blacklis","errorCode":null,"errorMessage":"errorText || 'Failed to remove token from blacklist'","messagePattern":"errorText \\|\\| 'Failed to remove token from blacklist'","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/HttpAgentWorkerDrawer.svelte","lineNumber":115,"sourceCode":"\t\t\tawait loadBlacklistedTokens()\n\t\t} catch (error) {\n\t\t\tsendUserToast('Error blacklisting token: ' + error.body, true)\n\t\t}\n\t}\n\n\tasync function removeFromBlacklist(tokenToRemove: string) {\n\t\ttry {\n\t\t\tconst response = await fetch('/api/agent_workers/remove_blacklist_token', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t},\n\t\t\t\tbody: JSON.stringify({ token: tokenToRemove })\n\t\t\t})\n\n\t\t\tif (!response.ok) {\n\t\t\t\tconst errorText = await response.text()\n\t\t\t\tthrow new Error(errorText || 'Failed to remove token from blacklist')\n\t\t\t}\n\n\t\t\tsendUserToast('Token successfully removed from blacklist')\n\t\t\t// Refresh the blacklist after removing a token\n\t\t\tawait loadBlacklistedTokens()\n\t\t} catch (error) {\n\t\t\tsendUserToast('Error removing token from blacklist: ' + error.toString(), true)\n\t\t}\n\t}\n\n\t$effect(() => {\n\t\tif (selectedTab === 'blacklist' && $enterpriseLicense && $superadmin) {\n\t\t\tloadBlacklistedTokens()\n\t\t}\n\t})\n</script>\n\n<Tabs bind:selected={selectedTab}>","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/HttpAgentWorkerDrawer.svelte#L97-L133","documentation":"In frontend/src/lib/components/HttpAgentWorkerDrawer.svelte:115, removeFromBlacklist() calls the unblacklist endpoint and, on !response.ok, throws the response body text or the fallback 'Failed to remove token from blacklist'. It means the server refused to remove the worker token from the blacklist.","triggerScenarios":"POST to the blacklist-removal endpoint returns non-2xx — token no longer blacklisted/not found (404), permission denied (403), or server error (500).","commonSituations":"Token was already removed by someone else; stale drawer state; the current user lacks admin rights on the worker settings; backend error handling the request.","solutions":["Reload the blacklist list and retry (token may already be gone)","Check the thrown errorText for the server's specific reason","Verify you have permission to manage agent worker tokens","Check backend logs if the status is 5xx"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  await removeFromBlacklist(tokenToRemove);\n} catch (error) {\n  sendUserToast(typeof error.message === 'string' && error.message\n    ? error.message\n    : 'Failed to remove token from blacklist', true);\n  await loadBlacklistedTokens(); // re-sync state in case it was already removed\n}","preventionTips":["Refresh the blacklist before retrying a removal","Verify admin permission on the workspace before managing worker tokens","Treat 404 as success (token already removed) and re-sync the list"],"tags":["http","agents","token"],"backgroundTag":"http-error-response","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}