yougov / mongo-connector

MongoDB data stream pipeline tools by YouGov (adopted from MongoDB)
Apache License 2.0
1.88k stars 478 forks source link

mongo-connector failed to retrieve self.auth_key and self.auth_username #849

Open rjiang21 opened 5 years ago

rjiang21 commented 5 years ago

I am trying to connect my mongo cluster using mongo-connector -m mongodb://myadmin:password@server1:27017,server2:27017,server3:27017/myCompany?authSource=admin and it shows me

pymongo.errors.OperationFailure: there are no users authenticated

So I am printing self.auth_key and self.auth_username in mongo_connector\connector.py and it shows me None for both.

Detailed Log

Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\python36-32\lib\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "C:\python36-32\lib\site-packages\mongo_connector\util.py", line 107, in wrapped
    func(*args, **kwargs)
  File "C:\python36-32\lib\site-packages\mongo_connector\connector.py", line 395, in run
    self.update_version_from_client(self.main_conn)
  File "C:\python36-32\lib\site-packages\mongo_connector\connector.py", line 348, in update_version_from_client
    Version.from_client(self.create_authed_client(host))
  File "C:\python36-32\lib\site-packages\mongo_connector\version.py", line 77, in from_client
  info = client.server_info()
  File "C:\python36-32\lib\site-packages\pymongo\mongo_client.py", line 1623, in server_info
    session=session)
  File "C:\python36-32\lib\site-packages\pymongo\database.py", line 614, in command
    codec_options, session=session, **kwargs)
  File "C:\python36-32\lib\site-packages\pymongo\database.py", line 514, in _command
    client=self.__client)
  File "C:\python36-32\lib\site-packages\pymongo\pool.py", line 579, in command
    unacknowledged=unacknowledged)
  File "C:\python36-32\lib\site-packages\pymongo\network.py", line 150, in command
    parse_write_concern_error=parse_write_concern_error)
  File "C:\python36-32\lib\site-packages\pymongo\helpers.py", line 155, in _check_command_response
    raise OperationFailure(msg % errmsg, code, response)
pymongo.errors.OperationFailure: there are no users authenticated
jaraco commented 5 years ago

Thanks for the report. I'm not sure when we (or others) will get to this issue. If you are able/willing, please feel free to investigate deeper and determine where the credentials you're supplying are getting discarded.