简体   繁体   English

尝试从远程服务器备份Firebase时遇到501服务器错误:未实现错误

[英]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.0python-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>)只是为了仔细检查/确定。

This was fixed by uninstalling requests 1.1.0 lib from the server. 通过从服务器卸载requests 1.1.0 lib解决了此问题。 Still no idea what was wrong, since Firebase folks advise to install that library prior to installing Firebase . 仍然不知Firebase什么问题,因为Firebase人们建议在安装Firebase之前先安装该库。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python-Pxssh-尝试登录到远程服务器时出现密码拒绝错误 - Python - Pxssh - Getting an password refused error when trying to login to a remote server 我在尝试通过 sqlalchemy 连接到远程 postgreSQL 服务器时遇到操作错误,如下所述 - I'm getting an operational error, as described below, when trying to connect to a remote postgreSQL server through sqlalchemy 在 Python3 中使用 SMTPLIB - 尝试发送 email 时出现(501)“语法错误 - 行太长”错误 - Using SMTPLIB with Python3 - Getting (501) "Syntax error - line too long" Error When trying to send the email Paramiko:尝试在远程服务器上执行 python 时抛出错误 - Paramiko : Throwing error when trying to execute python on remote server 尝试将Google App Engine中的insertAll用于BigQuery时出现HTTP 501错误 - HTTP 501 error when trying to use insertAll from Google App Engine to BigQuery 尝试在django中处理json时出现内部服务器错误 - Getting internal server error when trying to handle json in django 尝试从命令行启动 appium 服务器,但不断收到此错误 - Trying to start appium server from the command line but keep getting this error WinError 10060 尝试使用 Python PySFTP 模块连接到远程服务器时出错 - WinError 10060 Error when trying to connect to remote server using Python PySFTP module 尝试连接到服务器时出现错误非阻塞 (10035) 错误 - Getting error non-blocking (10035) error when trying to connect to server 尝试连接到远程主机服务器时,psycopg2错误 - An error with psycopg2 while trying to connect to a remote host server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM