Video playback issue in Google Cloud

I’m currently running Label Studio version 1.19.0 on Google Cloud. The setup uses Cloud Run for hosting, along with Cloud SQL and Cloud Storage buckets. Cloud Run is behind a Load Balancer. Below is the relevant configuration for Label Studio:

DJANGO_DB = default
POSTGRE_NAME = label-studio
POSTGRE_HOST = <host>
POSTGRE_USER = <user>
POSTGRE_PASSWORD = <pass>
STORAGE_TYPE = gcs
STORAGE_GCS_BUCKET_NAME = <bucketName>
STORAGE_GCS_PROJECT_ID = <projId>
STORAGE_GCS_FOLDER = label-studio-media
USE_ENFORCE_CSRF_CHECKS = false

Videos that I import are correctly stored in the designated Cloud Storage bucket and folder. However, Label Studio is unable to retrieve and play them automatically.

I can confirm that:

  • Label Studio signs and provides a valid URL for the video.

  • The X-Accel-Redirect header is generated correctly and matches the expected Nginx template.

  • If I manually construct the $download_url using the same template, the video plays correctly in the browser, which rules out any codec issues.

Despite this, Label Studio fails to play the videos directly in the UI.

I have also tried setting USE_NGINX_FOR_UPLOADS and USE_NGINX_FOR_EXPORT_DOWNLOADS to both true and false, but the issue persists.

Thank you!

Working solution:

gcloud run deploy SERVICE \
  --container nginx \
  --image='heartexlabs/label-studio' \
  --args 'nginx'
  --set-env-vars APP_HOST=localhost \ # localhost because sidecars have same network space
  --port='8085' \ # port used by nginx
  --container label-studio \
  --image='heartexlabs/label-studio' \
  --set-env-vars DJANGO_DB=default \
  --set-env-vars POSTGRE_NAME=label-studio \
  --set-env-vars POSTGRE_HOST=<host> \
  --set-env-vars POSTGRE_USER=<user> \
  --set-env-vars POSTGRE_PASSWORD=<pass> \
  --set-env-vars STORAGE_TYPE=gcs \
  --set-env-vars STORAGE_GCS_BUCKET_NAME=label-studio \
  --set-env-vars STORAGE_GCS_PROJECT_ID=<proj> \
  --set-env-vars STORAGE_GCS_FOLDER=label-studio-media \
  --set-env-vars LABEL_STUDIO_PORT=8000 # port that NGINX will redirect traffic to

I think that we are not supposed to use label-studio without NGINX sidecar anymore. For more info refer to: helm template and docker-compose