Cloud sandbox: VM reaches running and noVNC works, but computer-server control API (*-api.cua.sh /cmd, /ws) returns persistent HTTP 502; cua-sandbox stuck in _wait_for_server_ready
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 24.2k
- Forks
- 1.7k
- Avg merge
- 22h 29m
- Merged PRs (30d)
- 190
Description
Summary
On freshly created cloud Linux sandboxes ("source": "incus"), the VM reaches status: running and the noVNC web desktop works, but the computer-server control API endpoint returns HTTP 502 Bad Gateway on every request. As a result the official cua-sandbox Python SDK can never connect; it loops in _wait_for_server_ready for 6+ minutes and times out.
It looks like the public gateway/proxy for *-api.cua.sh is up (it answers, with 502), but the computer-server upstream inside the incus VM is not listening / not routed. The noVNC path (*-vnc.cua.sh) on the same VM works fine, so this seems isolated to the control-API route, not the VM itself.
Environment
cua-sandboxPython SDK v0.1.16- Cloud sandbox, OS: linux,
"source": "incus" - Created via
POST https://api.cua.ai/v1/vms(also reproduces through the SDK)
Steps to reproduce
- Create a cloud Linux VM:
succeeds; VM transitions toPOST https://api.cua.ai/v1/vms Authorization: Bearer <CUA_API_KEY> {"os": "linux", "region": "us-east-1", "configuration": "small"}status: running("source": "incus"). - Open the noVNC desktop:
https://<name>-vnc.cua.sh/vnc.htmlreturns HTTP 200, desktop renders. OK - Hit the computer-server control API on the same VM:
ReturnsGET/POST https://<name>-api.cua.sh/cmd -> HTTP 502 Bad Gateway WS wss://<name>-api.cua.sh/ws -> fails (502 / cannot upgrade)502on every request, on every fresh VM, sustained over several minutes (not a boot delay). - The SDK resolves the endpoint to
https://<name>-api.cua.sh/cmdand loops in_wait_for_server_ready, receiving 404/502, never becoming ready (times out after 6+ min).
Expected
The computer-server control API (/cmd, /ws) on <name>-api.cua.sh should become reachable once the VM is running, so the SDK's _wait_for_server_ready succeeds and screenshot/click/type work, matching what the noVNC endpoint already does.
Actual
<name>-vnc.cua.sh returns 200 (works), but <name>-api.cua.sh/cmd + /ws return persistent 502 Bad Gateway; the SDK never connects.
Questions
- Is the computer-server expected to be auto-started and routed on cloud
incusLinux VMs, or does it require a manual start / specific image / plan / region? - Is the
502on*-api.cua.sh(while*-vnc.cua.shis healthy) a known gateway/routing issue on the cloud incus image? - If there is a flag, region, or plan tier required for the control API to be exposed, could that be documented? I did not find it in the cloud docs.
Happy to provide the exact VM name, job_id, and timestamps privately if useful. Thanks!
Contributor 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.
Research direction
Start by reproducing the cloud Linux VM flow from POST /v1/vms, then inspect the endpoint used by the SDK's _wait_for_server_ready. Compare the working *-vnc.cua.sh route with the failing *-api.cua.sh /cmd and /ws routes. Done means the control API is reachable after the VM reports running and the SDK completes readiness checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100