gpt4 book ai didi

python - 收到 501 服务器错误 : Not Implemented error when trying to backup Firebase from a remote server

转载 作者:太空宇宙 更新时间:2023-11-03 17:50:53 24 4
gpt4 key购买 nike

我有一个 Python 脚本,可以提取 Firebase 数据库的备份并将其保存到服务器。但是,当我从 pythoneverywhere 运行它时,我能够从我的机器成功执行它。服务器,我收到以下错误:

Traceback (most recent call last):
File "somescript.py", line 58, in <module>
data = json.dumps(f.get('/', None), sort_keys = False, indent = 4)
File "/home/<username>/.local/lib/python2.7/site-packages/firebase/decorators.py", line 19, in wrapped
return f(*args, **kwargs)
File "/home/<username>/.local/lib/python2.7/site-packages/firebase/firebase.py", line 274, in get
return make_get_request(endpoint, params, headers, connection=connection)
File "/home/<username>/.local/lib/python2.7/site-packages/firebase/decorators.py", line 19, in wrapped
return f(*args, **kwargs)
File "/home/<username>/.local/lib/python2.7/site-packages/firebase/firebase.py", line 42, in make_get_request
response.raise_for_status()
File "/home/<username>/.local/lib/python2.7/site-packages/requests/models.py", line 638, in raise_for_status
raise http_error
requests.exceptions.HTTPError: 501 Server Error: Not Implemented

2015-03-17 15:01:12 -- Completed task, took 4.00 seconds, return code was 1.

这是脚本的相关部分:

def connect_firebase(configs):
firebaseUrl = configs.get('Firebase', 'ProdFirebaseURL')
firebaseSecret = configs.get('Firebase', 'FirebaseSecret')

f = firebase.FirebaseApplication(firebaseUrl, None)
f.authentication = firebase.FirebaseAuthentication(firebaseSecret, "", admin=True)
return f

...

f = connect_firebase(config)
data = json.dumps(f.get('/', None), sort_keys = False, indent = 4) #busts here
几周前,具有 相同参数的

相同脚本在pythoneverywhere服务器上运行良好。我已在我的计算机和服务器上使用 pip 重新安装了 requests 1.1.0python-firebase,并且仍然可以从我的计算机上访问它机器,但不是来自 pythoneverywhere 服务器。知道什么会导致这种情况吗?

最佳答案

如果您可以通过身份验证部分,则连接应该可以通过/这不是代理问题。

也许仔细检查您的 ProdFirebaseURL是正确的?并仔细检查 '/'您正在调用f.get() on 是有效的终点吗?

我会尝试做f.get(<the-full-url>)只是为了仔细检查/确保。

关于python - 收到 501 服务器错误 : Not Implemented error when trying to backup Firebase from a remote server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29108093/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com