1,545 questions
0
votes
2
answers
75
views
Cloud build error in liquibase step to enable spanner API
I have setup a GCP project for build activities that support multiple GCP projects deployments, this way I have one place to manage the CI/CD and in this project no other resources APIs like spanner ...
0
votes
0
answers
60
views
Cloud Build/Artifact Registry Permission Denied Error - cloudbuild.gserviceaccount.com Service Account Missing
Dear Stack Overflow Community,
I am encountering a critical deployment issue with my Google Cloud project gvnalgosoftware (Project ID: 511171631078).
I am attempting to build my Flask application as a ...
0
votes
1
answer
96
views
GCP GKE how to not create pod with selector managed-by cloud-console
I have been manually deploying new pods with GKE for the past three years. Once done, I then configure Cloud Build for my CI/CD to deploy to GKE once the image is created, etc.
For the CD from ...
0
votes
1
answer
64
views
Google Cloud Run keeps giving from metadata despite the metadata being present [Python/Flask]
I have a pyproject.toml file that looks like this:
[build]
builder = "gcr.io/buildpacks/builder:google-22"
[project]
name = "schoolProject"
version = "0.0.1"
authors = [
...
0
votes
0
answers
86
views
Control git init.defaultBranch settings in FETCHSOURCE
How can I set git config --global init.defaultBranch main during the FETCHSOURCE step in google cloud build?
The mission is silencing this redundant message:
hint: Using 'master' as the name for the ...
0
votes
0
answers
97
views
ModuleNotFoundError on GCP Cloud Run
I'm deploying a fastapi app to GCP Cloud Run. Cloud Run builds from a Dockerfile, the app secrets are added to gcr container volumes from Secret Manager.
I get a ModuleNotFoundError with a certain ...
0
votes
0
answers
30
views
create cloud build trigger
Terraform "google_cloudbuild_trigger" resource failing to create trigger
#Resource
Terraform will perform the following actions:
# google_cloudbuild_trigger.cloud_build_trigger will be ...
1
vote
1
answer
194
views
Cloud build keeps using legacy service account despite change in settings
In june 2024, GCP changed the default service account for Cloud Build as explained here https://cloud.google.com/build/docs/cloud-build-service-account-updates#what_do_you_need_to_do
Due to this, new ...
0
votes
1
answer
267
views
Cloud Build fails to use Docker BuildKit Cache
We are using Cloud Build to deploy our Docker container to Cloud Run. We would like to speed up the process with caching, as described here:
https://cloud.google.com/build/docs/optimize-builds/...
0
votes
0
answers
61
views
Cloud Build secretEnv not injecting Vite env vars for Firebase config (auth/invalid-api-key)
I'm struggling with a persistent FirebaseError: Firebase: Error (auth/invalid-api-key) error in my deployed Vite/React frontend application. This error only occurs when the application is built and ...
0
votes
0
answers
117
views
go test takes long time to start running on Google Cloud Build
Context
I have a very simple, bare bones cloudbuild.yaml that:
sets up GOPRIVATE variable so that the CI environment is able to download dependencies
Runs go build
Runs go test:
steps:
- id: "...
0
votes
0
answers
60
views
Cannot see the logs from Firebase Database in Google Cloud Run to send push notification
I am trying to use Firebase logs.
I am able to add new records into my Firebase Realtime Database Chat entity.
The problem is I cannot see any logs or errors when browsing them at Google Cloud Log ...
0
votes
1
answer
82
views
Can I add extra build steps when deploy cloud functions on GCP?
I am using terraform to deploy a python cloud function, similar to the official example, things are working as expected but now I want to use protobuf, which requires extra compile step, I know cloud ...
0
votes
1
answer
116
views
Is it possible to pull regional secrets from GCP into Cloud Build config file?
As noted here in GCP documentation for Cloud Build, you can reference secrets without writing explicit gcloud commands by using the "availableSecrets" block. This works great for global ...
0
votes
0
answers
79
views
Why is RUN pip install from Github not working in my Dockerfile?
RUN pip install git+https://${GITHUB_TOKEN}@github.com//packages.git#egg=mypackage&subdirectory=mypackage is not working in my Dockerfile
This is my Dockerfile
FROM python:3.9-slim
COPY . /app
...
1
vote
2
answers
638
views
Cloud Build Trigger Fails with PERMISSION_DENIED: Permission 'cloudbuild.builds.create' denied Despite Correct IAM Setup
Problem:
I am trying to set up a CI/CD pipeline in Google Cloud Platform using Cloud Build with a GitHub trigger. However, when I attempt to trigger the build using the Cloud Build trigger, I get the ...
0
votes
1
answer
149
views
Firebase App Hosting backend configurations in apphosting.yaml are not applied
On March 12, 2025, there was an incident with Firebase App Hosting configuration:
https://status.firebase.google.com/incidents/dMqtcJBwkmWeGDhmGqjN
The incident is supposed to be resolved but I am ...
1
vote
1
answer
89
views
CI pipe failing to connect to test database
When I try to run my app's test suite in a CI pipe using Google Cloud Build, the process fails during the tests step with a database authentication error:
error: password authentication failed for ...
0
votes
0
answers
63
views
Deploying a Kedro project to cloud build with pytest accessing to google cloud storage
I am trying to deploy my Kedro instance in Cloud Run which my cloudbuild.yml look like this :
steps:
- name: "noobzik/uv-gcp-cloud-build"
id: CI
entrypoint: /bin/bash
env:
- ...
-1
votes
1
answer
272
views
I'm having a hard time passing secrets in gcp secret manager to cloud build docker build stage. Am i passing these correctly?
steps:
name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
entrypoint: 'bash'
args:
'-c'
|
echo "Fetching secrets from Secret Manager..."
echo -n $(gcloud secrets versions access latest -...
0
votes
1
answer
110
views
googleapis.cloudbuild.v1.projects.triggers.run INVALID_ARGUMENT with no clues
Trying to reproduce this command from Google Workflow:
gcloud builds triggers run aaa-bbb-ccc-ddd-eee --region="us-central1" --project=prj-dev3 --branch="ci-cd"
Where xxx is the ...
0
votes
2
answers
194
views
Alternatives for using PNPM in a cloudbuild CI pipeline
I'd like to use pnpm in my CI cloudbuild pipeline. But, does that mean that i have to install it in every step? Since steps in cloudbuild are indepedent from each other. What are the alternatives?
...
0
votes
0
answers
38
views
import issues with Cloud Build js sdk
In my react router v7 app with vite and type:'module' in package.json:
This:
import { CloudBuildClient } from '@google-cloud/cloudbuild';
throws:
Error: Failed to resolve entry for package "@...
3
votes
0
answers
29
views
Google cloud build docker multistage build store test artfifacts
Give I have a cloudbuild.yaml file which builds a multistage Dockerfile, how do I store artifacts generated by Docker?
My Dockerfile contains this section:
FROM golang:1.23-alpine AS build
WORKDIR /...
0
votes
1
answer
70
views
Deploying Cloud Run job works fine, using cloudbuild.yml fails in cryptic manner
This works fine:
gcloud run jobs deploy myjob --project myproject --image us-east1-docker.pkg.dev/myproject/myrepo/myimage:latest --region us-east1
It yields:
✓ Creating job... Done. ...
0
votes
1
answer
561
views
How to select x86_64 vs aarch64 in Google Cloud Build?
I'm using Google Cloud Build to generate binary artifacts that I deploy to N1 series VMs. For years, I've done this by setting my cloudbuild.yaml to gcr.io/cloud-builders/docker and then, in the ...
0
votes
1
answer
120
views
GCP Cloudbuild Git Submodule Python Installation Failing in Docker Build
I'm trying to use GCP Cloudbuild to deploy a python project managed with UV. The project has a private git submodule that I'm cloning with an ssh setup in cloudbuild yaml (taken from this example)
The ...
0
votes
0
answers
60
views
Can I setup Gloud Cloud Build with a source repository shared to my github account?
I am setting up a GCloud function on Cloud Run for a client. He has shared his repo with me on github so I can access it. However, when choose the 'continuously deploy from a repository' option and ...
2
votes
1
answer
842
views
How to Properly Inject Service Account Credentials in Google Cloud Build for Cloud Run Deployment?
I’m deploying a Laravel application to Google Cloud Run using Google Cloud Build. During the Docker build process, I need to access Google Secret Manager to inject secrets into the application code ...
0
votes
0
answers
116
views
How do I resolve the File "/layers/google.python.pip/pip/bin/functions-framework", line 8, in <module> sys.exit(_cli()) error a cloud function build?
I am trying to launch a basic function on google cloud build that will count the number of users every time a new user is added to a firestore database. Here is a basic layout of my code
import time
...
3
votes
1
answer
561
views
Upgrade to Angular v19 with hybrid rendering rollout to Firebase App Hosting fails in google cloud build
Environment Angular-ssr v18 deployed on Firebase App Hosting. When a new version of the app is uploaded to Github the rollout to App Hosting is triggered automatically, which includes the build ...
0
votes
1
answer
108
views
Copy function fails in GCP Cloud Build?
I'm having a strange problem where a Dockerfile builds completely fine locally but fails in GCP cloud build due to being unable to find the source files during a copy statement. I am building a spring ...
0
votes
1
answer
928
views
Cannot find cloud build service account for GCP
I am setting up IaC with cloud build by following this guide: https://cloud.google.com/docs/terraform/resource-management/managing-infrastructure-as-code#clean-up
I've run the following in the cloud ...
2
votes
1
answer
85
views
Run cloud-build triggers with Node.js library
I have a manual regional cloudbuild trigger, that uses Cloudbuild repositories (2nd gen) to make connections with github. I also need to pass substitution variables to the trigger.
Following this ...
0
votes
2
answers
283
views
How to clone a (second gen) 2nd Gen Google Cloud Repository from Cloud Build?
I need to write a bash script to run inside my Google Cloud Build's build process. This bash script needs to clone a 2nd Gen Repository (since now former Source Repositories is deprecated), but I can'...
1
vote
1
answer
193
views
Problems deploying Firebase Functions from Google Cloud Build
The instructions to deploy 'hosting' seemed to be super simple, just:
args: ['deploy', '--project=project-id', '--only=hosting']
Now, I wanted to deploy hosting and functions, so I stripped the '--...
1
vote
1
answer
109
views
My secrets are blank in my cloudbuild.yaml file
I'm currently learning how to do CI/CD in GCP. In a personal project I try to make a CI/CD between my GitHub repository and my artifact registry depo and my cloud run service. Also, I set up all my ...
0
votes
0
answers
158
views
I can not access the environmental variable from Secret Manager that I passed in the secretEnv in Google Cloud Build
steps:
- name: gcr.io/cloud-builders/docker
entrypoint: bash
args:
- '-c'
- |
docker pull $_AR_HOSTNAME/$PROJECT_ID/cloud-run-source-deploy/$REPO_NAME/$_SERVICE_NAME:...
0
votes
1
answer
179
views
Cloud Build private DNS GCP
I'm trying to use cloud build with private pools to run builds on gitlab self hosted Instance. All are in same VPC, but I'm cloud build when triggered is not able to resolve the host of gitlab ...
-2
votes
1
answer
501
views
Terraform cloudbuild trigger: Error 400: Repository mapping does not exist
I am trying to provision a cloudbuild v1 trigger within my GCP project, however I run into the following issue:
Error: Error creating Trigger: googleapi: Error 400: Repository mapping does not exist. ...
2
votes
1
answer
135
views
Resolving secret during Cloud Build not working?
My Dockerfile requires the GITHUB_TOKEN to be set in order to be able to download and install an npm package.
Hence, my Dockerfile an argument GITHUB_TOKEN. This is working fine locally.
The problem ...
1
vote
1
answer
184
views
Update Specific field Cloud Build Trigger
I have hundreds of Cloud Build triggers using Gen1 source and the global location across multiple GCP projects, and I want to migrate them to Gen2 of the source. I tried using a Python script, similar ...
2
votes
1
answer
333
views
KeyError: 'Name' in pipenv/vendor/importlib_metadata/_adapters.py:54 using pipenv
I got this weird error in my CI/CD pipeline running in GCP Cloud build.
Package installation failed... KeyError: 'Name' site-packages/pipenv/vendor/importlib_metadata/_adapters.py:54 everything is ...
0
votes
1
answer
244
views
curl failing in Google Cloud Build when using a secret
As part of my CD deploy pipe in Google Cloud Build I would like to notify a Slack channel, but I am struggling to use the Secret Manager to supply the secret notification endpoint. This build config ...
0
votes
0
answers
146
views
How to deploy Google Cloud Functions (v1) without Cloud Source Repositories?
I'm running into an issue with my new client where I used to rely on Cloud Source Repositories connected to a private GitHub repository for my previous clients. After selecting the repo and ...
0
votes
0
answers
225
views
Angular 18 deployment to GCP App Engine using Cloud Build Trigger from Github
I've added a trigger to my Cloud Build that is failing when deploying my Angular 18 application to an App Service on the App Engine. I can manually release my application by copying it up to a cloud ...
0
votes
1
answer
44
views
Access AWS database during Cloudbuild builds
How can I access an AWS MySQL database as part of a unit test that gets executed during a cloudbuild build on GCP?
I can access this database when I'm firing a cloud function with the cloud scheduler ...
1
vote
2
answers
721
views
Purge Google Cloud Build History
Is it possible to purge old builds from the build history.
We have no need to keep history older than a month, I thought storing the logs in a user created bucket would help, but this only affect the ...
0
votes
1
answer
387
views
How to use dynamically versioning in cloudbuild.yaml file?
This is my cloudbuild.yaml file. In this file i manually write the version of the new application, but i want to take this automatically by any approach, Is this possible anyhow?
steps:
Step 1: Build ...
0
votes
1
answer
365
views
Pass Gitlab CI_JOB_TOKEN from Cloud Build to Dockerfile
I am in dire need of help on this. I feel like I've tried every piece of advice online to no avail. I must be missing something!!
Background
I want to use Gitlab CICD and GCP Cloud Build to build a ...