`workers versions list` and `get` return 500 for a Worker with a placement region
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 54/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- api
Research direction
The report identifies the failing cf workers versions list and get commands and the API endpoint, but says the serialization error comes from the Workers API rather than the CLI. Start by tracing the versions commands to the API request and checking whether this repository contains relevant tests or handling for placement. Done means versions for a Worker with placement can be read successfully, including the placement and startup time.
Written by the indexing model from the issue text.
Description
Summary of the issue
cf workers versions list and cf workers versions get fail with a 500 for any Worker deployed with a placement region. The API cannot serialize the version's placement:
json: error calling MarshalJSON for type *placement.Placement: invalid placement target type:
The Worker is configured in cloudflare.config.ts with:
placement: { region: 'aws:eu-central-1' }
cf deploy accepts this and the Worker runs with it. Only reading a version back fails. The same commands work on a Worker without placement in the same account. cf workers deployments list works on the affected Worker.
Expected behaviour
cf workers versions list --worker-id <worker> returns the versions, including startup_time_ms and the placement, as it does for a Worker without placement.
Version of cf used
1.0.0-beta.12
System information and package versions
System:
OS: macOS 26.7.1
CPU: (11) arm64 Apple M3 Pro
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.18.0
npm: 11.16.0
pnpm: 12.8.1
Reproduction (optional)
- Deploy a Worker with
placement: { region: 'aws:eu-central-1' }incloudflare.config.ts(cf deploy). cf workers versions list --worker-id <worker> --per-page 1cf workers versions get <version-id> --worker-id <worker>
Both return the 500 below. Running step 2 on a Worker without placement returns its versions normally.
Relevant error logs (optional)
┌ APIError
│ Status code: 500
│ Body: "json: error calling MarshalJSON for type *placement.Placement: invalid placement target type: \n"
│ 500 Internal Server Error · HTTP /accounts/<account_id>/workers/workers/<worker>/versions?per_page=1
└
The error comes from the API (GET /accounts/{account_id}/workers/workers/{worker_id}/versions), not the CLI. It may belong with the Workers API team, but cf has no other way to read a version, so I'm filing it here.
- Dominant language
- TypeScript
- Stars
- 916
- Forks
- 53
- Avg merge
- 18h 31m
- Merged PRs (30d)
- 172
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/cf
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/cf#344 ·
Maintainers usually reply within 1 day
-
upstream
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cloudflare/cf#262 ·
Maintainers usually reply within 1 day
-
`cf dev` rejects `--port` and `--host` for Vite projects, including the `cf init` templatePossibly taken @jamesopstad claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cloudflare/cf#223 · 2 assignees ·
Maintainers usually reply within 1 day
-
upstream
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cloudflare/cf#179 ·
Maintainers usually reply within 1 day
-
upstream
Difficulty 4/5 3-5 days Newbie friendliness 58/100
cloudflare/cf#347 ·
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
endora-commerce/endora-commerce#397 ·
Maintainers usually reply within 1 day
-
level/task
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wazuh/wazuh-dashboard-plugins#9472 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
xavxyz/bei-shan-lin-shui#57 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opennextjs/opennextjs-cloudflare#1461 ·
Maintainers usually reply within 1 day