Firebase-functions: Error on configure trigger "providers/firebase.auth/eventTypes/user.create"

Created on 17 Jul 2020  ยท  8Comments  ยท  Source: firebase/firebase-functions

[REQUIRED] Version info

node: 10.21.0
firebase-functions: 3.8.0
firebase-tools: 8.1.1
firebase-admin: 9.0.0

[REQUIRED] Test case

Following function:
```import * as functions from 'firebase-functions';
import { setCustomUserClaim } from './user-claims';

const runtimeOpts: functions.RuntimeOptions = {
timeoutSeconds: 30,
memory: '128MB'
}

export const OnUserCreate = functions.runWith(runtimeOpts)
.region("asia-northeast1")
.auth.user().onCreate(async user => {
try {
await setCustomUserClaim(user)
} catch (err) {
console.error(failed to auth because of ${err})
}
});
`` throwsFailed to configure trigger providers/firebase.auth/eventTypes/user.[email protected]` error after moving from node 8 to node 10. without any reason.

[REQUIRED] Steps to reproduce

deploy functions using: firebase deploy --debug --only firestore,functions

[REQUIRED] Actual behavior

firebase.log

[REQUIRED] Expected behavior

It should deploy properly.

needs-triage

Most helpful comment

Same issue here. I can confirm the issue is not related to updating to Node 10. I just re-deployed the same function without any changes and it shows the same error as above.

From the Firebase console:

{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":13,"message":"Failed to configure trigger providers/firebase.auth/eventTypes/[email protected] (__gcf__.europe-west1.auth-onCreate)"},"authenticationInfo":{"principalEmail":"[email protected]"},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction","resourceName":"projects/<#myproj#>/locations/europe-west1/functions/auth-onCreate"}
--

All 8 comments

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@elzenso I have the same problem, but it is not related to Node changes. Everything worked fine earlier this week. Now it is not working. I made no changes at all.

I'm uploading 5 functions. First is HTTP trigger, next 3 of them are regular triggers listening on documents and last one is .auth.user().onCreate(). 4 functions are deployed successfully but 5th one is always failing. It is not possible for me to deploy same version of function as I did few days ago.

โœ”  functions: Finished running predeploy script.
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
โœ”  functions: required API cloudbuild.googleapis.com is enabled
โœ”  functions: required API cloudfunctions.googleapis.com is enabled
i  functions: preparing packages/functions directory for uploading...
i  functions: packaged packages/functions (21.35 KB) for uploading
โœ”  functions: packages/functions folder uploaded successfully
i  functions: updating Node.js 10 function onUserCreated(europe-west1)...
i  functions: updating Node.js 10 function onWorkspaceCreated(europe-west1)...
i  functions: updating Node.js 10 function addUserToWorkspace(europe-west1)...
i  functions: updating Node.js 10 function onUserDeletedFromWorkspace(europe-west1)...
i  functions: updating Node.js 10 function onWorkspaceDeleted(europe-west1)...
โœ”  functions[onUserDeletedFromWorkspace(europe-west1)]: Successful update operation. 
โš   functions[onUserCreated(europe-west1)]: Deployment error.
Failed to configure trigger providers/firebase.auth/eventTypes/[email protected] (__gcf__.europe-west1.onUserCreated)
โœ”  functions[onWorkspaceDeleted(europe-west1)]: Successful update operation. 
โœ”  functions[onWorkspaceCreated(europe-west1)]: Successful update operation. 
โœ”  functions[addUserToWorkspace(europe-west1)]: Successful update operation. 

Edit: It throws an error, but deploy succeed

Now I realized, that it throws an error during deploy, but the function is actually changed. When I change its behavior, it acts differently. So deploy was successful in the background. But error is thrown

Same issue here. I can confirm the issue is not related to updating to Node 10. I just re-deployed the same function without any changes and it shows the same error as above.

From the Firebase console:

{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":13,"message":"Failed to configure trigger providers/firebase.auth/eventTypes/[email protected] (__gcf__.europe-west1.auth-onCreate)"},"authenticationInfo":{"principalEmail":"[email protected]"},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction","resourceName":"projects/<#myproj#>/locations/europe-west1/functions/auth-onCreate"}
--

Yes, I can confirm too it's not related to node 10 after tried to rollback the function.

I'm experiencing the exact same issue. No node upgrade has been performed, and deployments of the same codebase were working yesterday (2020-07-16):
Error is:
{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":13,"message":"Failed to configure trigger providers/firebase.auth/eventTypes/[email protected] (__gcf__.europe-west2.createUserRecord)"},"authenticationInfo":{"principalEmail":"REDACTED"},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction","resourceName":"projects/REDACTED/locations/europe-west2/functions/createUserRecord"}
and I see something very similar for a delete user trigger:
{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":13,"message":"Failed to configure trigger providers/firebase.auth/eventTypes/[email protected] (__gcf__.europe-west2.cleanUpDeletedUser)"},"authenticationInfo":{"principalEmail":"REDACTED"},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction","resourceName":"projects/REDACTED/locations/europe-west2/functions/cleanUpDeletedUser"}

Developers are probably working on this. Now it passed for me locally from my computer and also from CI. :partying_face: :champagne:

Hi, this is a GCF backend issue affecting some of the newer launched regions -- the team is working on it and it should be functional again later today. Since this isn't an SDK issue I'm going to go ahead and close this.

Hello, i have the same problem...

firebase deploy --only functions:OrderStatusChanged

=== Deploying to 'lojavirtualteste-1bce6'...

i  deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint

> functions@ lint /Users/binho/Projetos/loja_virtual/functions
> tslint --project tsconfig.json


WARNING: /Users/binho/Projetos/loja_virtual/functions/src/index.ts:321:5 - Expected a 'for-of' loop instead of a 'for' loop with this simple iteration

Running command: npm --prefix "$RESOURCE_DIR" run build

> functions@ build /Users/binho/Projetos/loja_virtual/functions
> tsc

โœ”  functions: Finished running predeploy script.
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
โœ”  functions: required API cloudbuild.googleapis.com is enabled
โœ”  functions: required API cloudfunctions.googleapis.com is enabled
i  functions: preparing functions directory for uploading...
i  functions: packaged functions (41.64 KB) for uploading
โœ”  functions: functions folder uploaded successfully
i  functions: current functions in project: OrderStatusChanged(us-central1), authorizeCreditCard(us-central1), cancelCreditCard(us-central1), captureCreditCard(us-central1), onNewOrder(us-central1)
i  functions: uploading functions in project: OrderStatusChanged(us-central1)
i  functions: updating Node.js 10 function OrderStatusChanged(us-central1)...
โš   functions[OrderStatusChanged(us-central1)]: Deployment error.
Failed to configure trigger providers/cloud.firestore/eventTypes/[email protected] (__gcf__.us-central1.OrderStatusChanged)


Functions deploy had errors with the following functions:
        OrderStatusChanged


To try redeploying those functions, run:
    firebase deploy --only functions:OrderStatusChanged


To continue deploying other features (such as database), run:
    firebase deploy --except functions

Error: Functions did not deploy properly.
Was this page helpful?
0 / 5 - 0 ratings