【问题标题】:Did the way to connect to a MongoLab database change?连接到 MongoLab 数据库的方式是否改变了?
【发布时间】:2015-10-26 11:28:29
【问题描述】:

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

 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。连接到 MongoLab 实例的方式是否改变了?为什么我会收到身份验证错误?

【问题讨论】:

    标签: python mongodb ibm-cloud mlab


    【解决方案1】:

    我向 MongoLab 支持发送了电子邮件。他们回答:

    我们的免费沙盒数据库最近通过了预定版本 升级事件描述于:

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

    在过去的几年中,我们就计划中的维护发送了几条通知 个月。

    此沙盒数据库现在运行 MongoDB 3.0.x,其中包括 更改 MongoDB 的身份验证机制。这种新机制是 某些较新的驱动程序版本支持,如在 http://docs.mongodb.org/manual/release-notes/3.0-scram/#upgrade-drivers.

    为了让您的应用程序连接到该数据库,您将 需要使用上面链接中列出的驱动程序之一。

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

    您必须将“mongo-python-driver-master”文件夹更新为 更新版本的 python 驱动程序。你可以下载驱动 这里:https://github.com/mongodb/mongo-python-driver/releases。 ID 推荐 2.9 或 3.0.3 版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-02
      • 2016-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-08
      • 2018-01-07
      相关资源
      最近更新 更多