Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cloud Build Pubsub broken for all subscriptions

Around 9/27 Cloud Build triggers from pub/sub topics started failing with the error

Failed to trigger build: failed unmarshalling build config cloudbuild.yaml: json: cannot unmarshal string into Go value of type []json.RawMessage"

I've confirmed that cloudbuild.yaml is good using "gcloud builds submit ." .  The build only fails from pubsub subscriptions. 

cloudbuild.yaml

steps:
# Docker Build
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--build-arg', 'CLOUD_SDK_VERSION=${_CLOUD_SDK_VERSION}', '-t',
'us-west1-docker.pkg.dev/${PROJECT_ID}/gcloud-lite/gcloud-lite:latest',
'-t', 'us-west1-docker.pkg.dev/${PROJECT_ID}/gcloud-lite/gcloud-lite:${_CLOUD_SDK_VERSION}',
'.']
images: 'us-west1-docker.pkg.dev/${PROJECT_ID}/gcloud-lite/gcloud-lite'
options:
logging: CLOUD_LOGGING_ONLY

 

what I've tested

  1. tested cloudbuild.yaml is correct using `gcloud builds submit . `  . cloudbuild.yaml works properly
  2. Re-created pub-sub trigger with cloud build trigger v2
  3. removed all substitutions to confirm the error is not due to parsing
  4. tested running the trigger manually from Cloud Build console. The trigger fails immediately with all invocations.
Solved Solved
0 2 247
1 ACCEPTED SOLUTION

I recommend improving the error messaging . the "JSON UNmarshall" error is misleading because pubsub format is json and cloudbuild.yaml format is yaml

View solution in original post

2 REPLIES 2

the issue was due to incorrect schema with .images<array> = string. 

I recommend improving the error messaging . the "JSON UNmarshall" error is misleading because pubsub format is json and cloudbuild.yaml format is yaml