New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot connect to database default : False is not a read preference. #950
Comments
@mseimys Thanks |
No problem. Anyway, I wouldn't close this issue just yet - problem is still there, i haven't got enough skills yet to fix it :) |
With the progress of refer to: #935 |
Got the same problem, i guess Closed is not meant to, as the issue is still present. |
|
+1 |
1 similar comment
+1 |
It is fixed in master, so just use mongoengine master (and wait for next release) or use pymongo==2.8. |
I already got it working with 2.8 :P so its not just the matter of +1 ;) @MRigal |
+1, please how can I downgrade? |
@lukaspetr Add |
@hamzawaqas-10p thank you. It was also necessary to change the setting to |
Will this problem be fixed in the next version? |
Since it is in master, for sure :-) 2015-06-04 13:49 GMT+02:00 Petr Lukas notifications@github.com:
|
@MRigal thank you for the piece of information! |
Looks like @MRigal fixed it, thank you! |
+1 |
1 similar comment
+1 |
2.8 it workd! |
+1 |
1 similar comment
+1 |
pymongo 3.1 is not work. now, i have to use pymongo 2.8 |
@hhstore I think it's released now. Which version of mongoengine do you have? |
Still present in MongoDB shell version: 3.2.5. |
Got pymongo 3.2.2, mongoengine 0.9, got this bug. |
Is this problem solved yet? |
I am using django 1.11 , python 3.5, mongoengine 0.13.0, pymongo-3.4.0 same error |
+1 mac |
OS X High Sierra, mongoengine 0.15.0, pymongo 3.3.2 same error, if it helps get this resolved sooner. |
Trying to use mongonengine with django, I have to use mongoengine 0.9.0. So now I also have to downgrade pymongo to 2.8. Not good.. |
I am facing this issue as well. Any solution? Downgrading to 2.8 did not solve the issue. Instead, it created another issue. |
@ishantanu Can you clarify the problem? You only observe this with dango, right? Can you provide a code snippet that shows the issue? |
@bagerard I am observing it with something built with Flask and python. So, after downgrading pymongo to 2.8.1, I am seeing this issue:
And, If I use latest version of pymongo, it shows:
And, If I run with pymongo 2.9, I get this error:
However, on macOS 2.9 works. It does not work on Ubuntu 16.04. Any idea what might be issue? Mongo is running just fine. Update: I made it work by using Mongoengine v 0.10.1. I am not sure why it did not worked with latest version. |
Just to make sure I get this right, the error you have with latest mongoengine and latest pymongo is this one: |
For those asking if this problem still exists |
>>> MongoClient(read_preference=False)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/shane/Library/Python/3.8/lib/python/site-packages/pymongo/mongo_client.py", line 761, in __init__
dict(common.validate(keyword_opts.cased_key(k), v) for k, v in keyword_opts.items())
File "/Users/shane/Library/Python/3.8/lib/python/site-packages/pymongo/mongo_client.py", line 761, in <genexpr>
dict(common.validate(keyword_opts.cased_key(k), v) for k, v in keyword_opts.items())
File "/Users/shane/Library/Python/3.8/lib/python/site-packages/pymongo/common.py", line 764, in validate
value = validator(option, value)
File "/Users/shane/Library/Python/3.8/lib/python/site-packages/pymongo/common.py", line 362, in validate_read_preference
raise TypeError("%r is not a read preference." % (value,))
TypeError: False is not a read preference. |
Let's close this, it's old and most likely a problem in the argument of connect |
I use
connect(host='mongodb://username:password@localhost:port/database')
in my djangosettings.py
.Run server then got a report:
Is this a bug or not?
Write in python
3.4.3
with django1.8
and mongoengine0.9.0
The text was updated successfully, but these errors were encountered: