firebase-authentication - firebase_admin auth delete_user 突然无法按预期工作
问题描述
我有一段代码在很长一段时间内每天自动运行两次。在上周的某个时候,我一直使用的 auth.delete_user 方法开始失败,并返回错误。有谁知道发生了什么变化,或者我做错了什么?文档中的任何内容似乎都没有改变。
我回来的错误是:
Server response: {
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"local_id\": Proto field is not repeating, cannot start list.",
"errors": [
{
"message": "Invalid JSON payload received. Unknown name \"local_id\": Proto field is not repeating, cannot start list.",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
一个人为的代码示例是:
from firebase_admin import credentials
from firebase_admin import auth
from firebase_admin import db
try:
cred = credentials.Certificate("serviceAccountKey.json")
firebase_admin.initialize_app(cred, {
'databaseURL': 'https://[project].firebaseio.com'
})
except Exception as e:
f.write(str(e.message))
uid = 'some valid UID string'
user = auth.delete_user(uid)
任何对出了什么问题的见解将不胜感激!
解决方案
对此的底层实现实际上是不正确的。这在不久前得到了修复。
您应该已经收到一封电子邮件来升级您的 python admin sdk 版本。升级到最新版本应该可以解决这个问题。
推荐阅读
- node.js - Google Drive API:更新文件名失败
- python - Python 请求有效负载格式
- node.js - 是否可以选择在不使用 eval 或 safe-eval 的情况下评估 nodejs 中的值?
- php - PHP 的 in_array() 方法如何识别数组中对象的特定实例的存在?
- python - 比较字典中的值并根据值对每个值进行处理
- scala - Log4j + Scala:如何只记录我的自定义消息?
- c++ - C++ 错误:在此上下文中不允许分解声明
- ruby-on-rails - Rails 5.2 嵌套路由和 urls 路径不适用于删除
- python - Wagtail:嵌套的内联面板
- regex - pentaho 正则表达式排除具有 .gz 扩展名的文件并包含以特定字符串开头的文件