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
Solved! Go to Solution.
I recommend improving the error messaging . the "JSON UNmarshall" error is misleading because pubsub format is json and cloudbuild.yaml format is yaml
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