admin管理员组文章数量:1356904
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 [none] [debug] [2025-03-27T22:03:15.047Z] <<< [apiv2][status] GET 200 [debug] [2025-03-27T22:03:15.047Z] <<< [apiv2][body] GET {"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 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:
- downgrading firebase CLI
- downgrading to Gen1 from Gen2
- 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
本文标签: nodejsError with Firebase deployservice account format issueStack Overflow
版权声明:本文标题:node.js - Error with Firebase deploy, service account format issue - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744063689a2584594.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论