Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot redeploy functions after CLI upgrade from 10.2.2→10.3.0 #4307

Closed
dsl101 opened this issue Mar 16, 2022 · 13 comments · Fixed by #4310
Closed

Cannot redeploy functions after CLI upgrade from 10.2.2→10.3.0 #4307

dsl101 opened this issue Mar 16, 2022 · 13 comments · Fixed by #4310

Comments

@dsl101
Copy link

dsl101 commented Mar 16, 2022

[REQUIRED] Environment info

firebase-tools: 10.3.0

Platform: Windows

[REQUIRED] Test case

Function in module, named by path httpsDeptest:

const { functions } = require('utils')

exports = module.exports = functions.https.onCall(() => {
  console.log('ok')
})

[REQUIRED] Steps to reproduce

Deploy twice. First deploy works fine, second fails:

$ firebase deploy --only=functions:httpsDeptest

=== Deploying to '[REMOVED]'...

i  deploying functions
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 (120.01 KB) for uploading
i  functions: ensuring required API cloudscheduler.googleapis.com is enabled...
+  functions: required API cloudscheduler.googleapis.com is enabled
+  functions: functions folder uploaded successfully
i  functions: creating Node.js 14 function httpsDeptest(us-central1)...
+  functions[httpsDeptest(us-central1)] Successful create operation.
Function URL (httpsDeptest(us-central1)): https://us-central1-[REMOVED].cloudfunctions.net/httpsDeptest
i  functions: cleaning up build files...

+  Deploy complete!

$ firebase deploy --only=functions:httpsDeptest

=== Deploying to '[REMOVED]'...

i  deploying functions
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 (120.01 KB) for uploading
i  functions: ensuring required API cloudscheduler.googleapis.com is enabled...
+  functions: required API cloudscheduler.googleapis.com is enabled
+  functions: functions folder uploaded successfully

Error: [httpsDeptest(us-central1)] Changing from a callable function to an HTTPS function is not allowed. Please delete your function and create a new one instead.

[REQUIRED] Expected behavior

That the function would redeploy.

[REQUIRED] Actual behavior

Deployment ends with:

Error: [httpsDeptest(us-central1)] Changing from a callable function to an HTTPS function is not allowed. Please delete your function and create a new one instead.
@dsl101 dsl101 added the bug label Mar 16, 2022
@dsl101
Copy link
Author

dsl101 commented Mar 16, 2022

Reverting to 10.2.2 works around the problem for now. I didn't include the full --debug output, as it seemed to contain quite a bit of sensitive info. Please advise if it required.

@Schmale97
Copy link

I am also seeing this issue on Ubuntu

@nachoalthabe
Copy link

Also on Mac

@bkendall
Copy link
Contributor

Sounds like an issue in the CLI - I'll quickly raise with the Functions team.

@LeadDreamer
Copy link

LeadDreamer commented Mar 16, 2022

I just dropped back to 10.2.2 - did NOT solve the problem. Otherwise same symptoms

Improper fallback. Forced it again. seems to be working.

@dcgudeman
Copy link

Any update on this?

@gustavopch
Copy link

Same error here when redeploying a function with firebase-tools@10.3.0 on GitHub Actions on an Ubuntu 20.04.4 machine.

Changing from a callable function to an HTTPS function is not allowed. Please delete your function and create a new one instead.

@ivan416
Copy link

ivan416 commented Mar 16, 2022

Downgraded to 10.2.2 for now, since it works ok there. Glad to hear I'm not the only one experiencing this issue.
https://stackoverflow.com/questions/71368085/gcp-cloud-function-environment-variable-becomes-unset

@taeold
Copy link
Contributor

taeold commented Mar 16, 2022

Hi folks - apologies for trouble here.

We are working hard to get a fix out. We expect new version w/ the fix to be out by this afternoon US Pacific time.

In the meantime, here are some workarounds:

  1. Pin Firebase CLI to v10.2.2.

  2. If you must use the latest Firebase CLI: A temporary workaround is to remove "deployment-callable" or "deployment-callabled" label from your callable function. To do this, go to https://pantheon.corp.google.com/functions/list and find your function, and remove the said label:

image

Note that the label will reappear after Firebase CLI deploy, so this is more-or-less a one time fix.

Again, apologies and will keep this thread updated as we release a patch.

taeold pushed a commit that referenced this issue Mar 16, 2022
Fixes #4307 and #4302.

`endpointFromFunction` was correctly identifying that `labels["deployment-callable"]` gives an endpoint a `callableTrigger` but `parseTriggers.ts` had no codepath that gave them a `callableTrigger` (instead falling back to an `httpsTriggerr` and labels).
@dcgudeman
Copy link

when will fix #4310 be released?

@taeold
Copy link
Contributor

taeold commented Mar 16, 2022

@dcgudeman We just shipped v10.3.1:

https://github.com/firebase/firebase-tools/releases/tag/v10.3.1

Please give the latest cli version a go:

npm i -g firebase-tools@latest

@gustavopch
Copy link

That was fast!

@taeold
Copy link
Contributor

taeold commented Mar 16, 2022

@gustavopch It was a very bad bug :( Apologies everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants