Script ```export SANDBOX_VOLUMES="/c/programming/P...
# questions
n
Script
Copy code
export SANDBOX_VOLUMES="/c/programming/Projects/OpenHands/adaptive_web_UI:/workspace:rw"
export op_path="/c/programming/Projects/OpenHands/save"
echo $SANDBOX_VOLUMES

docker pull docker.all-hands.dev/all-hands-ai/runtime:0.57-nikolaik

docker run -it --rm --pull=always \
    -e SANDBOX_USER_ID=4399 \
    -e SANDBOX_VOLUMES="$SANDBOX_VOLUMES" \
    -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.57-nikolaik \
    -e LOG_ALL_EVENTS=true \
    -v //var/run/docker.sock:/var/run/docker.sock \
    -v ~/.openhands:/.openhands \
    -p 3000:3000 \
    --add-host host.docker.internal:host-gateway \
    --name openhands-app \
    docker.all-hands.dev/all-hands-ai/openhands:0.57
Error:
Copy code
$ ./setup.sh
/c/programming/Projects/OpenHands/adaptive_web_UI:/workspace:rw
0.57-nikolaik: Pulling from all-hands-ai/runtime
Digest: sha256:70e4139b8767dbec9cbc68d683e8b6ed070664ff9c8d9ba5e9f082128621eafb
Status: Image is up to date for docker.all-hands.dev/all-hands-ai/runtime:0.57-nikolaik
docker.all-hands.dev/all-hands-ai/runtime:0.57-nikolaik
0.57: Pulling from all-hands-ai/openhands
Digest: sha256:36327fb3805e388d2b0dc8532f2d27821353cbccd3ea3f37ba4456de1e152e59
Status: Image is up to date for docker.all-hands.dev/all-hands-ai/openhands:0.57
Starting OpenHands...
Setting up enduser with id 4399
Docker socket group id: 0
root:x:0:
Group with id 0 already exists
Running as enduser
ERROR:root:  File "/app/.venv/bin/uvicorn", line 8, in module
    sys.exit(main())
             ^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/main.py", line 413, in main
    run(
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/main.py", line 580, in run
    server.run()
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/server.py", line 67, in run
    return asyncio.run(self.serve(sockets=sockets))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 195, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/server.py", line 71, in serve
    await self._serve(sockets)
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/server.py", line 78, in _serve
    config.load()
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/config.py", line 436, in load
    self.loaded_app = import_from_string(self.app)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/importer.py", line 19, in import_from_string    
    module = importlib.import_module(module_str)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "frozen importlib._bootstrap", line 1387, in _gcd_import
  File "frozen importlib._bootstrap", line 1360, in _find_and_load
  File "frozen importlib._bootstrap", line 1331, in _find_and_load_unlocked
  File "frozen importlib._bootstrap", line 935, in _load_unlocked
  File "frozen importlib._bootstrap_external", line 999, in exec_module
  File "frozen importlib._bootstrap", line 488, in _call_with_frames_removed
  File "/app/openhands/server/listen.py", line 5, in module
    from openhands.server.app import app as base_app
  File "/app/openhands/server/app.py", line 20, in module
    from openhands.server.routes.conversation import app as conversation_api_router
  File "/app/openhands/server/routes/conversation.py", line 14, in module
    from openhands.server.shared import conversation_manager, file_store
  File "/app/openhands/server/shared.py", line 23, in module
    config: OpenHandsConfig = load_openhands_config()
                              ^^^^^^^^^^^^^^^^^^^^^^^
y", line 373, in get_or_create_jwt_secret
    file_store.write(JWT_SECRET, new_secret)
  File "/app/openhands/storage/local.py", line 26, in write
    with open(full_path, mode) as f:
         ^^^^^^^^^^^^^^^^^^^^^

ERROR:root:class 'PermissionError': [Errno 13] Permission denied: '/.openhands/.jwt_secret'
I cannot seem to bind openhand with local drive, anything I am doing something wrong? Resolved: works if I remove: -e SANDBOX_USER_ID=4399 \
@wooden-umbrella-84098 I think this also worth some attention, as SANDBOX_USER_ID just don't work right now.
w
Yeah it looks like /.openhands isn't owned by enduser...
which makes sense because it's mounted from your local FS
what does
ls -lah ~/.openhands
show on your machine?
n
$ ls -lah ~/.openhands total 40K drwxr-xr-x 1 guanz 197609 0 Oct 1 16:07 ./ drwxr-xr-x 1 guanz 197609 0 Oct 1 16:07 ../ This is executed on windows bash shell
w
how about
id -u guanz
? Is
guanz==4399
?
n
I tried both using actual id -u guanz = Some ID which is what I use as SANDBOX_USER_ID or a mock number (4399) both fails
w
the mock number I would expect to fail with "Permission denied"
the guanz number also gives the same Permission denied: '/.openhands/.jwt_secret'?
that would be weird given that you own that dir
n
Correct, also I am not sure if /.openhands/.jwt_secret is local or in docker, as I don't see it created in local dir at all, but do exist in docker
w
yes the idea is that it's linked to
~/.openhands
on your local machine