Skip to content
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

MongoDB 4.2: mongoengine.errors.OperationError: Update failed (BSON field 'no_cursor_timeout' is an unknown field.) #2148

Closed
crunk1 opened this issue Aug 20, 2019 · 2 comments · Fixed by #2160

Comments

@crunk1
Copy link

crunk1 commented Aug 20, 2019

mongoengine.errors.OperationError: Update failed (BSON field 'no_cursor_timeout' is an unknown field.)
    at modify (/opt/python3.7/lib/python3.7/site-packages/mongoengine/queryset/base.py:650)

Sorry, don't have exact steps to repro this. Caught this as we were trying out 4.2 and I'm busy reverting back to 4.0 :)

Some basic info:
python: 3.7.4
mongoengine: 0.18.2
pymongo: 3.9.0

Error does not appear when running against server 4.0.12.
Upon upgrading to 4.2, error starts popping up during update queries.

@kingb
Copy link

kingb commented Aug 27, 2019

We ran into the same problem.

@ghost
Copy link

ghost commented Sep 3, 2019

This seems to be an undocumented breaking change in Mongo 4.2. Should this be reported as a bug on that side?

On another note, pymongo only documents no_cursor_timeout for some operations, so perhaps this was never supported for update?

In any case, the problem is caused by this: https://github.com/MongoEngine/mongoengine/blob/master/mongoengine/queryset/base.py#L1579

Mongoengine always adds no_cursor_timeout, the only thing that changes is whether it's true or false. This is most likely the wrong thing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants