Cloud Agent setup fails: “Failed to create testing environment: [invalid_argument] Error”

I can’t complete Cloud Agent environment setup. It fails at “Creating testing environment” with:

[Warning] Failed to create testing environment: [invalid_argument] Error

It retries 3 times and then fails.

  • Repo: robert-whiteley/rawbot (no submodules; no .gitmodules; git submodule status is empty)

  • GitHub app is installed and has access to the repo

  • Tried multiple install/start command variants (including installing python3-venv), still fails before/at env creation

I’m using WSL, Ubuntu. I want to be able to code on my phone.

Has anyone seen this recently / found a workaround?

2 Likes

Hey, a couple of questions to help narrow down what’s going wrong:

  1. What version of Cursor are you on? (Help > About Cursor > Copy)
  2. Do you have a .cursor/environment.json file in the repo? If yes, can you share its contents?
  3. What install and start commands do you have set in Cursor Settings > Cloud Agents > Environment?
  4. Are you using a Dockerfile or the interactive Manual Snapshot setup?
  5. Can you send the full setup output log (including the Snapshot ID, if it shows up)?

In the meantime, you can try this:

  • If you don’t have .cursor/environment.json, create it with a minimal config:
    {
      "snapshot": "POPULATED_FROM_SETTINGS",
      "install": "pip install -r requirements.txt"
    }
    
  • Try using a Dockerfile instead of Manual Snapshot. Docs: Cloud Agents | Cursor Docs (see “Manual Setup with Dockerfile”)
  • Re-run the setup flow: Cmd+Shift+P > Cursor: Start Cloud Agent Setup

The team is aware of a few Cloud Agent environment setup issues and is working on improving infrastructure stability.

Share the details above and we’ll dig in further.

Same issue here:

[Status] Creating testing environment... (Snapshot ID: snapshot-20260212-396ace99-c513-4a8c-a598-151a284165a8, Request ID: 8d3199a1-a20d-429d-a842-f969b25dd5d2)
[Warning] Failed to create testing environment: [invalid_argument] Error
[Retry] Retrying in 2 seconds (Attempt 2/3)...
[Status] Creating testing environment... (Attempt 2/3) (Snapshot ID: snapshot-20260212-396ace99-c513-4a8c-a598-151a284165a8, Request ID: 43905235-85cf-443a-a9d0-458184ef3f97)
[Warning] Failed to create testing environment: [invalid_argument] Error
[Retry] Retrying in 2 seconds (Attempt 3/3)...
[Status] Creating testing environment... (Attempt 3/3) (Snapshot ID: snapshot-20260212-396ace99-c513-4a8c-a598-151a284165a8, Request ID: 5eddb1d0-3092-4837-940b-65f5e5a9847a)
[STATUS UPDATE] failed
[Error] Failed to create testing environment after 3 attempts: [invalid_argument] Error

minimal config:

{
  "snapshot": "POPULATED_FROM_SETTINGS",
  "install": "npm install"
}

So that doesn’t work at all

Using the alternative Dockerfile approach is missing so much context in documentation that it’s like a shot in the dark. We have a repo full of Dockerfiles, can I use an external source [ie private github repo] for a baseline cursor Dockerfile? Where does the docker build occur and can I monitor it?

The only way I could get cursor to detect the environment.json changes for Dockerfile was to close it and reopen it again - restarting the cloud agent set up from the settings view.

@rcwhiteley try this:

Create a Dockerfile in the .cursor directory

# Use the official Ubuntu image as the base image.
# You can specify a tag like ubuntu:22.04 or ubuntu:latest
FROM ubuntu:24.04

# Set the working directory inside the container (optional)
WORKDIR /

# The command to run when the container starts
CMD ["/bin/bash"]

Make sure you have this in the environment.json file:

 "build": {
    "dockerfile": "Dockerfile",
    "context": "."
...

Then close out Cursor and reopen click on Cursor Settings → Cloud Agents

You should see an option to take a snapshot under “workspace configuration” - take the snapshot. :man_shrugging:

It might work, then you can adjust the Dockerfile accordingly and maybe get an actual working environment.

Overall experience 2/10 - a solid “meh”.