Open
Description
TL;DR
When trying to update the source code of a Cloud Function created via the GCP Console using deploy‑cloud‑functions v3 Beta, I encounter a 409 Conflict error due to internal metadata mismatches. Related issue #351 was reviewed but did not resolve the problem.
Expected behavior
Updating only the source code of the existing Cloud Function should succeed, and the function’s URL should be output normally.
Observed behavior
Error: google-github-actions/deploy-cloud-functions failed with: failed to POST https://cloudfunctions.googleapis.com/v2/projects/MY-PROJECT/locations/asia-northeast1/functions?functionId=deploy-function-from-github: (409)
Action YAML
jobs:
job_id:
runs-on: 'ubuntu-latest'
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: 'actions/checkout@v4'
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
project_id: 'my-project'
workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'
- id: 'deploy'
uses: 'google-github-actions/deploy-cloud-functions@v3'
with:
name: 'deploy-function-from-github'
runtime: 'python39'
region: 'asia-northeast1'
source_dir: './source/'
entry_point: 'hello_http'
- id: 'test'
run: 'curl "${{ steps.deploy.outputs.url }}"'
Log output
##[debug]Evaluating condition for step: 'Run google-github-actions/deploy-cloud-functions@v3'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Run google-github-actions/deploy-cloud-functions@v3
##[debug]Loading inputs
##[debug]Loading env
Run google-github-actions/deploy-cloud-functions@v3
##[debug][F] (420) main.py => /home/runner/work/deploy-function-from-github/deploy-function-from-github/source/main.py
##[debug][F] (420) requirements.txt => /home/runner/work/deploy-function-from-github/deploy-function-from-github/source/requirements.txt
34
Created zip file from './source/' at '/tmp/cfsrc-0d078201c2491d4c48106d69.zip'
Creating new Cloud Functions deployment
##[debug]create: computed Cloud Function:
##[debug]{
##[debug] "name": "projects/temp-for-sandbox/locations/asia-northeast1/functions/deploy-function-from-github",
##[debug] "environment": "GEN_2",
##[debug] "buildConfig": {
##[debug] "runtime": "python39",
##[debug] "entryPoint": "hello_http",
##[debug] "source": {
##[debug] "storageSource": {
##[debug] "bucket": "gcf-v2-uploads-167288324888.asia-northeast1.cloudfunctions.appspot.com",
##[debug] "object": "be97fc77-ae41-49dd-bd89-cc1e8301bd5a.zip"
##[debug] }
##[debug] }
##[debug] },
##[debug] "serviceConfig": {
##[debug] "allTrafficOnLatestRevision": true,
##[debug] "availableMemory": "256Mi",
##[debug] "ingressSettings": "ALLOW_ALL",
##[debug] "timeoutSeconds": 60
##[debug] }
##[debug]}
Error: google-github-actions/deploy-cloud-functions failed with: failed to POST https://cloudfunctions.googleapis.com/v2/projects/my-project/locations/asia-northeast1/functions?functionId=deploy-function-from-github: (409) {
"error": {
"code": 409,
"message": "Could not create Cloud Run service deploy-function-from-github. A Cloud Run service with this name already exists. Please redeploy the function with a different name.",
"status": "ALREADY_EXISTS"
}
}
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Run google-github-actions/deploy-cloud-functions@v3
Additional information
- This issue targets an existing Cloud Function created via the GCP Console .
- All input parameters (function name, region, runtime, entry point, etc.) match the settings of the function as seen in the console.
- The service account used has been granted the Cloud Functions Admin role (roles/cloudfunctions.admin).
- I have reviewed related issue #351, but the suggested workarounds did not resolve the conflict.
- I intend only to update the source code without recreating the resource. Any guidance on how to update just the code while ignoring internal metadata mismatches would be greatly appreciated.