[英]Getting 501 Server Error: Not Implemented error when trying to backup Firebase from a remote server
I have a Python script that pulls backup of the Firebase db and saves it to the server. 我有一个Python脚本,可提取Firebase数据库的备份并将其保存到服务器。 I am able to execute it successfully from my machine, however, when I run it from
pythoneverywhere
server, I get the following error: 我能够从我的机器成功执行它,但是,当我从
pythoneverywhere
服务器运行它时, 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.
Here is the relevant part of the script: 这是脚本的相关部分:
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
Same script with same params was running fine on pythoneverywhere
server a few weeks ago. pythoneverywhere
具有相同参数的相同脚本在pythoneverywhere
服务器上运行良好。 I have reinstalled requests 1.1.0
and python-firebase
using pip
on both my machine and the server and am still able to access it from my machine but not from pythoneverywhere
server. 我已经在机器和服务器上都使用
pip
重新安装了requests 1.1.0
和python-firebase
,并且仍然可以从我的机器上访问它,但不能从pythoneverywhere
服务器上访问它。 Any idea what would cause this? 知道会是什么原因吗?
If you can get past the authentication part, then the connection should be getting through/it isn't a proxy problem. 如果您可以通过身份验证部分,则说明连接应该已经通过/这不是代理问题。
Maybe double check your ProdFirebaseURL
is correct? 也许仔细检查您的
ProdFirebaseURL
是否正确? And double check that the '/'
that you are calling f.get()
on is a valid end point? 并
f.get()
检查您正在调用f.get()
的'/'
是有效的端点吗?
I would try doing f.get(<the-full-url>)
just to double check/make sure. 我会尝试做
f.get(<the-full-url>)
只是为了仔细检查/确定。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.