Skip to content

[Error] V2 functions deployment fails with error in cloud run container service container fails to start #1131

Closed
@algoflows

Description

@algoflows

node:

16

firebase-functions:

3.21.2

firebase-tools:

v11.0.1

firebase-admin:

Steps to reproduce

Deploying a single v2 firebase cloud function

// FIREBASE V2 FUNCTION
const { onRequest } = require("firebase-functions/v2/https");

module.exports = onRequest(
  { timeoutSeconds: 1200, region: ["europe-west1"] },
  (_req, res) => {
    res.status(200).send("OK");
  }
);

Expected behavior

Deploy the gen2 firebase cloud function successefully and error free

Actual behavior

Deployment fails, v2 functions are unusable as they simply don't deploy.

Screenshot 2022-06-02 at 01 18 34

Were you able to successfully deploy your functions?

NO

run > firebase deploy --only functions:function-name

result:
Screenshot 2022-06-02 at 01 17 26

❯ firebase deploy --only functions:webhooks-aifi-v2-checkout

=== Deploying to 'cornershop-app'...

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 codebase default for deployment
i  functions: preparing functions directory for uploading...
i  functions: packaged /Users/seank/Projects/capgemini/cornershop-app/functions (55.5 MB) for uploading
i  functions: packaged /Users/seank/Projects/capgemini/cornershop-app/functions (55.5 MB) for uploading
i  functions: ensuring required API cloudscheduler.googleapis.com is enabled...
✔  functions: required API cloudscheduler.googleapis.com is enabled
i  functions: ensuring required API artifactregistry.googleapis.com is enabled...
i  functions: ensuring required API run.googleapis.com is enabled...
i  functions: ensuring required API eventarc.googleapis.com is enabled...
i  functions: ensuring required API pubsub.googleapis.com is enabled...
i  functions: ensuring required API storage.googleapis.com is enabled...
✔  functions: required API eventarc.googleapis.com is enabled
✔  functions: required API run.googleapis.com is enabled
✔  functions: required API pubsub.googleapis.com is enabled
✔  functions: required API storage.googleapis.com is enabled
✔  functions: required API artifactregistry.googleapis.com is enabled
i  functions: generating the service identity for pubsub.googleapis.com...
i  functions: generating the service identity for eventarc.googleapis.com...
✔  functions: functions folder uploaded successfully
i  functions: creating Node.js 16 function webhooks-aifi-v2-checkout(europe-west1)...
Could not create or update Cloud Run service webhooks-aifi-v2-checkout, Container Healthcheck failed. Cloud Run error: 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.

Logs URL: https://console.cloud.google.com/logs/viewer?project=cornershop-app&resource=cloud_run_revision/service_name/webhooks-aifi-v2-checkout/revision_name/webhooks-aifi-v2-checkout-00001-qur&advancedFilter=resource.type%3D%22cloud_run_revision%22%0Aresource.labels.service_name%3D%22webhooks-aifi-v2-checkout%22%0Aresource.labels.revision_name%3D%22webhooks-aifi-v2-checkout-00001-qur%22
For more troubleshooting guidance, see https://cloud.google.com/run/docs/troubleshooting#container-failed-to-start

Functions deploy had errors with the following functions:
        webhooks-aifi-v2-checkout(europe-west1)
i  functions: cleaning up build files...

Error: There was an error deploying functions

Screenshot 2022-06-02 at 01 21 31

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions