HumanSignal / label-studio

Label Studio is a multi-type data labeling and annotation tool with standardized output format
https://labelstud.io
Apache License 2.0
17.91k stars 2.23k forks source link

unable to add local files as storage source in label studio docker #3987

Open hsbaweja opened 1 year ago

hsbaweja commented 1 year ago

I am unable to add local files as storage source in label studio. My docker compose file looks like this

label_studio:
    image: heartexlabs/label-studio:latest
    userns_mode: "host"
    hostname: label_studio
    volumes:
      - /etc/label-studio/data:/label-studio/data/:rw
    depends_on:
      - db
    network_mode: host
    environment:
      - DJANGO_DB=default
      - LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true
      - LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=/label-studio/data/
      - LOCAL_FILES_SERVING_ENABLED=true
      - LOCAL_FILES_DOCUMENT_ROOT=/label-studio/data/
      - POSTGRE_NAME=something
      - POSTGRE_USER=something
      - POSTGRE_PASSWORD=
      - POSTGRE_PORT=7564
      - POSTGRE_HOST=localhost
      - JSON_LOG=1
    restart: always

However adding /label-studio/data/ as absolute path in source storage gives the following issue.

RUNTIME ERROR
Validation error
[ErrorDetail(string="Serving local files can be dangerous, so it's disabled by default. You can enable it with LOCAL_FILES_SERVING_ENABLED environment variable, please check docs: https://labelstud.io/guide/storage.html#Local-storage", code='invalid')]
Version: 1.7.2
WillieMaddox commented 1 year ago

I don't have any trailing / in my docker-compose.yml

What happens when you replace all instances of /label-studio/data/ with /label-studio/data?

hsbaweja commented 1 year ago

That fixed this issue above, however I am running into a different issue now. When I add the source storage as local files, set the absolute path as /label-studio/data/robot-bag-data/auto_upload/label-studio, choose Treat every bucket object as a source file option, I can see a bunch of synced tasks. However in the annotation window, I run into this error

Technical description: HTTP error status: 500
URL: [/data/local-files/?d=robot-bag-data/auto_upload/label-studio/lobby_mgmt_2023-02-07T135856_853114Z_0.wav](https://test-labeling.domain.io/data/local-files/?d=robot-bag-data/auto_upload/label-studio/audio_file_853114Z_0.wav)

When I click on the link, I see this page. label-studio-500

makseq commented 1 year ago

@hsbaweja can you go inside of docker terminal and try to read this files there? do you have permissions to do this?

hsbaweja commented 1 year ago

@makseq I checked that I can read the files from inside the docker and have read permissions.

makseq commented 1 year ago

hm.. honestly I have no ideas, seems it's something wrong with files on the hard drive. Try googling this error "Errno 5 input/output error", maybe it helps you understand where the root of the problem is.