HumanSignal / HumanSignal/label-studio

USE_NGINX_FOR_UPLOADS and FileSystemStorage `storage_url=True` mode compability when using ml-backend

Open
#9,147 1 comment 0 reactions 0 assignees View on GitHub
community_reviewed
Dominant language
TypeScript
Stars
28.3k
Forks
3.7k
Avg merge
14h
Merged PRs (30d)
15

Description

**Describe the bug**
I'm integrating ml-backend with label studio, but struggle with compatibility between FileSystemStorage and USE_NGINX_FOR_UPLOADS when download the image for inference.
It is stated in label-studio-sdk that
> USE_NGINX_FOR_UPLOADS should be OFF for FileSystemStorage since it doesn't support `storage_url=True`

https://github.com/HumanSignal/label-studio-sdk/blob/b2c86a0694ec387c3b0ce64298d3a793363a805a/src/label_studio_sdk/_extensions/label_studio_tools/core/utils/io.py#L215C95-L215C106

The code in Label Studio's DownloadStorageData APIView uses `storage_url` with' USE_NGINX_FOR_UPLOADS=True', which may be the cause of a 500 error when requesting an image.

https://github.com/HumanSignal/label-studio/blob/090298d3adceda6ed516682fcc37e374b13dd051/label_studio/data_import/api.py#L982C9-L983C72

`{"id":"dcee9713-0417-41c1-b9f7-c75dc5e6f526","status_code":500,"version":"1.22.0","detail":"FileSystemStorage.url() got an unexpected keyword argument 'storage_url'","exc_info":"Traceback (most recent call last):\n File \"/label-studio/.venv/lib/python3.13/site-packages/rest_framework/views.py\", line 506, in dispatch\n response = handler(request, *args, **kwargs)\n File \"/label-studio/label_studio/data_import/api.py\", line 983, in get\n url = file_obj.storage.url(file_obj.name, storage_url=True)\nTypeError: FileSystemStorage.url() got an unexpected keyword argument 'storage_url'\n"}`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.