错误获取访问令牌firebase云功能
我正在尝试使用firebase部署 - 仅函数
来部署我的firebase云功能。我的功能确实已成功部署,但是我在控制台中收到此警告消息:
@firebase/数据库:firebase警告: {“代码”:“应用程序/无效 - 信用”,“消息”:“凭据实现 通过“凭据”属性提供给初始化的()未能 获取有效的Google OAuth2访问令牌,并带有以下错误: “错误获取访问令牌:提出请求时错误:getAddrinfo enotfound Metadata.google.internal。错误代码:enotfound“。”}
这是我在index.ts
的顶部所拥有的:
import * as functions from "firebase-functions";
import * as admin from "firebase-admin";
admin.initializeApp({
credential: admin.credential.applicationDefault(),
databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
});
我已经完成了export google_application_credentials =“/path/path/to/to/service-acccount-file。 JSON“
。
我如何摆脱此警告信息?
I am trying to deploy my Firebase Cloud Functions using firebase deploy --only functions
. My functions do get successfully deployed, but I get this warning message in the console:
@firebase/database: FIREBASE WARNING:
{"code":"app/invalid-credential","message":"Credential implementation
provided to initializeApp() via the "credential" property failed to
fetch a valid Google OAuth2 access token with the following error:
"Error fetching access token: Error while making request: getaddrinfo
ENOTFOUND metadata.google.internal. Error code: ENOTFOUND"."}
This is what I have at the top of my index.ts
:
import * as functions from "firebase-functions";
import * as admin from "firebase-admin";
admin.initializeApp({
credential: admin.credential.applicationDefault(),
databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
});
I have done export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-file.json"
.
How do I get rid of this warning message?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论