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

[Bug]: openhands stops and freez after some time after 15 interactions with deepseek #6104

Open
1 task done
Elias966 opened this issue Jan 7, 2025 · 3 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@Elias966
Copy link

Elias966 commented Jan 7, 2025

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Describe the bug and reproduction steps

openhands stops and freeze after 10 to 15 interaction with deepseek model and have like infinit loading until i ctrl+c in terminal to restart it again and the cycle starts again after turning it on again, i dont know if this problem happens with other models

start docker command normally and chose deepseek and deepseek-coder or -chat models then send a command and you will see that after 10 to 15 or 20 interactions with terminal and writing code it goes into infinite loop

OpenHands Installation

Docker command in README

OpenHands Version

0.18

Operating System

WSL on Windows

Logs, Errors, Screenshots, and Additional Context

INFO: 172.17.0.1:47036 - "GET /api/options/config HTTP/1.1" 200 OK
INFO: 172.17.0.1:47046 - "GET /api/settings HTTP/1.1" 200 OK
05:46:46 - openhands:INFO: manager.py:202 - Conversation 354c303eadf848feb1d6e68fc38fd071 connected in 0.06116938591003418 seconds
05:46:46 - openhands:INFO: manager.py:184 - Reusing active conversation 354c303eadf848feb1d6e68fc38fd071
INFO: 172.17.0.1:47058 - "GET /api/conversations/354c303eadf848feb1d6e68fc38fd071/vscode-url HTTP/1.1" 200 OK
INFO: 172.17.0.1:47056 - "GET /api/conversations/354c303eadf848feb1d6e68fc38fd071/list-files HTTP/1.1" 200 OK
INFO: 172.17.0.1:34642 - "GET /api/options/config HTTP/1.1" 200 OK
INFO: 172.17.0.1:34654 - "GET /api/settings HTTP/1.1" 200 OK
05:55:39 - openhands:INFO: manager.py:202 - Conversation 354c303eadf848feb1d6e68fc38fd071 connected in 0.06298303604125977 seconds
05:55:39 - openhands:INFO: manager.py:184 - Reusing active conversation 354c303eadf848feb1d6e68fc38fd071
INFO: 172.17.0.1:34664 - "GET /api/conversations/354c303eadf848feb1d6e68fc38fd071/vscode-url HTTP/1.1" 200 OK
INFO: 172.17.0.1:34666 - "GET /api/conversations/354c303eadf848feb1d6e68fc38fd071/list-files HTTP/1.1" 200 OK
INFO: 172.17.0.1:53594 - "GET /api/options/config HTTP/1.1" 200 OK
INFO: 172.17.0.1:53604 - "GET /api/settings HTTP/1.1" 200 OK
06:03:15 - openhands:INFO: manager.py:202 - Conversation 354c303eadf848feb1d6e68fc38fd071 connected in 0.12316012382507324 seconds
06:03:15 - openhands:INFO: manager.py:184 - Reusing active conversation 354c303eadf848feb1d6e68fc38fd071
INFO: 172.17.0.1:53624 - "GET /api/conversations/354c303eadf848feb1d6e68fc38fd071/vscode-url HTTP/1.1" 200 OK
INFO: 172.17.0.1:53614 - "GET /api/conversations/354c303eadf848feb1d6e68fc38fd071/list-files HTTP/1.1" 200 OK

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm.set_verbose=True'.

Provider List: https://docs.litellm.ai/docs/providers

