3

Error Message

[info] Functions deploy had errors with the following functions: addmessage(us-central1) [debug] [2025-03-27T22:03:14.260Z] Not printing URL for HTTPS function. Typically this means it didn't match a filter or we failed deployment [debug] [2025-03-27T22:03:14.260Z] Checked if tokens are valid: true, expires at: 1743114349603 [debug] [2025-03-27T22:03:14.260Z] Checked if tokens are valid: true, expires at: 1743114349603 [debug] [2025-03-27T22:03:14.261Z] >>> [apiv2][query] GET https://artifactregistry.googleapis.com/v1/projects/startup36-227ae/locations/us-central1/repositories/gcf-artifacts [none] [debug] [2025-03-27T22:03:15.047Z] <<< [apiv2][status] GET https://artifactregistry.googleapis.com/v1/projects/startup36-227ae/locations/us-central1/repositories/gcf-artifacts 200 [debug] [2025-03-27T22:03:15.047Z] <<< [apiv2][body] GET https://artifactregistry.googleapis.com/v1/projects/startup36-227ae/locations/us-central1/repositories/gcf-artifacts {"name":"projects/startup36-227ae/locations/us-central1/repositories/gcf-artifacts","format":"DOCKER","createTime":"2025-03-27T20:39:45.042913Z","updateTime":"2025-03-27T20:40:24.873562Z","mode":"STANDARD_REPOSITORY","cleanupPolicies":{"firebase-functions-cleanup":{"id":"firebase-functions-cleanup","action":"DELETE","condition":{"tagState":"ANY","olderThan":"86400s"}}},"cleanupPolicyDryRun":true,"vulnerabilityScanningConfig":{"enablementConfig":"INHERITED","lastEnableTime":"2025-03-27T20:39:34.500068118Z","enablementState":"SCANNING_DISABLED","enablementStateReason":"API containerscanning.googleapis.com is not enabled."},"satisfiesPzi":true,"registryUri":"us-central1-docker.pkg.dev/startup36-227ae/gcf-artifacts","dockerConfig":{}} [debug] [2025-03-27T22:03:15.049Z] Functions deploy failed. [debug] [2025-03-27T22:03:15.049Z] {} [debug] [2025-03-27T22:03:15.061Z] TypeError: Cannot read properties of null (reading 'length') at Object.formatServiceAccount (C:\Users\zhuan\AppData\Roaming\npm\node_modules\firebase-tools\lib\gcp\proto.js:95:24) at C:\Users\zhuan\AppData\Roaming\npm\node_modules\firebase-tools\lib\gcp\cloudfunctionsv2.js:196:122 at Object.convertIfPresent (C:\Users\zhuan\AppData\Roaming\npm\node_modules\firebase-tools\lib\gcp\proto.js:45:25) at Object.functionFromEndpoint (C:\Users\zhuan\AppData\Roaming\npm\node_modules\firebase-tools\lib\gcp\cloudfunctionsv2.js:196:11) at Fabricator.createV2Function (C:\Users\zhuan\AppData\Roaming\npm\node_modules\firebase-tools\lib\deploy\functions\release\fabricator.js:233:35) at Fabricator.createEndpoint (C:\Users\zhuan\AppData\Roaming\npm\node_modules\firebase-tools\lib\deploy\functions\release\fabricator.js:137:24) at C:\Users\zhuan\AppData\Roaming\npm\node_modules\firebase-tools\lib\deploy\functions\release\fabricator.js:103:64 at handle (C:\Users\zhuan\AppData\Roaming\npm\node_modules\firebase-tools\lib\deploy\functions\release\fabricator.js:89:23) at Fabricator.applyChangeset (C:\Users\zhuan\AppData\Roaming\npm\node_modules\firebase-tools\lib\deploy\functions\release\fabricator.js:103:26) at C:\Users\zhuan\AppData\Roaming\npm\node_modules\firebase-tools\lib\deploy\functions\release\fabricator.js:69:40 [error]

My index.js looks like this:

const {onRequest} = require("firebase-functions/v2/https");
const logger = require("firebase-functions/logger");
// The Firebase Admin SDK to access Firestore.
const {initializeApp} = require("firebase-admin/app");
const {getFirestore} = require("firebase-admin/firestore");

initializeApp();

exports.addmessage = onRequest(async (req, res) => {
  // Grab the text parameter.
  const original = req.query.text;
  // Push the new message into Firestore using the Firebase Admin SDK.
  const writeResult = await getFirestore()
      .collection("messages")
      .add({original: original});
    // Send back a message that we've successfully written the message
  res.json({result: `Message with ID: ${writeResult.id} added.`});
});

I keep getting this Service Account Format error and I've tried all the following:

  1. downgrading firebase CLI
  2. downgrading to Gen1 from Gen2
  3. adding service account metadata

But nothing seems to work, please help!

If I need to add service account information, where should I add it? I have the default service account on my google cloud platform with the following configuration: enter image description here

4
  • If you're followed all the instructions in the documentation for the most simple case, and you get an error that doesn't make sense, you'll probably get better help if you reach out to Firebase directly using Firebase support or filing an issue on GitHub for the Firebase CLI. Stack Overflow is typically for questions about code, not random errors with developer tools that don't seem to be about your code. Commented Mar 27 at 23:29
  • even i am facing just now after updating firebase-cli to the latest version
    – Moblize IT
    Commented Mar 28 at 4:23
  • I am facing this as well as of today. Firebase function deployments launched via CLI started failing. The same deployment pipeline worked just fine yesterday, nothing was changed. I also suddenly got a warning about a missing "cleanup policy", and a hint that this could be suppressed by using the --force option. Commented Mar 28 at 10:06
  • For me, downgrading firebase-tools to 13.35.1 fixed the issue. firebase-tools 14.0.0 was released yesterday and I suspect triggers this behavior. Commented Mar 28 at 10:20

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.