googlecodelabs / feedback

Provide feedback to our codelabs by filing an issue here
18 stars 22 forks source link

[cloud-run-django] Error During gcloud run jobs execute migrate #1424

Closed Nussbaumer1964 closed 1 month ago

Nussbaumer1964 commented 2 months ago

I've tried this three times and always get the following error:

nussbaumer@cloudshell:~/django-cloudrun (proj-433917)$ gcloud run jobs execute migrate --region $REGION --wait
X  Creating execution... Task migrate-6q2b8-task0 failed with message: The container exited with an error.                                            
  OK Provisioning resources...                                                                                                                        
  OK Starting execution...                                                                                                                            
  X  Running execution... 0 / 1 complete                                                                                                              
Executing job failed                                                                                                                                  
ERROR: (gcloud.run.jobs.execute) The execution failed.
View details about this execution by running:
gcloud run jobs executions describe migrate-6q2b8

Or visit https://console.cloud.google.com/run/jobs/executions/details/us-central1/migrate-6q2b8/tasks?project=928142509580
nussbaumer@cloudshell:~/django-cloudrun (proj-433917)$ 

The logs say the following:

{
  "textPayload": "django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.",
  "insertId": "66cf6f9c000bb9c3d1bc1fd3",
  "resource": {
    "type": "cloud_run_job",
    "labels": {
      "location": "us-central1",
      "job_name": "migrate",
      "project_id": "proj-433917"
    }
glasnt commented 1 month ago

This has been resolved in the codelab. This now uses the STORAGES config, and you should no longer get this error.