Cloud Agent wont save 504 error

Where does the bug appear (feature/product)?

Background Agent (GitHub, Slack, Web, Linear)

Describe the Bug

I’ve been trying to set up a Cursor Cloud agent for 2 days now. Every time the environment gets set up and I go to save the environment, I get a 504 Gateway Timeout. How can I resolve this? Is this a known issue?

Steps to Reproduce

Attempt to set up a Cursor Cloud agent using the Cursor Dashboard. Click the “Start Setup Agent” button, and wait for the environment to finish setting up. Attempt to save the environment.

Expected Behavior

The environment should be saved

Operating System

MacOS

Version Information

Cursor Dashboard

Does this stop you from using Cursor

Yes - Cursor is unusable

Exactly the same.

Failed to save: 504 while saving environment in cloud cursor WWW

POST https://cursor.com/api/background-composer/snapshot-and-save-environment
This requests get 504 and shows html page 500 server error

500

Internal Server Error.

hey @salehk and @Pk_code, thanks for sticking with this, the 504 on save matches a known backend issue on snapshot-and-save-environment we’re tracking in this thread; if you can drop the x-vercel-id from the failed request and whether you hit Save to Team or Personal team will be able to figure this out, also, check if the issue you got isn’t the one that got fixed in the thread some days ago already, happy to figure his out together

Hi Tom, I got my cloud environments working by setting up an environments.json, Dockerfile and CLOUD.md file setup in my .cursor directory, that seemed to fix the issue and I am able to use Cloud agents reliably.

Leaving this as a note for anyone who comes across this issue. Have an Agent set up these files above in the .cursor directory in the repo. Once you push the changes Cursor should automatically pick it up

Thanks for the update and the mention @salehk, and good thoughts of coming back to update the post!

@salehk glad it’s working, and thanks for coming back to post the fix - that’s the most reliable setup.

For anyone else hitting the 504 on save (@Pk_code ): the interactive “set up, then save” flow snapshots a live setup machine, and if that machine goes idle before you save, the snapshot step can time out - that’s the 504. Defining the environment declaratively avoids it: commit a .cursor/environment.json that points at a Dockerfile, and the environment builds fresh from that Dockerfile when the agent starts, so there’s no live snapshot to time out. A repo-level .cursor/environment.json also takes priority over saved snapshots.

Setup guide: Cloud Environment Setup | Cursor Docs — the CLOUD.md file isn’t needed for this, but it’s handy as agent context.