Cannot create or set a new workers build api token (bug?)

For Workers & Pages, what is the name of the domain?

universal.oroborus.org

What is the issue or error you’re encountering

I cannot set a new workers build api token. I accidentally deleted my workers->settings->build->API token (Workers Builds - 2025-02-26 15:48), when I try to create a new one using the + Create New Token drop-down, it won’t let me saying These rules must pass for{ “act”: “user”, “sparams”: “tokens”, “name”: “Workers Builds - 2025-03-10 20:26”, “scopes”: { }, “permissionGroupKeys”: { }, … } - policies must be present.

What steps have you taken to resolve the issue?

  • I’ve tried auto-generating a new token by clicking + Create New Token button inside the workers->settings->build->API token dialog

    • PROBLEM: when I click + Create New Token it inserts a new token name with the current date (Workers Builds - 2025-03-10 20:29), but when I click update a red banner appears at the bottom which says: These rules must pass for { “act”: “user”, “sparams”: “tokens”, “name”: “Workers Builds - 2025-03-10 20:26”, “scopes”: { }, “permissionGroupKeys”: { }, … } - policies must be present. The update does not work.
  • I have tried following Configuration · Cloudflare Workers docs to manually create a build token named Worker Builds - hand regenerated mar 10.

    • The Worker Builds - hand regenerated mar 10 token appears in Account API Tokens, its the only one listed
    • PROBLEM: it does NOT show up inside the workers->settings->build-API token dialog.
      • This dialog DOES show the name of the old/deleted API token, which is NOT present on “Account API Tokens” because it was deleted from there by accident.

As a result, I cannot fix my build which says:

19:09:44.083	Initializing build environment...
19:09:52.859	Success: Finished initializing build environment
19:09:53.561	Failed: The build token selected for this build has been deleted or rolled and cannot be used for this build. Please update your build token in the Worker Builds settings and retry the build.

As it should! I deleted the token in “Account API Tokens” by accident, so of course its broken. What’s crazy is that its stuck with the old token name that doesn’t exist, and I can’t auto-generate a new one OR select a manually generated one.

Screenshot of the error

I suspect this issues reported 9 hours ago is the same bug in cloudflare: Unable to use a new workers API token

I’m not confident though, because its a very sparse description.

1 Like

Here’s the options available in the Set the API token used for your build dialog:

  • Notice the old (deleted) build token is still listed
  • Clicking create new token and then update leads to the red banner in the first screenshot

Here’s what Manage Account -> Account API Tokens looks like

  • Notice that there’s a manually hand-generated token I made here according to cloudflare docs
  • Notice that it does NOT appear in the previous image, its not listed as an option

It is… I do agree that the description is very sparse but that is pretty much it :slight_smile:

1 Like

Hi,

Same issue here when trying to connect a Github account to an existing worker. API calls to POST https://dash.cloudflare.com/api/v4/user/tokens returns this 400 error:

{
    "success": false,
    "errors": [
        {
            "code": 400,
            "message": "- These rules must pass for `{ \"act\": \"user\", \"sparams\": \"tokens\", \"name\": \"Workers Builds - 2025-03-12\", \"scopes\": { }, \"permissionGroupKeys\": { }, ... }`\n  - policies must be present"
        }
    ],
    "messages": [],
    "result": null
}

Its frustrating they don’t pass the whole error message, if they didn’t ... ellipsize the error, we might be able to make some progress laugh :laughing:

At least I know its not just me.

Hey, this should now be resolved:

1 Like

TY! I can confirm the fix worked, I was able to generate a new build token. I would insert a heart emoji if I wasn’t having an emoji bug with macOS at the same time lol.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.