如何解决firebase_admin.exceptions.InvalidArgumentError
运行此代码时,出现 firebase_admin.exceptions.InvalidArgumentError
错误
data = {'DC': {'channel_id': 'simple','fpd': 50,'pffb': 2,'pivd': 80,'pivr': 100,'prf': 75},'DF': {'115139684': 'yotyteam','yotyteam': 115139684},'GC': {'code1': {'NUs': 20,'P': 200,'UIs': [115139684,1626410362]}},'I': {'115139684': [1598613302,1164987371,1296554610]},'RF': {'1296554610': 17},'RJRF': {'1296554610': '14/05/21 21:55:04'},'RL': {'13': [115139684]},'WA': {'101785936': 115139684,'595638422': 115139684,'1045502102': 115139684,'1284686826': 115139684,'1626410362': 115139684,'1798740505': 115139684},'B': {},'FL': {'OL': {},'14/05/21': {'1296554610': 115139684}},'DFL': {}}
db.reference("bot_data").update(data)
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.9/site-packages/firebase_admin/db.py",line 930,in request
return super(_Client,self).request(method,url,**kwargs)
File "/app/.heroku/python/lib/python3.9/site-packages/firebase_admin/_http_client.py",line 119,in request
resp.raise_for_status()
File "/app/.heroku/python/lib/python3.9/site-packages/requests/models.py",line 940,in raise_for_status
raise HTTPError(http_error_msg,response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://example.firebaseio.com/bot_data.json?print=silent
During handling of the above exception,another exception occurred:
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.9/site-packages/telegram/ext/dispatcher.py",line 568,in __update_persistence
self.persistence.update_bot_data(self.bot_data)
File "/app/.heroku/python/lib/python3.9/site-packages/telegram/ext/basepersistence.py",line 105,in update_bot_data_replace_bot
return update_bot_data(instance.replace_bot(data))
File "/app/firebase_persistence_ptb/firebase_persistence.py",line 81,in update_bot_data
self.fb_bot_data.update(data)
File "/app/.heroku/python/lib/python3.9/site-packages/firebase_admin/db.py",line 342,in update
self._client.request('patch',self._add_suffix(),json=value,params='print=silent')
File "/app/.heroku/python/lib/python3.9/site-packages/firebase_admin/db.py",line 932,in request
raise _Client.handle_rtdb_error(error)
firebase_admin.exceptions.InvalidArgumentError: Invalid data; Couldn't parse JSON object. Are you sending a JSON object with valid key names?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。