HumanSignal / HumanSignal/label-studio
Persistent Storage on GCS not working on Imports
- 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)

2. Task appears in the Project's list

3. Issue loading URL - image won't load from GCS to UI

4. Double checking on GCS - the image was successfully uploaded to the right bucket

5. Src and Dst Storage from Settings


**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
Assessment
This issue has not been assessed yet.