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

Latest docker image PermissionError #3465

Closed
35grain opened this issue Dec 21, 2022 · 9 comments
Closed

Latest docker image PermissionError #3465

35grain opened this issue Dec 21, 2022 · 9 comments
Labels
installation problem bug or something isn't working

Comments

@35grain
Copy link

35grain commented Dec 21, 2022

On Ubuntu 22.04 spinning up the latest Docker image (1.7.0) results in the following error:

=> Database and media directory: /label-studio/data
=> Static URL is set to: /static/
Traceback (most recent call last):
  File "/usr/local/bin/label-studio", line 33, in <module>
    sys.exit(load_entry_point('label-studio', 'console_scripts', 'label-studio')())
  File "/usr/local/bin/label-studio", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/label-studio/label_studio/server.py", line 28, in <module>
    from label_studio.core.argparser import parse_input_args
  File "/label-studio/label_studio/core/argparser.py", line 6, in <module>
    from .settings.base import EXPORT_DIR
  File "/label-studio/label_studio/core/settings/base.py", line 399, in <module>
    os.makedirs(MEDIA_ROOT, exist_ok=True)
  File "/usr/lib/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/label-studio/data/media'

Using the previous version (1.6.0) on Ubuntu or the latest (1.7.0) on Windows works as expected.

@chris-ml92
Copy link

I have had the same problem yesterday on my linux machine. I can confirm that the previous version (1.6.0) on Ubuntu works fine.

@fvdnabee
Copy link

One option is to run the container as your user. In linux your user typically has UID 1000:

docker run -it -u 1000 -p 8080:8080 -v $(pwd)/mydata:/label-studio/data heartexlabs/label-studio:latest

@basantashrestha
Copy link

I have exact same issue on ubuntu 22.04. I am using docker-compose.yml. How do I go back to 1,6,0?

@aparij
Copy link

aparij commented Dec 23, 2022

@basantashrestha Instead of using the :latest tag you can use heartexlabs/label-studio:1.6.0 for example or any other tag on docker hub

@yctam
Copy link

yctam commented Dec 27, 2022

One workaround is to make your mount data to be writable:
chmod -R 777 mydata/

@francescocarpanese
Copy link

If you want to run as your userid and group id you can get them automatically from your env variable with ${USER}):$(id -u ${USER}),

For example.
docker run -it -u $(id -u ${USER}):$(id -u ${USER}) -p 8080:8080 -v $(pwd)/mydata:/label-studio/data heartexlabs/label-studio:latest

@farioas
Copy link
Member

farioas commented Dec 27, 2022

Starting with release 1.7.0, the application will run using a non-root docker user with ID 1001.

If you encounter any permission issues when running the application in a docker container, you can fix them by changing the ownership of the relevant files and directories to 1001.

docker run -it --user root -v `pwd`/mydata:/label-studio/data heartexlabs/label-studio:1.7.0 chown -R 1001:root /label-studio/data/

This info was added into Changelog under section Breaking Changes.

@35grain 35grain closed this as completed Dec 30, 2022
@bigabig
Copy link

bigabig commented Jan 15, 2023

how does this solve the issue. I download the docker compose file from this repo and cannot run it...

@farioas
Copy link
Member

farioas commented Jan 16, 2023

Please provide docker logs or open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation problem bug or something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants