Pre-signed urls problem with GCS
Describe the bug When i try to connect the GCS, with "Use pre-signed URLs" enabled, the response is a list of obj (in my case) with the link gs:// and not http..
To Reproduce Steps to reproduce the behavior:
- Go to Settings
- Click on Cloud Storage
- Set Google Cloud Storage
- set all fields and enable "Use pre-signed URLs"
- Save
- Sync Storage
Expected behavior I expect to receive links to images located within my bucket so that i can use them within the image tag.
Environment (please complete the following information):
- OS: Ubuntu 20.04.6 LTS
- Label Studio Version 1.7.3
Hello mevis89,
I'm not sure whats happening here. Is it possible to give example? Are you using the uri when importing your data?
+1 - V1.8.0 - the URI for GCS isn't resolving to a https:// pre-signed url - it's just using the GS:// uri to try and locate the image
Update: @makseq - turned the feature flag off via a docker build and feature_flag.json. Seemingly didn't work, but might have be a caching on the server causing this. Subsequently, updated credentials to the GCS bucket. That seemed to kick start it. Deleting the credentials from the storage settings, and just using ADC it all seems to be working.
Same issue here, cannot get labelstudio to load objects from GCS.
@philipkopylov Version, and build info? - would love to try and help if I'm working from the same settings.
Same issue, here's the error from logs
[2023-10-24 19:39:37,899] [data_import.api::get::661] [ERROR]
Failed to resolve storage uri gs://<bucket>/<path-to-image>.png for task 1: you need a private key to sign credentials.
the credentials you are currently using <class 'google.oauth2.credentials.Credentials'> just contains a token.
see https://googleapis.dev/python/google-api-core/latest/auth.html#setting-up-a-service-account for more details.
I get the same above error
[2023-10-26 19:08:36,533] [data_import.api::get::699] [ERROR] Failed to resolve storage uri gs://.../A2908_02_003.jpg for task 549: you need a private key to sign credentials.the credentials you are currently using <class 'google.auth.compute_engine.credentials.Credentials'> just contains a token. see https://googleapis.dev/python/google-api-core/latest/auth.html#setting-up-a-service-account for more details.
V 1.9.1
I'am having the same issue with loading images from GCS. Anybody that has been able to fix this or has a workaround? Would really like to use the newer versions from Labelstudio as it includes some performance improvements but with the later versions I have this blocking GCS loading problem :(
Not sure if this is the same issue, but in our case using the default credentials (leaving the field blank) was causing the permission issue.
Solution: Don't use the default google-application-credentials
Instead:
- create a service-account (iam)
- add AIM permissions for storage and service-account-token-creator to the service-account
- create a key for the service account (json)
- use the key (entire json) as application-credentials: