firebase / firebase-tools

The Firebase Command Line Tools
MIT License
4.01k stars 925 forks source link

Functions deploy fails on firebase-tools version 13.15.3 but works in 13.15.2 #7575

Closed Spitzbua closed 3 weeks ago

Spitzbua commented 3 weeks ago

[REQUIRED] Environment info

firebase-tools: 13.15.3

Platform: Windows

[REQUIRED] Test case

Deploy firebase function v2

[REQUIRED] Steps to reproduce

firebase deploy --only functions

[REQUIRED] Expected behavior

Functions will be deployed

[REQUIRED] Actual behavior

Deploy fails

[debug] [2024-08-21T13:09:58.665Z] TypeError: Cannot convert undefined or null to object at Function.entries () at Object.want (C:\Users\thoma\AppData\Roaming\fnm\node-versions\v20.16.0\installation\node_modules\firebase-tools\lib\deploy\extensions\planner.js:120:28) at prepareDynamicExtensions (C:\Users\thoma\AppData\Roaming\fnm\node-versions\v20.16.0\installation\node_modules\firebase-tools\lib\deploy\extensions\prepare.js:122:48) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async prepare (C:\Users\thoma\AppData\Roaming\fnm\node-versions\v20.16.0\installation\node_modules\firebase-tools\lib\deploy\functions\prepare.js:62:9) at async chain (C:\Users\thoma\AppData\Roaming\fnm\node-versions\v20.16.0\installation\node_modules\firebase-tools\lib\deploy\index.js:40:9) at async deploy (C:\Users\thoma\AppData\Roaming\fnm\node-versions\v20.16.0\installation\node_modules\firebase-tools\lib\deploy\index.js:97:5) [error]

google-oss-bot commented 3 weeks ago

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

aalej commented 3 weeks ago

Hey @Spitzbua, thanks for reporting this! I was able to reproduce the error you mentioned. Let me raise this to our engineering team so they can take a look. For those also encountering this, could you try downgrading to v13.15.2 to workaround the issue.

OlivierLebra commented 3 weeks ago

Another workaround is to add an empty "extensions": [] array field to your firebase.json.

gregfenton commented 3 weeks ago

I am seeing this issue pop up in 2 different public forums. When deploying with --debug they are seeing:

[2024-08-21T17:09:37.182Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/FOOBAR:testIamPermissions {"permissions":["firebase.projects.get","firebaseextensions.instances.list"]}
[2024-08-21T17:09:37.237Z] TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at Object.want (C:\Users\FOOBAR\AppData\Roaming\npm\node_modules\firebase-tools\lib\deploy\extensions\planner.js:120:28)
    at prepareDynamicExtensions (C:\Users\FOOBAR\AppData\Roaming\npm\node_modules\firebase-tools\lib\deploy\extensions\prepare.js:122:48)
.......
.......
dhamuace commented 3 weeks ago

I am getting same issue in my end today.

image

dhamuace commented 3 weeks ago

And guys after downgraded to v13.15.2 it finally works!!! Thanks for short workaround @aalej

meisolated commented 3 weeks ago

I was also facing the same issue, but making a small tweak to the command made it work for me. image

joehan commented 3 weeks ago

Hey all, sorry for the inconvenience here. This should be fixed in 13.15.4, which will be available on npm shortly

gregfenton commented 3 weeks ago

No need to be sorry. We've all been here and will be here a million times again.

See it as the opportunity to improve test automation that it is! 😁

siarheidudko commented 3 weeks ago

@joehan Your fix has completely broken my project. In CI (Github Actions) I used the command when deploying: firebase deploy -m "Autodeploy from GitHUB ($GITHUB_ACTOR)" --only functions --force

It has completely removed all extensions and their settings ( #7582 ). Probably such actions lead to the fact that I will be forced to abandon firebase in the future, because your work is very unstable.

gregfenton commented 3 weeks ago

@siarheidudko In my opinion, that comment and flaying of blame is uncalled for.

Your system not having sufficient fail-safes, that takes "the latest and greatest" without safety checks or questions is not someone else's problem.

siarheidudko commented 3 weeks ago

@gregfenton I pay for Google services and I expect services of acceptable quality. In the concept of a service, I also include tools provided by Google or their subsidiaries such as Firebase. I understand mistakes when these mistakes do not lead to irreversible consequences. But today I had to spend several hours manually reinstalling and configuring all the deleted extensions. I also had to stop the project for a few hours while a decision was made to minimize the consequences. The previous problem in 13.15.3, for example, did not lead to irreversible consequences and simply required a downgrade. At the same time, the deployment of extensions from the documentation would have to occur with the commands firebase deploy --only extensions link But it doesn't work. Moreover, the description available in the console does not provide for deleting all extensions at once or installing them from the env file. If you consider it appropriate for yourself to deploy a test environment only for testing firebase-tools and update your CI processes manually, then this is your personal business and your personal money.