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]: [Jupyter] TypeError: the JSON object must be str, bytes or bytearray, not NoneType #6164

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

Comments

@neubig
Copy link
Contributor

neubig commented Jan 9, 2025

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Describe the bug and reproduction steps

I got the following error during an OpenHands session:

Let me try to fix the JSON manually:

Editing the contents of a file

500 Server Error: Internal Server Error for url: https://nuewalpbouzhlewc.prod-runtime.all-hands.dev/execute_action Details: Traceback (most recent call last): File "/openhands/code/openhands/runtime/action_execution_server.py", line 525, in execute_action observation = await client.run_action(action) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openhands/code/openhands/runtime/action_execution_server.py", line 182, in run_action observation = await getattr(self, action_type)(action) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openhands/code/openhands/runtime/action_execution_server.py", line 216, in run_ipython obs: IPythonRunCellObservation = await _jupyter_plugin.run(action) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openhands/code/openhands/runtime/plugins/jupyter/init.py", line 80, in run obs = await self._run(action) ^^^^^^^^^^^^^^^^^^^^^^^ File "/openhands/code/openhands/runtime/plugins/jupyter/init.py", line 73, in _run output = await self.kernel.execute(action.code, timeout=action.timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openhands/poetry/openhands-ai-5O4_aCHf-py3.12/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 189, in async_wrapped return await copy(fn, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openhands/poetry/openhands-ai-5O4_aCHf-py3.12/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 111, in call do = await self.iter(retry_state=retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openhands/poetry/openhands-ai-5O4_aCHf-py3.12/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 153, in iter result = await action(retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openhands/poetry/openhands-ai-5O4_aCHf-py3.12/lib/python3.12/site-packages/tenacity/_utils.py", line 99, in inner return call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/openhands/poetry/openhands-ai-5O4_aCHf-py3.12/lib/python3.12/site-packages/tenacity/init.py", line 398, in <lambda> self._add_action_func(lambda rs: rs.outcome.result()) ^^^^^^^^^^^^^^^^^^^ File "/openhands/micromamba/envs/openhands/lib/python3.12/concurrent/futures/_base.py", line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/openhands/micromamba/envs/openhands/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/openhands/poetry/openhands-ai-5O4_aCHf-py3.12/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 114, in call result = await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openhands/code/openhands/runtime/plugins/jupyter/execute_server.py", line 220, in execute execution_done = await asyncio.wait_for(wait_for_messages(), timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/openhands/micromamba/envs/openhands/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ File "/openhands/code/openhands/runtime/plugins/jupyter/execute_server.py", line 180, in wait_for_messages msg = json_decode(msg) ^^^^^^^^^^^^^^^^ File "/openhands/poetry/openhands-ai-5O4_aCHf-py3.12/lib/python3.12/site-packages/tornado/escape.py", line 104, in json_decode return json.loads(value) ^^^^^^^^^^^^^^^^^ File "/openhands/micromamba/envs/openhands/lib/python3.12/json/init.py", line 339, in loads raise TypeError(f'the JSON object must be str, bytes or bytearray, ' TypeError: the JSON object must be str, bytes or bytearray, not NoneType

OpenHands Installation

app.all-hands.dev

OpenHands Version

0.19.0

Operating System

None

Logs, Errors, Screenshots, and Additional Context

No response

@neubig neubig added the bug Something isn't working label Jan 9, 2025
@enyst
Copy link
Collaborator

enyst commented Jan 9, 2025

Looks like it's in the Jupyter plugin, msg was None:

jupyter/execute_server.py", line 180, in wait_for_messages msg = json_decode(msg)

@enyst enyst changed the title [Bug]: TypeError: the JSON object must be str, bytes or bytearray, not NoneType [Bug]: [Jupyter] TypeError: the JSON object must be str, bytes or bytearray, not NoneType Jan 9, 2025
@neubig
Copy link
Contributor Author

neubig commented Jan 9, 2025

@openhands-agent : please examine the circumstances under which this error could occur, and propose a fix if possible.

@openhands-agent
Copy link
Contributor

OpenHands started fixing the issue! You can monitor the progress here.

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