连接蒙古人数据库的方式改变了吗?

2024-06-24 13:16:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个Bluemix应用程序,它绑定了一个MongoDB实例。这个应用已经运行了大约一年了。大约一周前,我的应用程序宕机了,我无法重新部署它。我在日志中看到了以下内容:

 Instance (index 0) failed to start accepting connections
App instance exited with guid f13c5665-7753-4451-b766-b0879b3726fd payload: {"cc_partition"=>"default", "droplet"=>"f13c5665-7753-4451-b766-b0879b3726fd", "version"=>"1c5aeea8-2718-48ff-9d89-211148391cc8", "instance"=>"5673b51557b3457f8b3e365639fe7f6f", "index"=>0, "reason"=>"CRASHED", "exit_status"=>1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1445263465}
App instance exited with guid f13c5665-7753-4451-b766-b0879b3726fd payload: {"cc_partition"=>"default", "droplet"=>"f13c5665-7753-4451-b766-b0879b3726fd", "version"=>"1c5aeea8-2718-48ff-9d89-211148391cc8", "instance"=>"5673b51557b3457f8b3e365639fe7f6f", "index"=>0, "reason"=>"CRASHED", "exit_status"=>1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1445263465}
Starting app instance (index 0) with guid f13c5665-7753-4451-b766-b0879b3726fd
App instance exited with guid f13c5665-7753-4451-b766-b0879b3726fd payload: {"cc_partition"=>"default", "droplet"=>"f13c5665-7753-4451-b766-b0879b3726fd", "version"=>"1c5aeea8-2718-48ff-9d89-211148391cc8", "instance"=>"5673b51557b3457f8b3e365639fe7f6f", "index"=>0, "reason"=>"CRASHED", "exit_status"=>1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1445263465}
Starting app instance (index 0) with guid f13c5665-7753-4451-b766-b0879b3726fd
Traceback (most recent call last):
File "wsgi.py", line 65, in <module>
 client = pymongo.Connection(mongo_url)
File "/app/.heroku/python/lib/python2.7/site-packages/pymongo/connection.py", line 220, in __init__
max_pool_size, document_class, tz_aware, _connect, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/pymongo/mongo_client.py", line 369, in __init__raise ConfigurationError(str(exc))
pymongo.errors.ConfigurationError: command SON([('authenticate', 1), ('user', u'removingForPrivacy'), ('nonce', u'removingForPrivacy'), ('key', u'removingForPrivacy')]) failed: auth failed

我的代码可以在项目中的https://hub.jazz.net/project/lhayward/Fabulous%20Price%20Finder/overview找到。蒙古人的一个例子改变了连接方式?为什么我收到身份验证错误?在


Tags: toinstanceappindexwithexitconnectionsguid
1条回答
网友
1楼 · 发布于 2024-06-24 13:16:55

我给蒙古人发了电子邮件。他们回答说:

Our free Sandbox databases recently went through the scheduled version upgrade event described at:

http://docs.mongolab.com/20150930-maintenance-event/

We sent several notices on this planned maintenance over the past few months.

This Sandbox database is now running MongoDB 3.0.x, which includes changes to MongoDB's authentication mechanism. This new mechanism is supported by certain newer driver versions, as described at http://docs.mongodb.org/manual/release-notes/3.0-scram/#upgrade-drivers.

In order for your application to connect to this database, you will need to use one of the drivers listed at the above link.

他们对我的应用程序提出了以下建议,并解决了问题:

You'll have to update the "mongo-python-driver-master" folder to a more recent version of the python driver. You can download the driver here: https://github.com/mongodb/mongo-python-driver/releases. I'd recommend either version 2.9 or 3.0.3.

相关问题 更多 >