Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Fail to deploy firebase functions.

I'm trying to deploy my functions via CLI. `firebase deploy --only functions`. Before one day everything works as expected. I added pub/sub trigger to listen for a topic not sure if this is problematic. I got these errors for each functions: Could not create or update Cloud Run service removeevent, Container Healthcheck failed. Revision 'removeevent-00001-xam' is not ready and cannot serve traffic. The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might
contain more information.

3 7 8,119
7 REPLIES 7

I'm getting the same error when deploying through firebase v2 cloud functions.  Any trigger based fucntions are appearing as "unknown trigger" and the callable functions are simply geing set as "http requests".  As firebase handles the setting up of listeners and ports and containers there must be something wrong deeper in the system.

Could not create or update Cloud Run service fcfdelcal, Container Healthcheck failed. Revision 'fcfdelcal-00001-zep' is not ready and cannot serve traffic. The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information.

Checked the log file and there was a dependency missing in the package.json file.  Added this and everything worked fine (after deleting all the bad functions out of the cloud so new versions could upload).    Had run fine on local emulator, just not sure why it worked in testing and not in deployment!

Use the command set PORT=, which fixes the issue of the port listening to 8080, allowing Firebase to create a new port for deployment.

Hi, what is this command? Where do you enter it?

You cannot set the port on a firebase function so this answer is wrong. 

Did anyone manage to resolve this issue? I'm facing the same error

I did it was because you can't use function.config in the same project as gen 2 functions. You can't use the old config even if it's not in the gen 2 function. Unfortunately they make it seem like you can use some v1 and some v2 functions. Most likely you have to convert everything at once and convert everything to parameterized config. 

Top Labels in this Space
Top Solution Authors