e2b-dev / e2b-dev/code-interpreter

Custom template fails to start after Node.js 24 update - WebSocket connection timeout

オープン
#144 コメント 2 件 リアクション 2 件 担当者 1 名 GitHub で見る

@jakubno がすでに取り組んでいます。

2025年10月17日 から。

bug Code Interpreter
主要言語
Python
スター
2.4k
フォーク
228
平均マージ
48分
マージ済み PR(30日)
5

説明

After yesterday's commit https://github.com/e2b-dev/code-interpreter/commit/d6f669540ac2e4f93b5f8d2dc4e6da04b61434ee, custom templates that update to Node.js 24 fail to start properly.

Problem

When building and pushing a custom template with Node.js 24, the sandbox fails to initialize with a WebSocket connection timeout error. The e2b SDK also reports that the port is not open when trying to call runCode.

Error Logs

During build/push post-check:

[2025-08-21T21:32:11Z] Saved: yy4y1lm84j3v2mg13ck2/dd3e6425-9397-40c8-9340-91595108e2bc
[2025-08-21T21:32:16Z] ...
[2025-08-21T21:32:17Z] [start] [stderr]: Failed to initialize default context:
[2025-08-21T21:32:17Z] [start] [stderr]: ERROR:    Traceback (most recent call last):
[2025-08-21T21:32:17Z] [start] [stderr]: File "/root/.server/.venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 647, in __await_impl_timeout__
[2025-08-21T21:32:17Z] [start] [stderr]: return await self.__await_impl__()
[2025-08-21T21:32:17Z] [start] [stderr]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-08-21T21:32:17Z] [start] [stderr]: File "/root/.server/.venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 654, in __await_impl__
[2025-08-21T21:32:17Z] [start] [stderr]: await protocol.handshake(
[2025-08-21T21:32:17Z] [start] [stderr]: File "/root/.server/.venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 319, in handshake
[2025-08-21T21:32:17Z] [start] [stderr]: status_code, response_headers = await self.read_http_response()
[2025-08-21T21:32:17Z] [start] [stderr]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-08-21T21:32:17Z] [start] [stderr]: File "/root/.server/.venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 139, in read_http_response
[2025-08-21T21:32:17Z] [start] [stderr]: status_code, reason, headers = await read_response(self.reader)
[2025-08-21T21:32:17Z] [start] [stderr]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-08-21T21:32:17Z] [start] [stderr]: File "/root/.server/.venv/lib/python3.12/site-packages/websockets/legacy/http.py", line 120, in read_response
[2025-08-21T21:32:17Z] [start] [stderr]: status_line = await read_line(stream)
[2025-08-21T21:32:17Z] [start] [stderr]: ^^^^^^^^^^^^^^^^^^^^^^^
[2025-08-21T21:32:17Z] [start] [stderr]: File "/root/.server/.venv/lib/python3.12/site-packages/websockets/legacy/http.py", line 194, in read_line
[2025-08-21T21:32:17Z] [start] [stderr]: line = await stream.readline()
[2025-08-21T21:32:17Z] [start] [stderr]: ^^^^^^^^^^^^^^^^^^^^^^^
[2025-08-21T21:32:17Z] [start] [stderr]: File "/usr/local/lib/python3.12/asyncio/streams.py", line 568, in readline
[2025-08-21T21:32:17Z] [start] [stderr]: line = await self.readuntil(sep)
[2025-08-21T21:32:17Z] [start] [stderr]: ^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-08-21T21:32:17Z] [start] [stderr]: File "/usr/local/lib/python3.12/asyncio/streams.py", line 660, in readuntil
[2025-08-21T21:32:17Z] [start] [stderr]: await self._wait_for_data('readuntil')
[2025-08-21T21:32:17Z] [start] [stderr]: File "/usr/local/lib/python3.12/asyncio/streams.py", line 545, in _wait_for_data
[2025-08-21T21:32:17Z] [start] [stderr]: await self._waiter
[2025-08-21T21:32:17Z] [start] [stderr]: asyncio.exceptions.CancelledError
[2025-08-21T21:32:17Z] [start] [stderr]: The above exception was the direct cause of the following exception:
[2025-08-21T21:32:17Z] [start] [stderr]: Traceback (most recent call last):
[2025-08-21T21:32:17Z] [start] [stderr]: File "/root/.server/.venv/lib/python3.12/site-packages/starlette/routing.py", line 732, in lifespan
[2025-08-21T21:32:17Z] [start] [stderr]: async with self.lifespan_context(app) as maybe_state:
[2025-08-21T21:32:17Z] [start] [stderr]: ^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-08-21T21:32:17Z] [start] [stderr]: File "/usr/local/lib/python3.12/contextlib.py", line 210, in __aenter__
[2025-08-21T21:32:17Z] [start] [stderr]: return await anext(self.gen)
[2025-08-21T21:32:17Z] [start] [stderr]: ^^^^^^^^^^^^^^^^^^^^^
[2025-08-21T21:32:17Z] [start] [stderr]: File "/root/.server/main.py", line 43, in lifespan
[2025-08-21T21:32:17Z] [start] [stderr]: javascript_context = await create_context(client, websockets, "javascript", "/home/user")
[2025-08-21T21:32:17Z] [start] [stderr]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-08-21T21:32:17Z] [start] [stderr]: File "/root/.server/contexts.py", line 58, in create_context
[2025-08-21T21:32:17Z] [start] [stderr]: await ws.connect()
[2025-08-21T21:32:17Z] [start] [stderr]: File "/root/.server/messaging.py", line 73, in connect
[2025-08-21T21:32:17Z] [start] [stderr]: self._ws = await connect(
[2025-08-21T21:32:17Z] [start] [stderr]: ^^^^^^^^^^^^^^
[2025-08-21T21:32:17Z] [start] [stderr]: File "/root/.server/.venv/lib/python3.12/site-packages/websockets/legacy/client.py", line 646, in __await_impl_timeout__
[2025-08-21T21:32:17Z] [start] [stderr]: async with asyncio_timeout(self.open_timeout):
[2025-08-21T21:32:17Z] [start] [stderr]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-08-21T21:32:17Z] [start] [stderr]: File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
[2025-08-21T21:32:17Z] [start] [stderr]: raise TimeoutError from exc_val
[2025-08-21T21:32:17Z] [start] [stderr]: TimeoutError
[2025-08-21T21:32:17Z] [start] [stderr]: ERROR:    Application startup failed. Exiting.
[2025-08-21T21:32:19Z] Template is ready
[2025-08-21T21:32:20Z] Saving layer: y16qom9xiqzeed327ccr/003a3382-c2f5-4be3-9561-efab81670fa5

