79581637

Date: 2025-04-18 19:55:20
Score: 0.5
Natty:
Report link

I think this started with a previous failed attempt to deploy the function. The deploy was happening in a GitHub Action, so it could not be interactive, and it failed with this error:

i  functions: creating Node.js 22 (2nd Gen) function helloWorld(us-central1)...
Could not build the function. 

Functions deploy had errors with the following functions:
    helloWorld(us-central1)
⚠  functions: No cleanup policy detected for repositories in us-central1. This may result in a small monthly bill as container images accumulate over time.

Error: Functions successfully deployed but could not set up cleanup policy in location us-central1. Pass the --force option to automatically set up a cleanup policy or run 'firebase functions:artifacts:setpolicy' to manually set up a cleanup policy.
Error: Process completed with exit code 1.

Apparently now you have to set up that policy before you can deploy. If you do the first deploy manually from the command line, it will ask you how long to keep images before they're deleted. But it can't do that in a non-interactive CI environment. So it fails.

After this, the function existed in the Firebase console, but it didn't work, and further attempts to deploy it failed as described in the question.

The solution was to manually delete the function with firebase functions:delete helloWorld. Then when I tried to deploy again, it succeeded.

I don't know if this is the only way a function can get into this non-deployable state, but if you are getting the same error (without any more helpful messages), it's probably worth a try to delete the function and try again.

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): getting the same error
  • Self-answer (0.5):
  • High reputation (-1):
Posted by: aldel