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

WebSocket failed to start #334

Open
mlejva opened this issue Mar 11, 2024 · 2 comments
Open

WebSocket failed to start #334

mlejva opened this issue Mar 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@mlejva
Copy link
Member

mlejva commented Mar 11, 2024

Some users have reported a WebSocket error when using our SDK that looks like this

WebSocket failed to start: WebSocket failed to start

The goal of this issue is to track the reported incidents while we're finding out the cause.

@mlejva mlejva added the bug Something isn't working label Mar 11, 2024
@xiaotiancaipro
Copy link

xiaotiancaipro commented Mar 12, 2024

Yes, I encountered this error, and here is what it said:

INFO:e2b.sandbox.sandbox_connection:Sandbox fv7bfqp4wyo42829htzt created (id:ixooqqr5ho1dop95j39mc-3c0b8d1b)
INFO:e2b.sandbox.sandbox_connection:Started refreshing sandbox fv7bfqp4wyo42829htzt (id: ixooqqr5ho1dop95j39mc-3c0b8d1b)
INFO:e2b.sandbox.sandbox_rpc:WebSocket waiting to start
ERROR:e2b.sandbox.sandbox_rpc:WebSocket failed to start
ERROR:e2b.sandbox.sandbox_connection:WebSocket failed to start: WebSocket failed to start
INFO:e2b.sandbox.sandbox_connection:Closing sandbox fv7bfqp4wyo42829htzt (id: ixooqqr5ho1dop95j39mc-3c0b8d1b)
ERROR:core.application_manager:Unknown Error when generating
Traceback (most recent call last):
  File "/opt/anaconda3/envs/test/lib/python3.10/site-packages/e2b/sandbox/sandbox_rpc.py", line 109, in connect
    raise TimeoutException("WebSocket failed to start")
e2b.sandbox.exception.TimeoutException: WebSocket failed to start

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/xiaotiancaipro/Documents/test/api/core/application_manager.py", line 214, in _generate_worker
    runner.run(
  File "/Users/xiaotiancaipro/Documents/test/api/core/app_runner/assistant_app_runner.py", line 336, in run
    self._handle_invoke_result(
  File "/Users/xiaotiancaipro/Documents/test/api/core/app_runner/app_runner.py", line 235, in _handle_invoke_result
    self._handle_invoke_result_stream(
  File "/Users/xiaotiancaipro/Documents/test/api/core/app_runner/app_runner.py", line 268, in _handle_invoke_result_stream
    for result in invoke_result:
  File "/Users/xiaotiancaipro/Documents/test/api/core/features/assistant_pos_runner.py", line 67, in run
    task_scheduler = Scheduler(
  File "/Users/xiaotiancaipro/Documents/test/api/core/scheduler.py", line 60, in __init__
    self.__run_task_chain()
  File "/Users/xiaotiancaipro/Documents/test/api/core/scheduler.py", line 282, in __run_task_chain
    task_result = task.run()
  File "/Users/xiaotiancaipro/Documents/test/api/core/tools/data_analysis_tool.py", line 112, in run
    flag, stdout, stderr, artifacts = self.__run_code(file=file, code=code)
  File "/Users/xiaotiancaipro/Documents/test/api/core/tools/data_analysis_tool.py", line 173, in __run_code
    flag = sandbox.create()
  File "/Users/xiaotiancaipro/Documents/test/api/clients/sandbox_client.py", line 17, in create
    self.__client = CodeInterpreter(api_key=config.E2B_API_KEY)
  File "/opt/anaconda3/envs/test/lib/python3.10/site-packages/e2b/templates/data_analysis.py", line 46, in __init__
    super().__init__(
  File "/opt/anaconda3/envs/test/lib/python3.10/site-packages/e2b/sandbox/main.py", line 135, in __init__
    super().__init__(
  File "/opt/anaconda3/envs/test/lib/python3.10/site-packages/e2b/sandbox/sandbox_connection.py", line 132, in __init__
    self._open(metadata=metadata, timeout=timeout)
  File "/opt/anaconda3/envs/test/lib/python3.10/site-packages/e2b/sandbox/main.py", line 316, in _open
    super()._open(metadata=metadata, timeout=timeout)
  File "/opt/anaconda3/envs/test/lib/python3.10/site-packages/e2b/sandbox/sandbox_connection.py", line 278, in _open
    raise e
  File "/opt/anaconda3/envs/test/lib/python3.10/site-packages/e2b/sandbox/sandbox_connection.py", line 274, in _open
    self._connect_rpc(timeout)
  File "/opt/anaconda3/envs/test/lib/python3.10/site-packages/e2b/sandbox/sandbox_connection.py", line 289, in _connect_rpc
    self._rpc.connect(timeout=timeout)
  File "/opt/anaconda3/envs/test/lib/python3.10/site-packages/e2b/sandbox/sandbox_rpc.py", line 116, in connect
    raise SandboxException(f"WebSocket failed to start: {e}") from e
e2b.sandbox.exception.SandboxException: WebSocket failed to start: WebSocket failed to start

My code is :

from e2b import CodeInterpreter
client = CodeInterpreter(api_key=config.E2B_API_KEY)

and the version is e2b==0.14.4.

@mlejva
Copy link
Member Author

mlejva commented Mar 13, 2024

Another user reported a following error

HTTPException(status_code=400, detail='WebSocket failed to start: WebSocket failed to start')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🚧 Working on it
Development

No branches or pull requests

2 participants