[Bug]: Failed to create agent session: ReadTimeout on start up.
Is there an existing issue for the same bug? (If one exists, thumbs up or comment on the issue instead).
- [x] I have checked the existing issues.
Describe the bug and reproduction steps
i followed https://docs.all-hands.dev/modules/usage/installation, ran it with docker on ubuntu24.04. but got this error on start up. i checked exsited issues, and didnt get a solution. like this one. it would be great, if anyone help me figure it out.
OpenHands Installation
Docker command in README
OpenHands Version
0.39
Operating System
Linux
Logs, Errors, Screenshots, and Additional Context
` ~ docker run -it --rm --pull=always
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik
-e LOG_ALL_EVENTS=true
-v /var/run/docker.sock:/var/run/docker.sock
-v ~/.openhands-state:/.openhands-state
-p 3000:3000
--add-host host.docker.internal:host-gateway
--name openhands-app
docker.all-hands.dev/all-hands-ai/openhands:0.39
0.39: Pulling from all-hands-ai/openhands
Digest: sha256:bfdba1ffb63ef488ac394027fa0f181dfe823db315af79ff54bbde588c174519
Status: Image is up to date for docker.all-hands.dev/all-hands-ai/openhands:0.39
Starting OpenHands...
Running OpenHands as root
03:01:16 - openhands:INFO: server_config.py:50 - Using config class None
INFO: Started server process [8]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:3000 (Press CTRL+C to quit)
INFO: 192.168.1.239:63725 - "GET /api/options/config HTTP/1.1" 200 OK
INFO: 192.168.1.239:63726 - "GET /api/settings HTTP/1.1" 200 OK
03:06:18 - openhands:INFO: manage_conversations.py:193 - Initializing new conversation
03:06:18 - openhands:INFO: manage_conversations.py:90 - Creating conversation
03:06:18 - openhands:INFO: manage_conversations.py:98 - Loading settings
03:06:18 - openhands:INFO: manage_conversations.py:101 - Settings loaded
03:06:18 - openhands:INFO: manage_conversations.py:127 - Loading conversation store
03:06:18 - openhands:INFO: manage_conversations.py:129 - Conversation store loaded
03:06:18 - openhands:INFO: manage_conversations.py:135 - New conversation ID: acc0ef74a877420882b9102331de682f
03:06:18 - openhands:INFO: manage_conversations.py:142 - Saving metadata for conversation acc0ef74a877420882b9102331de682f
03:06:18 - openhands:INFO: manage_conversations.py:154 - Starting agent loop for conversation acc0ef74a877420882b9102331de682f
03:06:18 - openhands:INFO: standalone_conversation_manager.py:249 - maybe_start_agent_loop:acc0ef74a877420882b9102331de682f
03:06:18 - openhands:INFO: standalone_conversation_manager.py:265 - starting_agent_loop:acc0ef74a877420882b9102331de682f
03:06:18 - openhands:INFO: manage_conversations.py:176 - Finished initializing conversation acc0ef74a877420882b9102331de682f
03:06:18 - openhands:INFO: session.py:149 - Enabling default condenser: type='pipeline' condensers=[BrowserOutputCondenserConfig(type='browser_output_masking', attention_window=2), LLMSummarizingCondenserConfig(type='llm', llm_config=LLMConfig(model='openrouter/meta-llama/llama-3-8b-instruct:free', api_key=''(''), base_url='', api_version=None, aws_access_key_id='', aws_secret_access_key='****', aws_region_name=None, openrouter_site_url='https://docs.all-hands.dev/', openrouter_app_name='OpenHands', num_retries=4, retry_multiplier=2, retry_min_wait=5, retry_max_wait=30, timeout=None, max_message_chars=30000, temperature=0.0, top_p=1.0, top_k=None, custom_llm_provider=None, max_input_tokens=4096, max_output_tokens=8192, input_cost_per_token=None, output_cost_per_token=None, ollama_base_url=None, drop_params=True, modify_params=True, disable_vision=None, caching_prompt=True, log_completions=False, log_completions_folder='/app/logs/completions', custom_tokenizer=None, native_tool_calling=None, reasoning_effort='high', seed=None), keep_first=4, max_size=80, max_event_length=10000)]
03:06:18 - openhands:INFO: conversation_summary.py:92 - Auto-generating title for conversation acc0ef74a877420882b9102331de682f
INFO: 192.168.1.239:63726 - "POST /api/conversations HTTP/1.1" 200 OK
INFO: 192.168.1.239:63726 - "GET /api/conversations/acc0ef74a877420882b9102331de682f HTTP/1.1" 200 OK
INFO: ('192.168.1.239', 63750) - "WebSocket /socket.io/?latest_event_id=-1&conversation_id=acc0ef74a877420882b9102331de682f&providers_set=&session_api_key=null&EIO=4&transport=websocket" [accepted]
INFO: connection open
03:06:18 - openhands:INFO: listen_socket.py:54 - sio:connect: IB3lxKaaJPTUlNyWAAAB
03:06:18 - openhands:INFO: standalone_conversation_manager.py:123 - join_conversation:acc0ef74a877420882b9102331de682f:IB3lxKaaJPTUlNyWAAAB
03:06:18 - openhands:INFO: standalone_conversation_manager.py:249 - maybe_start_agent_loop:acc0ef74a877420882b9102331de682f
03:06:18 - openhands:INFO: listen_socket.py:118 - Connected to conversation acc0ef74a877420882b9102331de682f with connection_id IB3lxKaaJPTUlNyWAAAB. Replaying event stream...
03:06:18 - openhands:INFO: listen_socket.py:142 - Finished replaying event stream for conversation acc0ef74a877420882b9102331de682f
03:06:19 - openhands:INFO: docker_runtime.py:166 - [runtime acc0ef74a877420882b9102331de682f] Starting runtime with image: docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik
03:06:20 - openhands:INFO: docker_runtime.py:170 - [runtime acc0ef74a877420882b9102331de682f] Container started: openhands-runtime-acc0ef74a877420882b9102331de682f. VSCode URL: None
03:06:20 - openhands:INFO: docker_runtime.py:181 - [runtime acc0ef74a877420882b9102331de682f] Waiting for client to become ready at http://host.docker.internal:37354...
03:07:22 - openhands:INFO: docker_runtime.py:187 - [runtime acc0ef74a877420882b9102331de682f] Runtime is ready.
03:07:23 - openhands:INFO: base.py:700 - [runtime acc0ef74a877420882b9102331de682f] Selected repo: None, loading microagents from /workspace/.openhands/microagents (inside runtime)
03:07:23 - openhands:INFO: memory.py:252 - Loading user workspace microagents: []
03:07:23 - openhands:INFO: utils.py:183 - Added microagent stdio server: fetch
03:07:33 - openhands:INFO: agent_session.py:194 - Agent session start
03:07:33 - openhands:ERROR: session.py:201 - Error creating agent_session: timed out
Traceback (most recent call last):
File "/app/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
yield
File "/app/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 250, in handle_request
resp = self._pool.handle_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 256, in handle_request
raise exc from None
File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 236, in handle_request
response = connection.handle_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 103, in handle_request
return self._connection.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/http11.py", line 136, in handle_request
raise exc
File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/http11.py", line 106, in handle_request
) = self._receive_response_headers(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/http11.py", line 177, in _receive_response_headers
event = self._receive_event(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/httpcore/_sync/http11.py", line 217, in _receive_event
data = self._network_stream.read(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/httpcore/_backends/sync.py", line 126, in read
with map_exceptions(exc_map):
File "/usr/local/lib/python3.12/contextlib.py", line 158, in exit
self.gen.throw(value)
File "/app/.venv/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ReadTimeout: timed out
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/openhands/server/session/session.py", line 167, in initialize_agent
await self.agent_session.start(
File "/app/openhands/server/session/agent_session.py", line 155, in start
await add_mcp_tools_to_agent(agent, self.runtime, self.memory, config.mcp)
File "/app/openhands/mcp/utils.py", line 186, in add_mcp_tools_to_agent
updated_mcp_config = runtime.get_updated_mcp_config(extra_stdio_servers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/openhands/runtime/impl/action_execution/action_execution_client.py", line 371, in get_updated_mcp_config
response = self._send_action_server_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/tenacity/init.py", line 338, in wrapped_f
return copy(f, *args, **kw)
^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/tenacity/init.py", line 477, in call
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/tenacity/init.py", line 378, in iter
result = action(retry_state)
^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/tenacity/init.py", line 400, in
same problem
i have switched from windows to linux but i still get the same problem
Same problem, lost 1 day with this error :c
same
Hi there folks. Sorry you're running into this issue. What LLMs are you all using?
In the post, I see openrouter/meta-llama/llama-3-8b-instruct:free is being used. This won't work with OpenHands. I do think it should error out better, but OpenHands requires a fairly powerful LLM.
See some of the recommended models here: https://docs.all-hands.dev/modules/usage/llms#model-recommendations
Hi there folks. Sorry you're running into this issue. What LLMs are you all using? In the post, I see
openrouter/meta-llama/llama-3-8b-instruct:freeis being used. This won't work with OpenHands. I do think it should error out better, but OpenHands requires a fairly powerful LLM. See some of the recommended models here: https://docs.all-hands.dev/modules/usage/llms#model-recommendations
i use deepseek-chat but still fail
ohmygod im ok now thank all of you
@rondocc can you mention what you did to resolve your particular issue?
@rondocc can you mention what you did to resolve your particular issue?您能说说是如何解决您的特殊问题的吗?
i just create another api use it
Hi there folks. Sorry you're running into this issue. What LLMs are you all using? In the post, I see
openrouter/meta-llama/llama-3-8b-instruct:freeis being used. This won't work with OpenHands. I do think it should error out better, but OpenHands requires a fairly powerful LLM. See some of the recommended models here: https://docs.all-hands.dev/modules/usage/llms#model-recommendations
I use claude 3.7 Sonnet.
Hi there folks. Sorry you're running into this issue. What LLMs are you all using? In the post, I see
openrouter/meta-llama/llama-3-8b-instruct:freeis being used. This won't work with OpenHands. I do think it should error out better, but OpenHands requires a fairly powerful LLM. See some of the recommended models here: https://docs.all-hands.dev/modules/usage/llms#model-recommendations
i see. i just chose one randomly for test. maybe there is a bug with litellm. i tried its colab ipynb example, but failed to get response from openrouter. i changed to other model like openrouter/deepseek/deepseek-chat-v3-0324 and it worked.
well, it still failed on openhands. i tried serveral combinations of model setting, like this one below. i may try other api providers next.
maybe we need an icon to show if the model work
maybe we need an icon to show if the model work
I support! At the moment there is an icon above the API key, which is very misleading, I focused on it right away, until I realized that it does not display anything.
same problem,i lose 2 days。 I think the docker.all-hands.dev/all-hands-ai/runtime image is just starting up too slowly, so docker.all-hands.dev/all-hands-ai/openhands ends up timing out while waiting for it.
I am using all-hands_openhands-lm-32b-v0.1, an all-hands model, designed for use with open hands, and i'm still getting this error.
same problem,i lose 2 days。 I think the docker.all-hands.dev/all-hands-ai/runtime image is just starting up too slowly, so docker.all-hands.dev/all-hands-ai/openhands ends up timing out while waiting for it.
how do u solve, any solution? i lose 1.5 day...
The solution for this issue is:
sudo iptables -I INPUT 1 -s 172.17.0.0/16 -j ACCEPT
sudo iptables -I INPUT 1 -s 172.18.0.0/16 -j ACCEPT