windmill-labs/windmill · error · Error

errorText || 'Failed to remove token from blacklist'

Error message

errorText || 'Failed to remove token from blacklist'

What it means

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.

Source

Thrown at frontend/src/lib/components/HttpAgentWorkerDrawer.svelte:115

			await loadBlacklistedTokens()
		} catch (error) {
			sendUserToast('Error blacklisting token: ' + error.body, true)
		}
	}

	async function removeFromBlacklist(tokenToRemove: string) {
		try {
			const response = await fetch('/api/agent_workers/remove_blacklist_token', {
				method: 'POST',
				headers: {
					'Content-Type': 'application/json'
				},
				body: JSON.stringify({ token: tokenToRemove })
			})

			if (!response.ok) {
				const errorText = await response.text()
				throw new Error(errorText || 'Failed to remove token from blacklist')
			}

			sendUserToast('Token successfully removed from blacklist')
			// Refresh the blacklist after removing a token
			await loadBlacklistedTokens()
		} catch (error) {
			sendUserToast('Error removing token from blacklist: ' + error.toString(), true)
		}
	}

	$effect(() => {
		if (selectedTab === 'blacklist' && $enterpriseLicense && $superadmin) {
			loadBlacklistedTokens()
		}
	})
</script>

<Tabs bind:selected={selectedTab}>

View on GitHub (pinned to e474e8803c)

Solutions

  1. Reload the blacklist list and retry (token may already be gone)
  2. Check the thrown errorText for the server's specific reason
  3. Verify you have permission to manage agent worker tokens
  4. Check backend logs if the status is 5xx
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

try {
  await removeFromBlacklist(tokenToRemove);
} catch (error) {
  sendUserToast(typeof error.message === 'string' && error.message
    ? error.message
    : 'Failed to remove token from blacklist', true);
  await loadBlacklistedTokens(); // re-sync state in case it was already removed
}

Prevention

When it happens

Trigger: POST to the blacklist-removal endpoint returns non-2xx — token no longer blacklisted/not found (404), permission denied (403), or server error (500).

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

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/370c64e5598361d3. Report an issue: GitHub.