一周后的今天,我的代码在Firebase Cloud Functions上运行良好。
我已经尝试了许多解决方案来调试这个问题,但每次我的代码被激活时都会遇到这个问题:
{"errors":[{"code":20,"message":"Authentification key is not active"}
{"code":21,"message":"No permission for this authentication key"}]}一种解决方案已将此错误代码更改为另一种:
{"error":{"code":403,"message":"Identity Toolkit API has not been used in project xxxxxx before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/identitytoolkit.googleapis.com/overview?project=xxxxxx then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.","errors":[{"message":"Identity Toolkit API has not been used in project 818729994826 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/identitytoolkit.googleapis.com/overview?project=xxxxxx then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.","domain":"usageLimits","reason":"accessNotConfigured","extendedHelp":"https://console.developers.google.com"}],"status":"PERMISSION_DENIED"}}这让我相信这是认证相关的,即使代码托管在Google域中,我认为应该自动进行身份验证。
发布于 2019-03-27 10:20:18
好吧。我找到了错误的来源,日志响应不是来自Google,而是来自我自己的代码。
我在一个团队中工作,我不知道我的团队中的一个成员做了一些更改(不幸的是,这是我正在工作的环境,所以没有git或提及正在发生的更改)。
得出这个结论的过程类似于在Wordpress中一次禁用一个插件。
我把我的代码分成几部分,然后运行它们,它们运行得很好。直到我遇到一个与api对话的代码,因此产生了这个错误。
希望这能帮助任何人在错误调试中经历一些大的未知。此外,学习单元测试可能有一个很好的警告。
https://stackoverflow.com/questions/55366233
复制相似问题