You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MongoClient is called with MongoClient(**client_kwargs) and MONGO_REPLICA_SET value is not transfered as you can see in io/mongo/flask_pymongo.py:35:config_to_kwargs()
Actual Behavior
Tell us what happens instead.
[2019-08-07 14:43:22,388] ERROR in app: Exception on /companies [POST]
Traceback (most recent call last):
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
response =self.full_dispatch_request()
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv =self.handle_user_exception(e)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraiseraise value
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv =self.dispatch_request()
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_requestreturnself.view_functions[rule.endpoint](**req.view_args)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/eve/endpoints.py", line 58, in collections_endpoint
response = post(resource)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/eve/methods/common.py", line 318, in rate_limitedreturn f(*args, **kwargs)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/eve/auth.py", line 80, in decoratedreturn f(*args, **kwargs)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/eve/methods/common.py", line 1354, in decorated
r = f(resource, **combined_args)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/eve/methods/post.py", line 49, in postreturn post_internal(resource, payl, skip_validation=False)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/eve/methods/post.py", line 260, in post_internal
ids = app.data.insert(resource, documents)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/eve/io/mongo/mongo.py", line 461, in insertreturn coll.insert_many(doc_or_docs, ordered=True).inserted_ids
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/pymongo/collection.py", line 760, in insert_many
blk.execute(write_concern, session=session)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/pymongo/bulk.py", line 522, in executereturnself.execute_command(generator, write_concern, session)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/pymongo/bulk.py", line 347, in execute_commandself.is_retryable, retryable_bulk, s, self)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/pymongo/mongo_client.py", line 1233, in _retry_with_sessionreturn func(session, sock_info, retryable)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/pymongo/bulk.py", line 342, in retryable_bulk
retryable, full_result)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/pymongo/bulk.py", line 295, in _execute_command
result = bwc.write_command(request_id, msg, to_send)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/pymongo/message.py", line 919, in write_command
reply =self.sock_info.write_command(request_id, msg)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/pymongo/pool.py", line 660, in write_command
helpers._check_command_response(result)
File "/home/altiire/.local/share/virtualenvs/MongoREST-1Av1QWwL/lib/python3.7/site-packages/pymongo/helpers.py", line 132, in _check_command_responseraise NotMasterError(errmsg, response)
pymongo.errors.NotMasterError: not master
Environment
Python version: 3.7.3
Eve version: 0.9.2
The text was updated successfully, but these errors were encountered:
thanks for reporting this. You'd normally use MONGO_URI to set the replicaset, but I agree that this alternative/optional method needs to be still supported.
Expected Behavior
Tell us what should happen.
MongoClient in
io/mongo/flask_pymongo.py
should be called with option replicaset as follow :MongoClient('localhost', replicaset='foo')
(see: https://api.mongodb.com/python/current/examples/high_availability.html#id1)MongoClient is called with
MongoClient(**client_kwargs)
and MONGO_REPLICA_SET value is not transfered as you can see inio/mongo/flask_pymongo.py:35:config_to_kwargs()
Actual Behavior
Tell us what happens instead.
Environment
The text was updated successfully, but these errors were encountered: