deploy-cloud-functions
deploy-cloud-functions copied to clipboard
Invalid Request. Violations: Event triggered 1st Gen function should have trigger resource set.
TL;DR
I try to deploy cloud function (gen1, because gen2 does not support trigger firebase auth) but It always response an error
Error: google-github-actions/deploy-cloud-functions failed with: failed to POST https://cloudfunctions.googleapis.com/v2/projects/pds-system-dev/locations/us-central1/functions?functionId=createUserHook: (400) {
"error": {
"code": 400,
"message": "Invalid Request. Violations: Event triggered 1st Gen function should have trigger resource set.",
"status": "INVALID_ARGUMENT"
}
}
I don't know what resource is mentioned here, and how to push it in .yaml file
Expected behavior
No response
Observed behavior
No response
Action YAML
name: CI/CD Pipeline
on:
push:
branches:
- main
env:
AWS_REGION: ap-northeast-1
jobs:
deploy:
name: Deploy Function
runs-on: ubuntu-latest
environment: dev
steps:
- name: Checkout
uses: actions/checkout@v4
- name: (Dev) Authenticate the action
id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.SERVICE_ACCOUNT_JSON_ONELINE }}
- name: (Dev) Deploy firebase function
id: 'deploy'
uses: 'google-github-actions/deploy-cloud-functions@v3'
timeout-minutes: 10
with:
name: 'createUserHook'
runtime: 'nodejs20'
environment: GEN_1
memory: '128M'
source_dir: './functions'
event_trigger_type: 'providers/firebase.auth/eventTypes/user.create'
Log output
No response
Additional information
No response
When I add
event_trigger_service_account: '[email protected]' to .yaml file, new error appear:
"error": {
"code": 400,
"message": "Invalid Request. Violations: v2.event_trigger.service_account_email shouldn't be set for 1st Gen functions.",
"status": "INVALID_ARGUMENT"
}
Hi there - could you please provide the debug output for the complete GitHub Actions workflow run?
@sethvargo I have enabled debug logging by set ACTIONS_STEP_DEBUG to true, and below is full output
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: (Dev) Deploy firebase function
##[debug]Loading inputs
##[debug]Loading env
Run google-github-actions/deploy-cloud-functions@v3
with:
name: createUserHook
runtime: nodejs20
environment: GEN_1
memory: 128M
source_dir: ./functions
event_trigger_type: providers/firebase.auth/eventTypes/user.create
event_trigger_service_account: [email protected]
region: us-central1
universe: googleapis.com
all_traffic_on_latest_revision: true
ingress_settings: ALLOW_ALL
service_timeout: 60s
vpc_connector_egress_settings: PRIVATE_RANGES_ONLY
event_trigger_retry: true
env:
AWS_REGION: ap-northeast-1
CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE: /home/runner/work/pds-be/pds-be/gha-creds-7ab1b0f9b43963de.json
GOOGLE_APPLICATION_CREDENTIALS: /home/runner/work/pds-be/pds-be/gha-creds-7ab1b0f9b43963de.json
GOOGLE_GHA_CREDS_PATH: /home/runner/work/pds-be/pds-be/gha-creds-7ab1b0f9b43963de.json
CLOUDSDK_CORE_PROJECT: pds-system-dev
CLOUDSDK_PROJECT: pds-system-dev
GCLOUD_PROJECT: pds-system-dev
GCP_PROJECT: pds-system-dev
GOOGLE_CLOUD_PROJECT: pds-system-dev
##[debug][F] (420) .eslintrc.js => /home/runner/work/pds-be/pds-be/functions/.eslintrc.js
##[debug][F] (420) .gitignore => /home/runner/work/pds-be/pds-be/functions/.gitignore
##[debug][F] (420) package-lock.json => /home/runner/work/pds-be/pds-be/functions/package-lock.json
##[debug][F] (420) package.json => /home/runner/work/pds-be/pds-be/functions/package.json
##[debug][D] (493) src/ => /home/runner/work/pds-be/pds-be/functions/src/
##[debug][F] (420) src/index.ts => /home/runner/work/pds-be/pds-be/functions/src/index.ts
##[debug][F] (420) tsconfig.dev.json => /home/runner/work/pds-be/pds-be/functions/tsconfig.dev.json
##[debug][F] (420) tsconfig.json => /home/runner/work/pds-be/pds-be/functions/tsconfig.json
Created zip file from './functions' at '/tmp/cfsrc-6b4b18d191565b885595e76a.zip'
Updating existing Cloud Functions deployment
Error: google-github-actions/deploy-cloud-functions failed with: failed to PATCH https://cloudfunctions.googleapis.com/v2/projects/pds-system-dev/locations/us-central1/functions/createUserHook: (400) {
"error": {
"code": 400,
"message": "Invalid Request. Violations: v2.event_trigger.service_account_email shouldn't be set for 1st Gen functions.",
"status": "INVALID_ARGUMENT"
}
}
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: (Dev) Deploy firebase function
And what happens if you don't set event_trigger_service_account?
And what happens if you don't set event_trigger_service_account?
the error described my first comment will appear
Sorry, I mean the debug logs for when event_trigger_service_account is not set.
Hi @huy-trinh-pionero - can you please attach the debug logs for when event_trigger_service_account is not set?