pymongo异常-OperationFailure: command SON(...)

File "C:\Python27\lib\site-packages\pymongo\mongo_client.py", line 397, in _cache_credentials sock_info.authenticate(credentials)
    File "C:\Python27\lib\site-packages\pymongo\pool.py", line 287, in authenticate auth.authenticate(credentials, self)
    File "C:\Python27\lib\site-packages\pymongo\auth.py", line 406, in authenticate auth_func(credentials, sock_info)
    File "C:\Python27\lib\site-packages\pymongo\auth.py", line 386, in _authenticate_default return _authenticate_scram_sha1(credentials, sock_info)
    File "C:\Python27\lib\site-packages\pymongo\auth.py", line 159, in _authenticate_scram_sha1 res = sock_info.command(source, cmd)
    File "C:\Python27\lib\site-packages\pymongo\pool.py", line 184, in command codec_options, check, allowable_errors)
    File "C:\Python27\lib\site-packages\pymongo\network.py", line 54, in command helpers._check_command_response(response_doc, msg, allowable_errors)

    File "C:\Python27\lib\site-packages\pymongo\helpers.py", line 188, in _check_command_response raise OperationFailure(msg % errmsg, code, response) OperationFailure: command SON([('saslStart', 1), ('mechanism', 'SCRAM-SHA-1'), ('payload', Binary('n,,n=resume,r=NzYwNzc1NTIzMjU=', 0)), ('autoAuthorize', 1)]) on namespace quanzhi.$cmd failed: Authentication failed.


原来代码突然报错,原因是Mongodb升级到3.0后pymong还是3.0.1的版本,加密方式发生改变,升级pymongo即可


你可能感兴趣的:(BUG)