When calling e2b SDK runCode:

❌ SandboxCommands.runClaudeCode failed: TimeoutError: {"sandboxId":"i5tkzt0h4esde0ccbopam","message":"The sandbox is running but port is not open","port":49999,"code":502}: This error is likely due to sandbox timeout. You can modify the sandbox timeout by passing 'timeoutMs' when starting the sandbox or calling '.setTimeout' on the sandbox with the desired timeout.

Reproduction Steps

  1. Create a custom Dockerfile based on e2bdev/code-interpreter:latest
  2. Add Node.js 24 installation:
FROM e2bdev/code-interpreter:latest

# Install required packages including sudo
RUN apt-get update && apt-get install -y \
    git \
    sudo \
    && rm -rf /var/lib/apt/lists/*

RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - && \
    apt-get install -y nodejs
  1. Build the template:
e2b template build -c "/root/.jupyter/start-up.sh"
  1. Push and try to run code via SDK

Expected Behavior

The sandbox should start successfully and accept WebSocket connections for code execution.

Actual Behavior

The sandbox fails to initialize with a WebSocket timeout error, and the port 49999 is not accessible.

Investigation

Through testing, I've identified that:

  • The issue occurs specifically after updating to Node.js 24
  • The same Dockerfile works without the Node.js 24 installation
  • The problem appears related to the recent commit mentioned above

Environment

  • Tested on both macOS and latest Ubuntu with identical results
  • Using e2b CLI for template building
  • e2b SDK for runtime execution

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。