06:09:34 - openhands:ERROR: retry_mixin.py:47 - litellm.APIError: APIError: DeepseekException - error - Expecting value: line 30 column 1 (char 29), Received response - <APIResponse [200 OK] type=<class 'openai.types.chat.chat_completion.ChatCompletion'>>, Type of response - <class 'openai._legacy_response.LegacyAPIResponse'>. Attempt #1 | You can customize retry values in the configuration.
INFO: 172.17.0.1:48764 - "GET /api/options/config HTTP/1.1" 200 OK
INFO: 172.17.0.1:48780 - "GET /api/settings HTTP/1.1" 200 OK
06:16:31 - openhands:INFO: manager.py:202 - Conversation 354c303eadf848feb1d6e68fc38fd071 connected in 38.11679410934448 seconds
06:16:31 - openhands:INFO: manager.py:184 - Reusing active conversation 354c303eadf848feb1d6e68fc38fd071
INFO: 172.17.0.1:48802 - "GET /api/conversations/354c303eadf848feb1d6e68fc38fd071/vscode-url HTTP/1.1" 200 OK
INFO: 172.17.0.1:48790 - "GET /api/conversations/354c303eadf848feb1d6e68fc38fd071/list-files HTTP/1.1" 200 OK
INFO: 172.17.0.1:48070 - "GET /api/options/config HTTP/1.1" 200 OK
INFO: 172.17.0.1:48086 - "GET /api/settings HTTP/1.1" 200 OK
06:29:13 - openhands:INFO: manager.py:202 - Conversation 354c303eadf848feb1d6e68fc38fd071 connected in 0.05671429634094238 seconds
06:29:13 - openhands:INFO: manager.py:184 - Reusing active conversation 354c303eadf848feb1d6e68fc38fd071
INFO: 172.17.0.1:48102 - "GET /api/conversations/354c303eadf848feb1d6e68fc38fd071/vscode-url HTTP/1.1" 200 OK
INFO: 172.17.0.1:48100 - "GET /api/conversations/354c303eadf848feb1d6e68fc38fd071/list-files HTTP/1.1" 200 OK
^CINFO: Shutting down
06:30:51 - openhands:INFO: listen_socket.py:99 - sio:disconnect:yARHpdK5CveJNnAiAAAF
06:30:51 - openhands:INFO: manager.py:413 - disconnect_from_session:yARHpdK5CveJNnAiAAAF:354c303eadf848feb1d6e68fc38fd071
06:30:51 - openhands:INFO: manager.py:458 - _close_session:354c303eadf848feb1d6e68fc38fd071
06:30:51 - openhands:INFO: manager.py:466 - removing connections: []
06:30:51 - openhands:INFO: manager.py:475 - closing_session:354c303eadf848feb1d6e68fc38fd071
06:30:51 - openhands:INFO: agent_controller.py:381 - [Agent Controller 354c303eadf848feb1d6e68fc38fd071] Setting agent(CodeActAgent) state from AgentState.RUNNING to AgentState.STOPPED
INFO: Waiting for background tasks to complete. (CTRL+C to force quit)
06:30:56 - openhands:INFO: manager.py:485 - closed_session:354c303eadf848feb1d6e68fc38fd071
INFO: Waiting for application shutdown.
INFO: Application shutdown complete.
INFO: Finished server process [10]
^CException ignored in: <module 'threading' from '/usr/local/lib/python3.12/threading.py'>
Traceback (most recent call last):
File "/usr/local/lib/python3.12/threading.py", line 1592, in _shutdown
atexit_call()
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 31, in _python_exit
t.join()
File "/usr/local/lib/python3.12/threading.py", line 1147, in join
self._wait_for_tstate_lock()
File "/usr/local/lib/python3.12/threading.py", line 1167, in _wait_for_tstate_lock
if lock.acquire(block, timeout):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt:

@mamoodi
Copy link
Collaborator

mamoodi commented Jan 7, 2025

@enyst would this possibly be related to the LLM itself or is it an OpenHands thing?

@enyst
Copy link
Collaborator

enyst commented Jan 7, 2025

This error looks suspicious:

06:09:34 - openhands:ERROR: retry_mixin.py:47 - litellm.APIError: APIError: DeepseekException - error - Expecting value: line 30 column 1 (char 29), Received response - <APIResponse [200 OK] type=<class 'openai.types.chat.chat_completion.ChatCompletion'>>, Type of response - <class 'openai._legacy_response.LegacyAPIResponse'>. Attempt https://github.com/All-Hands-AI/OpenHands/issues/1 | You can customize retry values in the configuration.

I wish we know what exactly was sent to deepseek. 🤔
Could you add -e DEBUG=1 to the docker command, to give us more details?

It's also unexpected that immediately after, it seems to disconnect and reconnect, and as you said @Elias966 there are several minutes between those. Is this the full log? After attempt 1, it doesn't do more attempts, so this should have succeeded and passed to the next, but that doesn't seem to happen. I'll try to reproduce that.

We have some fixes in main related to too many threads left hanging, it might help if you ran on main instead of 0.18. But please note that main might also be unstable in other ways.

@Elias966
Copy link
Author

Elias966 commented Jan 7, 2025

will test the main

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
None yet
Development

No branches or pull requests

3 participants