I’ve been trying to set up a new environment for two separate repositories but have been getting an error in return: “Agent encountered an error”, which has been cryptic.
I’ve tried following up with more messages to debug, but the error doesn’t budge.
Confirm the setup (I’ve included all secrets needed)
Observe the error after <5 min. In one case, I tried saving the cloud agent update script on the setup panel in the chat page after the “agent encountered an error” bug already occurred - it returned a 501 error.
Expected Behavior
The environment is setup successfully. Or if it was a config mistake on my end, surface details for my debugging purposes.
I see the screenshot with “Agent encountered an error”. A 501 error when saving the update script is definitely a server-side issue on our end, not a configuration problem.
A few questions to help with diagnosis:
Are these repos private or public?
About how large are they?
Have you been able to successfully set up cloud agent environments for other repos before, or is this your first attempt?
Also, can you check if the repos have an environment.json file (in the .cursor/ directory)? If it does, make sure the snapshot IDs listed there are real values, not placeholders. This has caused a similar issue before: Background agent fails to boot.
I’ll update you as soon as the team reviews the request IDs you shared.
Thanks for the details. Since there’s no environment.json and the repos are small, this is most likely a server-side issue on our end, not a config problem.
As a temporary workaround, you can try:
Disconnecting and reconnecting the Cursor GitHub App for those repos
Disconnecting and reconnecting the Cursor GitHub App didn’t work for me, though I did run the setup again within the next minute.
I poked around for a bit and found out removing the following secrets made it work: ALL_PROXY, HTTP_PROXY, HTTPS_PROXY. I originally thought to setup tailscale for my environment but eagerly shoved those values (from the docs) into the secrets.
Glad you figured it out! Proxy secrets (ALL_PROXY, HTTP_PROXY, HTTPS_PROXY) without a working Tailscale setup in that environment will break network access for the cloud agent since all traffic will try to go through a proxy that doesn’t exist.
Good point about the error messaging. “Agent encountered an error” without any details really doesn’t help with debugging. I’ll pass it to the team that we should make this message more informative, especially for network and proxy issues.