- Notifications
You must be signed in to change notification settings - Fork923
Description
Problem Description
When using theworkspace_expose_port
function in Blink to expose port 3000 for a Next.js development server, the generated URL returns a502 Bad Gateway error from Koyeb.
Environment Details
- Platform: Koyeb Container workspace
- Application: Next.js 15.3.3 documentation website
- Port: 3000
- Generated URL:
https://3000-53efb5e2-adb5-4fea-9eb2-a6ca69a39f4c.build.party
- Error: 502 Bad Gateway
Steps to Reproduce
- Initialize a workspace using
workspace_initialize
- Create and run a Next.js application on port 3000
- Use
workspace_expose_port
with port 3000 - Navigate to the generated URL
- Observe 502 Bad Gateway error
Expected Behavior
The exposed URL should successfully proxy requests to the running Next.js development server and display the application.
Actual Behavior
The URL returns a 502 Bad Gateway error, indicating that Koyeb cannot reach the backend service.
Additional Context
- Chat Reference: This issue was discovered during a documentation website build session
- Development Server: The Next.js dev server was running successfully locally (
npm run dev
showed "Ready in 1287ms") - Workspace Status: The workspace appears to have been reset between the port exposure and URL access
- Console Output: Development server showed no errors when initially started
Technical Details
The development server was started with:
npm run dev
And showed successful startup:
▲ Next.js 15.3.3- Local: http://localhost:3000- Network: http://10.33.229.177:3000✓ Ready in 1287ms
However, when accessing the exposed URL, Koyeb returns a 502 error, suggesting either:
- The port forwarding/proxy configuration is incorrect
- The workspace container networking is not properly configured
- The service discovery mechanism is failing
Potential Root Causes
- Network Configuration: Koyeb proxy unable to reach the container's port 3000
- Service Discovery: The exposed port mechanism not properly registering the service
- Container Lifecycle: Workspace reset causing the service to become unavailable
- Port Binding: Next.js server not binding to the correct interface for external access
Requested Investigation
@mattvollmer@kylecarbs Could you please investigate:
- The Koyeb container networking configuration for exposed ports
- Whether there are specific requirements for how services should bind to ports
- If there are logs available from the Koyeb side showing the proxy attempts
- Whether workspace resets affect exposed port functionality
Workaround Needed
Currently, there's no reliable way to expose running services from Blink workspaces, which limits the ability to demonstrate web applications and APIs to users.
Labels: bug, networking, koyeb, workspace
Priority: High - affects core functionality of workspace port exposure