Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix forward_ports service and return useful nginx errors #265

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

0div
Copy link
Contributor

@0div 0div commented Jan 29, 2025

Description

Port forwaring

Use iptables to forward all localhost <> fc-ip ports instead of legacy port forwarding in envd-v0.0.1

They missing key seems to be to enable /proc/sys/net/ipv4/conf/eth0/route_localnet

Useful proxy error

When 502 happens at the session proxy (sandbox) level , we return a useful error depending on the user agent

Browser

Screenshot 2025-01-29 at 7 07 20 PM

API

jonas@mac js-sdk % curl -I https://3000-ihdzded4euz80ajegucyk-615d2cc7.goulash.dev/
HTTP/2 502
server: nginx/1.27.0
date: Thu, 30 Jan 2025 03:11:03 GMT
content-type: text/html
content-length: 111
via: 1.1 google
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000

{"error": "The sandbox is running but port is not open", "sandboxId": "ihdzded4euz80ajegucyk", "port": ":3000"}

Test

I built a template with this new provision and all js-sdk tests pass.

@0div 0div added the improvement Improvement for current functionality label Jan 29, 2025
@0div 0div self-assigned this Jan 29, 2025
…rror-indicating-that-the-sandbox-port-is-not-open-e2b-1329
@ValentaTomas
Copy link
Member

One consideration here—one of the other reasons why we had the old envd there was because of the compatibility with the old SDK for now.

Does this change works when the old env is still present and tries to also forward the ports?

@0div
Copy link
Contributor Author

0div commented Jan 29, 2025

Does this change works when the old env is still present and tries to also forward the ports?

It works with both running yeah, but :sad face: i was hoping we could stop using old envd for good

@0div 0div changed the title Fix forward_ports service and disable envd-v0.0.1 service Fix forward_ports service and return useful nginx errors Jan 30, 2025
@mlejva mlejva self-requested a review January 30, 2025 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement for current functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants