Firestore add方法抛出13 INTERNAL内部错误,云函数调用时触发该问题求助
大家好,我最近在调用云函数的时候碰到了个棘手的问题——Firestore的add()方法突然抛出了13 INTERNAL内部错误,折腾了好一阵都没找到原因,想请各位大佬帮忙支支招。
具体的错误日志是这样的:
Error: 13 INTERNAL: An internal error occurred.
at callErrorFromStatus (/workspace/node_modules/google-gax/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
at Object.onReceiveStatus (/workspace/node_modules/google-gax/node_modules/@grpc/grpc-js/build/src/client.js:192:76)
at Object.onReceiveStatus (/workspace/node_modules/google-gax/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)
at Object.onReceiveStatus (/workspace/node_modules/google-gax/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
at /workspace/node_modules/google-gax/node_modules/@grpc/grpc-js/build/src/resolving-call.js:94:78
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
这个错误是从下面这段代码里触发的,就是调用Firestore的add方法往指定集合插入数据的时候出的问题:
const insert = await admin .firestore() .collection(myCollection) .add(insertFSObject) .catch((error) => { console.log(`Insert failed: ${error}`); throw error; });
我已经初步排查过insertFSObject的数据格式,确认没有嵌套过深的对象或者Firestore不支持的数据类型,云函数的权限也配置了Firestore的读写权限,但还是一直报这个内部错误。有没有大佬遇到过类似的情况,或者能给我一些排查的方向?
备注:内容来源于stack exchange,提问作者sieusaopolo15

