-
Couldn't load subscription status.
- Fork 3.1k
Description
Describe the Bug(s)
The documentation on using local storage isn't consistent between these two links.
- https://labelstud.io/guide/storage.html#Local-storage
- https://labelstud.io/guide/start.html#Run-Label-Studio-on-Docker-and-use-local-storage
For example, the environment variables mentioned in each are different. Also, note that neither of these pages describes what actually works (see below).
I'm trying to use local storage to label some files. Without working docs, I'm trying different things out and doing my best to get it working. Here are some iterations.
docker run -itd -p 8080:8080 -v /mnt/e/label-studio-backend-stuff:/label-studio/data --env LOCAL_FILES_SERVING_ENABLED=true --env LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=/mnt/e/data -v /mnt/e/data:/label-studio/files heartexlabs/label-studio:latest
For anyone else struggling, note the env variables, which I think are correct in my example.
I then use the UI to add local storage. Here are two examples.
I use the absolute local path /mnt/e/data/example-data-dir-01, as described in https://labelstud.io/guide/storage.html#Local-storage.
I do some problem solving and try /label-studio/files-example-data-dir-01. I chose this because that's where the files are mounted in the Label Studio container.
I can add them.
But I can't sync them.
Here's the full stack trace.
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/django/utils/decorators.py", line 43, in _wrapper
return bound_method(*args, **kwargs)
File "/label-studio/label_studio/io_storages/api.py", line 87, in post
storage.sync()
File "/label-studio/label_studio/io_storages/base_models.py", line 147, in sync
self.scan_and_create_links()
File "/label-studio/label_studio/io_storages/localfiles/models.py", line 84, in scan_and_create_links
return self._scan_and_create_links(LocalFilesImportStorageLink)
File "/label-studio/label_studio/io_storages/base_models.py", line 81, in _scan_and_create_links
data = self.get_data(key)
File "/label-studio/label_studio/io_storages/localfiles/models.py", line 68, in get_data
relative_path = str(path.relative_to(document_root))
File "/usr/lib/python3.8/pathlib.py", line 908, in relative_to
raise ValueError("{!r} does not start with {!r}"
ValueError: '/label-studio/files/example-data-dir-01/image_0.jpg' does not start with '/mnt/e/data'
This command works, but it's nothing like what's in the Label Studio documentation.
docker run -itd -p 8080:8080 -v /mnt/e/label-studio-backend-stuff:/label-studio/data --env LOCAL_FILES_SERVING_ENABLED=true --env LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=/label-studio/files -v /mnt/e/data:/label-studio/files heartexlabs/label-studio:latest
Even with this working, whenever I go to add local storage as an option in Label Studio, it generates two entries.
When I try to delete the 2nd, unnecessary one (see below)...
... both get deleted (see below).
To Reproduce
See above.
Expected Behavior
I expect the docs to be consistent and correct. I also expect that I should relatively easily be able to mount local storage and label files from local storage.
Screenshots
None. Ask if you want screenshots.
Environment
I'm on Windows 11. Label Studio is running in WSL2. Label Studio should be the latest version because that's what Docker is grabbing.
Additional Context
None. Ask if you want any more details.





