-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
If i start a mongos with --bind_ip 127.0.0.1 --port 20000, a unix socket is created at /tmp/mongodb-20000.sock, but i get this error:
>>> import pymongo >>> pymongo.version '3.3.0' >>> pm = pymongo.MongoClient(host='/tmp/mongodb-20000.sock') >>> pm Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 909, in __repr__ return ("MongoClient(%s)" % (self._repr_helper(),)) File "/usr/local/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 896, in _repr_helper for host, port in self._topology_settings.seeds]] TypeError: %d format: a number is required, not NoneType
Some things seem to work though:
>>> pm.somedb.somecol.find_one() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/pymongo/collection.py", line 1014, in find_one for result in cursor.limit(-1): File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 1090, in next if len(self.__data) or self._refresh(): File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 1012, in _refresh self.__read_concern)) File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 905, in __send_message helpers._check_command_response(doc['data'][0]) File "/usr/local/lib/python2.7/dist-packages/pymongo/helpers.py", line 205, in _check_command_response raise OperationFailure(msg % errmsg, code, response) pymongo.errors.OperationFailure: not authorized on somedb to execute command { find: "somecol", filter: {}, limit: 1, singleBatch: true }
Because authentication is required.