A few weeks ago I started to use Cloud Build to set up an automatic deployment. I already deployed the application from my local machine with gcloud app deploy and I thought it is time to set up a proper deployment and release pipeline.
As I started my very first deployment with Cloud Build I got the following error:
ERROR: gcloud crashed (UnicodeDecodeError): 'ascii' codec can't decode byte 0xe2 in position 13: ordinal not in range(128)
The error message is pretty clear there is a non-supported character. I found several similar error cases and the Google support describes where such characters are not allowed:
- and in all file paths which are part of the app
Since I hadn’t any non-supported character in the app.yaml or in my file paths it was obvious that this was caused by some node-module. A few minutes later I found the node.js dependency which caused the issue.
There are several tweaks which are truly useful while debugging Cloud Build.
To get additional information during the build process you can set the verbosity to debug:
steps: - name: 'gcr.io/cloud-builders/npm' args: ['install'] - name: "gcr.io/cloud-builders/gcloud" args: ['app', 'deploy', 'app.yaml', '--verbosity', 'debug']
It is possible to run the exact same build process which runs in Cloud Build on your local machine. Please keep in mind Docker is required.
cloud-build-local --config=cloud-build/cloudbuild.yaml --dryrun=false --push .
Check the documentation for detailed information.
This shows how easy deployments can fail caused by failures in external dependencies, but Google provides us several options to solve such issues very quickly.
Thanks for reading.
Your feedback and questions are highly appreciated, you can find me on Twitter @HeyerSascha.
Subscribe to Sascha Heyer, B.Sc., Software and Machine Learning Engineer
Get the latest posts delivered right to your inbox