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]: make start-backend results in NotImplementedError: Non-relative patterns are unsupported #4864

Open
1 task done
anil-gurbuz opened this issue Nov 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@anil-gurbuz
Copy link

anil-gurbuz commented Nov 9, 2024

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Describe the bug and reproduction steps

just need to run make start-backend

The error is related to the --reload-exclude option in the uvicorn command. The issue is that the glob pattern you're passing to this option is being interpreted as an absolute path, which is not supported by Python's pathlib.glob() function.

Below is how I solved the issue but not sure if this is an ideal way of handling it ;

  1. First, let's modify the Makefile command. Instead of using $(shell pwd), we'll use a relative path:
start-backend:
    @echo "$(YELLOW)Starting backend...$(RESET)"
    @poetry run uvicorn openhands.server.listen:app --host $(BACKEND_HOST) --port $(BACKEND_PORT) --reload --reload-exclude "./workspace"

This change makes the --reload-exclude pattern relative, which should resolve the NotImplementedError.

OpenHands Installation

Docker command in README

OpenHands Version

main

Operating System

Linux

Logs, Errors, Screenshots, and Additional Context

(oh) ➜ OpenHands git:(main) ✗ make start-backend
Starting backend...
Traceback (most recent call last):
File "/home/anil/.cache/pypoetry/virtualenvs/openhands-ai-CvwGNP_0-py3.12/bin/uvicorn", line 8, in
sys.exit(main())
^^^^^^
File "/home/anil/.cache/pypoetry/virtualenvs/openhands-ai-CvwGNP_0-py3.12/lib/python3.12/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anil/.cache/pypoetry/virtualenvs/openhands-ai-CvwGNP_0-py3.12/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/anil/.cache/pypoetry/virtualenvs/openhands-ai-CvwGNP_0-py3.12/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anil/.cache/pypoetry/virtualenvs/openhands-ai-CvwGNP_0-py3.12/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anil/.cache/pypoetry/virtualenvs/openhands-ai-CvwGNP_0-py3.12/lib/python3.12/site-packages/uvicorn/main.py", line 412, in main
run(
File "/home/anil/.cache/pypoetry/virtualenvs/openhands-ai-CvwGNP_0-py3.12/lib/python3.12/site-packages/uvicorn/main.py", line 516, in run
config = Config(
^^^^^^^
File "/home/anil/.cache/pypoetry/virtualenvs/openhands-ai-CvwGNP_0-py3.12/lib/python3.12/site-packages/uvicorn/config.py", line 292, in init
self.reload_excludes, self.reload_dirs_excludes = resolve_reload_patterns(reload_excludes, [])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anil/.cache/pypoetry/virtualenvs/openhands-ai-CvwGNP_0-py3.12/lib/python3.12/site-packages/uvicorn/config.py", line 145, in resolve_reload_patterns
for match in current_working_directory.glob(pattern):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anil/anaconda3/envs/oh/lib/python3.12/pathlib.py", line 1090, in glob
raise NotImplementedError("Non-relative patterns are unsupported")
NotImplementedError: Non-relative patterns are unsupported
make: *** [Makefile:193: start-backend] Error 1

@anil-gurbuz anil-gurbuz added the bug Something isn't working label Nov 9, 2024
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

1 participant