Skip to content

Function deployment fails when running on Node 15.8.0 #3120

Closed
@busiest-beaver

Description

@busiest-beaver

[REQUIRED] Environment info

firebase-tools: 9.3.0
Node Version: 15.8.0
Platform: Linux 5.4.89-1-MANJARO

[REQUIRED] Test case

Deploy the function generated initially when you run firebase init and select functions.

// index.js
const functions = require("firebase-functions");
exports.helloWorld = functions.https.onRequest((request, response) => {
	functions.logger.info("Hello logs!", {structuredData: true});
	response.send("Hello from Firebase!");
});

[REQUIRED] Steps to reproduce

Deploy the function above:

$ firebase deploy --only "functions:helloWorld"

[REQUIRED] Expected behavior

Expected behavior is to deploy the function(s) without any errors.

[REQUIRED] Actual behavior

Deployments fails with the following output message in local terminal:

$ firebase deploy --only "functions:helloWorld"

=== Deploying to 'test-functions-d4276'...

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 cloudfunctions.googleapis.com is enabled
⚠  functions: missing required API cloudbuild.googleapis.com. Enabling now...
✔  functions: required API cloudbuild.googleapis.com is enabled
i  functions: preparing functions directory for uploading...
i  functions: packaged functions (41.36 KB) for uploading
✔  functions: functions folder uploaded successfully
i  functions: uploading functions in project: helloWorld(us-central1)
i  functions: creating Node.js 12 function helloWorld(us-central1)...
⚠  functions[helloWorld(us-central1)]: Deployment error.
Build failed: Build error details not available. Please check the logs at https://console.cloud.google.com/logs/...


Functions deploy had errors with the following functions:
        helloWorld


To try redeploying those functions, run:
    firebase deploy --only "functions:helloWorld"


To continue deploying other features (such as database), run:
    firebase deploy --except functions

Error: Functions did not deploy properly.

Having trouble? Try firebase [command] --help

Cloud console had the following output in log explorer:

{
	"textPayload": "ERROR: error fetching storage source: generic::unknown: retry budget exhausted (3 attempts): fetching gcs source: unpacking source from gcs: source fetch container exited with non-zero status: 1",
	"insertId": "07530e91-3ce1-44c5-88a7-b8025758115c-27",
	"resource": {
		"type": "build",
		"labels": {
			"project_id": "test-functions-d4276",
			"build_id": "07530e91-3ce1-44c5-88a7-b8025758115c",
			"build_trigger_id": ""
		}
	},
	"timestamp": "2021-02-08T22:48:26.709353507Z",
	"severity": "INFO",
	"labels": {
		"build_step": "MAIN"
	},
	"logName": "projects/test-functions-d4276/logs/cloudbuild",
	"receiveTimestamp": "2021-02-08T22:48:26.906497807Z"
}

Workaround

I switched to Node version 14.x.x and everything worked fine. This may be a duplicate of #3108. The SO link they provided also has more details so it might be worth looking into. In #3108 they seem to have trouble deploying with node versions aside from 15.x.x. They mention that deploy requires keyboard input in GCP; in my logs this does show up but seems selects an input automatically anyway, the selected input being [N]one. I am listing the summary for this particular log message below. Note, this happens before the error message I attached farther up the document.

{
  "textPayload": "replace /workspace/.runtimeconfig.json? [y]es, [n]o, [A]ll, [N]one, [r]ename:  NULL",
  "insertId": "07530e91-3ce1-44c5-88a7-b8025758115c-16",
  "resource": {
    "type": "build",
    "labels": {
      "build_id": "07530e91-3ce1-44c5-88a7-b8025758115c",
      "project_id": "test-functions-d4276",
      "build_trigger_id": ""
    }
  },
  "timestamp": "2021-02-08T22:48:20.754221592Z",
  "severity": "INFO",
  "labels": {
    "build_step": "gsutil:STDERR"
  },
  "logName": "projects/test-functions-d4276/logs/cloudbuild",
  "receiveTimestamp": "2021-02-08T22:48:21.560769220Z"
}

Followed by:

{
  "textPayload": "(EOF or read error, treating as \"[N]one\" ...)",
  "insertId": "07530e91-3ce1-44c5-88a7-b8025758115c-17",
  "resource": {
    "type": "build",
    "labels": {
      "build_trigger_id": "",
      "build_id": "07530e91-3ce1-44c5-88a7-b8025758115c",
      "project_id": "test-functions-d4276"
    }
  },
  "timestamp": "2021-02-08T22:48:20.754274058Z",
  "severity": "INFO",
  "labels": {
    "build_step": "gsutil:STDERR"
  },
  "logName": "projects/test-functions-d4276/logs/cloudbuild",
  "receiveTimestamp": "2021-02-08T22:48:21.560769220Z"
}

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