Search code examples
google-cloud-platformgoogle-cloud-build

Missing unknown value in gcloud builds submit


I'm trying to run a cloud build on my GCP project:

gcloud builds submit src --tag=eu.gcr.io/<PROJECT>/<APP_NAME>:latest --gcs-source-staging-dir=<BUILD_BUCKET>/runstage --gcs-log-dir=<BUILD_BUCKET>/logs --project=<PROJECT>

This worked fine yesterday but now I get:

ERROR: (gcloud.builds.submit) value for field [bucket] in collection [storage.objects] is required but was not provided

Am I missing something here?


Solution

  • I have reproduced the issue and I also got the same error. I resolved it by using the following command:

    gcloud builds submit --gcs-source-staging-dir="gs://<BUILD_BUCKET>/runstage" --gcs-log-dir="gs://<BUILD_BUCKET>/logs" --tag=eu.gcr.io/<PROJECT>/<APP_NAME>:latest  --project=<PROJECT> 
    

    Make sure to call Dockerfile explicitly in your cloudbuild.yaml file. For example :

    steps:
    - name: 'gcr.io/cloud-builders/docker'
      args: [ 'build', '-t', 'eu.gcr.io/<PROJECT>/<APP_NAME>:latest', ‘-f’, 'Dockerfile' ]