HumanSignal / HumanSignal/label-studio

Persistent Storage on GCS not working on Imports

Open
#4,317 11 comments 3 reactions 1 assignee Claimed by @makseq View on GitHub
problem storages
Dominant language
TypeScript
Stars
28.3k
Forks
3.7k
Avg merge
14h
Merged PRs (30d)
15

Description

**Describe the bug**
After successfully importing an image through the UI (Import button), LS is unable to fetch the image from GCS in the task view.
1. Importing through UI (I guess API would have the same result)
![Screenshot from 2023-06-05 16-04-40](https://github.com/heartexlabs/label-studio/assets/6019517/af0958af-2814-4ef6-bc75-13d1e8106b75)
2. Task appears in the Project's list
![Screenshot from 2023-06-05 16-04-50](https://github.com/heartexlabs/label-studio/assets/6019517/67b054bc-f7df-4aa8-8e3e-f898ab20338b)
3. Issue loading URL - image won't load from GCS to UI
![Screenshot from 2023-06-05 16-05-02](https://github.com/heartexlabs/label-studio/assets/6019517/57a3f9d1-5ab9-44bc-99e0-67e25f1aa1bc)
4. Double checking on GCS - the image was successfully uploaded to the right bucket
![Screenshot from 2023-06-05 16-06-28](https://github.com/heartexlabs/label-studio/assets/6019517/d5b5c565-0173-4585-94a4-0230bece61de)
5. Src and Dst Storage from Settings
![Screenshot from 2023-06-05 16-03-52](https://github.com/heartexlabs/label-studio/assets/6019517/891fa0f5-0399-4766-8d21-821db34ca348)
![Screenshot from 2023-06-05 16-03-35](https://github.com/heartexlabs/label-studio/assets/6019517/c1529553-bbde-4e7e-9dda-bd0f27140d02)

**To Reproduce**
Reproduced this on Google Cloud Run and also locally. Local steps are:
1. Clone repository
2. Create a Service Account on GCP with the following roles and save `service-account-file.json` locally (these were the ones I needed for GCR, might reproduce it with just Storage Object Admin):
```
Cloud SQL Client
Logs Writer
Secret Manager Secret Accessor
Service Account Token Creator
Storage Object Admin
Storage Object and Bucket Viewer
```
4. Create a `.env` file under the root with the following:
```
STORAGE_TYPE=gcs
STORAGE_GCS_BUCKET_NAME="bucket_name"
STORAGE_GCS_PROJECT_ID="project_name"
STORAGE_GCS_FOLDER=""
GOOGLE_APPLICATION_CREDENTIALS="/opt/heartex/secrets/key.json"
```
5. Change `docker-compose.yml` references of `heartexlabs/label-studio:latest` to `heartexlabs/label-studio:1.7.3` (testing on this version)
6. Under the `app:` definition, add:
```
app:
...
env_file: .env
volumes:
- ./mydata:/label-studio/data:rw
- ./service-account-file.json:/opt/heartex/secrets/key.json:ro
```
7. Run `docker-compose up` and try to import an image

**Expected behavior**
Imports working with GCS as a backend

**Environment (please complete the following information):**
- OS: Ubuntu 22.04.2 LTS
- Label Studio Version: 1.7.3

**Additional context**
Also made a thread on Slack [here](https://label-studio.slack.com/archives/CQ8LYPPJS/p1682005280698699) with some additional context (ie found the request that was failing in Label Studio, but didn't find a solution)

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.