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]: listen.py line 238, in refresh_files structure = files.get_folder_structure(Path(str(config.workspace_base))) #1849

Open
2 tasks done
unclemusclez opened this issue May 16, 2024 · 8 comments
Labels
bug Something isn't working frontend issues related to frontend severity:low Minor issues, code cleanup, etc waiting for input Need more information from the author to proceed further.

Comments

@unclemusclez
Copy link

Is there an existing issue for the same bug?

Describe the bug

I think it's looking for a symlink?
Perhaps -v $WORKSPACE_BASE:/opt/workspace_base is never mounted. Would this have to be configured in the config.toml?

Current Version

0.5.3

Installation and Configuration

Following installation instructions from: https://github.com/OpenDevin/OpenDevin/blob/0.5.3/Development.md

Model and Agent

xingyaow/codeact-agent-mistral:latest
CodeAct https://i.imgur.com/wWq9Wnm.png

Reproduction Steps

No response

Logs, Errors, Screenshots, and Additional Context

INFO:     127.0.0.1:54962 - "GET /api/litellm-models HTTP/1.1" 200 OK
INFO:     127.0.0.1:54970 - "GET /api/messages/total HTTP/1.1" 200 OK
INFO:     127.0.0.1:54984 - "GET /api/litellm-models HTTP/1.1" 200 OK
INFO:     127.0.0.1:54948 - "GET /api/refresh-files HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 411, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/starlette/concurrency.py", line 42, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/home/musclez/.cache/pypoetry/virtualenvs/opendevin-n-3vbtf9-py3.11/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 851, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/p/opendevin/opendevin/server/listen.py", line 238, in refresh_files
    structure = files.get_folder_structure(Path(str(config.workspace_base)))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/p/opendevin/opendevin/runtime/files.py", line 35, in get_folder_structure
    for item in workdir.iterdir():
  File "/usr/lib/python3.11/pathlib.py", line 931, in iterdir
    for name in os.listdir(self):
                ^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'workspace'
@unclemusclez unclemusclez added the bug Something isn't working label May 16, 2024
@unclemusclez
Copy link
Author

unclemusclez commented May 16, 2024

this is my current config.toml

[core]
workspace_base="./workspace"
workspace_mount_path="/mnt/p/workspace"
volumes=["/mnt/p/workspace:/opt/workspace_base:rw"]

[llm]
model="ollama/xingyaow/codeact-agent-mistral:latest"
api_key="ollama"
base_url="http://host.docker.internal:11434"
embedding_model="local"

I think something is calling $(pwd), and that makes listen.py look for the workspace file in the OpenDevin directory.

In config.toml, I define the workspace_mount_path and volumes.

Because it is looking for a file and not a directory, I performed within OpenDevin directory:

ln -s /mnt/p/workspace ./workspace,

This allowed me to use a different folder outside of the OpenDevin folder, and I am able to see all of the files display in OD's explorer.
I'm not sure about OD's browser functionality yet.

@enyst
Copy link
Collaborator

enyst commented May 16, 2024

There seem to be multiple issues here. First please let's see your installation work.

Perhaps -v $WORKSPACE_BASE:/opt/workspace_base is never mounted. Would this have to be configured in the config.toml?

'volumes' is not a config property to set in the toml, I think it's ignored as you have it, and it mounts instead the workspace_mount_path to a default '/workspace' in the sandbox. (which is configurable with workspace_mount_path_in_sandbox)

I think workspace_base should be an absolute path. Can you please try this?

workspace_mount_path_in_sandbox='/opt/workspace_base'
workspace_base='/mnt/p/workspace/'
workspace_mount_path='/mnt/p/workspace/'

@unclemusclez
Copy link
Author

i tried the docker image with the basic-setup instructions from the front-page, same or at least similar error: https://i.imgur.com/KJhISYj.png

'volumes' is not a config property to set in the toml, I think it's ignored as you have it, and it mounts instead the workspace_mount_path to a default '/workspace' in the sandbox. (which is configurable with workspace_mount_path_in_sandbox)

I'm going to crack at the development build someone more. Passing variable through the toml does seem to work.

I have had OD Working multiple times with proper directories displayed and OD able to execute terminal commands. At one point I saw the the browser has a blue dot, but i wasn't paying attention to the active window when troubleshooting the directories. I've never had the UID or the cache set up correctly. That's what i am trying to work on now.

It seems to be the case that when I close out of the environment, certain variables reset. So, if is working, when I shut off my computer, it stops working.

@enyst
Copy link
Collaborator

enyst commented May 16, 2024

It seems to be the case that when I close out of the environment, certain variables reset.

At least if you ran with docker, opened a terminal and set environment variables with EXPORT, then yes, you may need to set again.

If you want to not touch them anymore, with the development setup you can keep them in toml, and if you need some specific vars that toml doesn't know about (normally not necessary), then you can store them in an .env file in opendevin's directory.

@unclemusclez
Copy link
Author

My main concern was that I am creating more of an issue for developers than helping by using the development build. However, I seem have similar issues with either build. So, as long as I'm helping with the information I am gathering, I will continue with the development build and providing feedback.

@unclemusclez
Copy link
Author

main build config.toml:

[core]
workspace_base="/mnt/p/workspace"
workspace_mount_path_in_sandbox='/opt/workspace_base'
workspace_mount_path="/mnt/p/workspace"
volumes=["/mnt/p/workspace:/opt/workspace_base:rw"]
sandbox_workspace_dir='/opt/workspace_base'
environment=["$SANDBOX_USER_ID"]
cache_dir="/home/musclez/.cache"
bash_script_path="/mnt/p/opendevin"

[llm]
model="ollama/xingyaow/codeact-agent-mistral:latest"
api_key="ollama"
base_url="http://host.docker.internal:11434"
embedding_model="local"

no errors.

Is the cache folder supposed to be hooked up directly to my host cache folder? its mounted, and i can definitely pass environment variables through the .toml.

@SmartManoj
Copy link
Collaborator

i tried the docker image with the basic-setup instructions from the front-page, same or at least similar error: i.imgur.com/KJhISYj.png

image

You can ignore the error.

Did you click workspace?
image

@SmartManoj SmartManoj added the waiting for input Need more information from the author to proceed further. label May 18, 2024
@rbren rbren added the severity:low Minor issues, code cleanup, etc label May 18, 2024
@SmartManoj
Copy link
Collaborator

In the latest version, the workspace name is hidden. @amanape intentional?

@SmartManoj SmartManoj added the frontend issues related to frontend label Jun 3, 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 frontend issues related to frontend severity:low Minor issues, code cleanup, etc waiting for input Need more information from the author to proceed further.
Projects
None yet
Development

No branches or pull requests

4 participants