[Root Cause Identified & Temporary Workaround] To Users and Google Developers struggling with Devcontainer connection issues

Hi everyone. After the latest update, I ran into the same frustrating “Code 127” and “WebSocket 1006” errors when trying to connect to my Devcontainers.

I’ve spent some time digging through the internal extension scripts and have identified the root cause of this regression. While I’ve officially reported this through the Antigravity editor (about 20 hours ago), I haven’t received a response yet. Seeing the growing number of people in this forum struggling with the same issue, I’ve decided to share what I’ve found as an emergency measure to help everyone get back to work.

:warning: Important Disclaimer

PLEASE NOTE: This is an unofficial, emergency, and temporary workaround. I take no responsibility for any issues caused by these manual changes. Use this at your own risk.


:magnifying_glass_tilted_left: The Problem: Path Mismatch

The antigravity-dev-containers extension currently fails to correctly generate the path for the remote server binary inside the container.

  • Editor sends: /home/node/.antigravity-server/bin/[HASH]/node
  • Actual path in container: /home/node/.antigravity-server/bin/[VERSION]-[HASH]/node (e.g., .../bin/1.16.5-1504c8.../node)

Because the IDE version prefix (like 1.16.5-) is missing in the command sent to the container, bash returns Exit Code 127 (File not found), and the connection drops immediately.


:hammer_and_wrench: Temporary Workaround for Users

Disclaimer: Use at your own risk. This involves modifying a file inside the Antigravity application package on your Host Mac.

  1. Open a terminal on your Host Mac.
  2. Locate the forwarder.js file at:
    /Applications/Antigravity.app/Contents/Resources/app/extensions/antigravity-dev-containers/scripts/forwarder.js
  3. Open this file in a text editor (you may need sudo or administrator privileges).
  4. Find the handleClient function (around line 284).
  5. Find the section where nodeCommand is constructed (around line 302).
  6. Replace the existing nodeCommand logic with this “Universal Path Resolver” snippet:
// REPLACE the existing nodeCommand construction with this:
nodeCommand =
  "TARGET=$(ls -d " +
  remoteServerNodePath.replace("/bin/", "/bin/*") +
  ' 2>/dev/null | head -n 1); [ -z "$TARGET" ] && TARGET="' +
  remoteServerNodePath +
  '"; "$TARGET" -e "' +
  nodeJsCode +
  '"';
  1. Save the file and restart Antigravity.

Note: This patch uses a shell wildcard (*) to dynamically find the correct directory even if the version number is unknown to the host script, making it robust against future updates.


:light_bulb: Recommendation for Google/Antigravity Developers

The regression is in the host-side logic that determines remoteServerNodePath. It appears to be ignoring the version-prefixed directory structure currently used by the server installation script inside the container.

Please update the path generation logic to include the IDE version prefix, or officially adopt a more robust path discovery mechanism (wildcard-based) similar to the one proposed above to prevent future breakages when versions change.


Hope this helps the community!

5 Likes

I can confirm this fix also works on Windows and Linux. Thank you!

1 Like

And confirming for arch aswell.
Path is here: `/usr/lib/antigravity/extensions/antigravity-dev-containers/scripts/forwarder.js`

The advantage of this solution is that you only need to configure it once and it will work for all your dev containers.

Since changing forwarder.js, it has worked fine in all containers without any issues.

Just a comment, in windows the path of the file is:
C:\Users\<user_name>\AppData\Local\Programs\Antigravity\resources\app\extensions\antigravity-dev-containers\scripts