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 authentication issue #9085

Closed
uchauhan1994 opened this issue Sep 30, 2022 · 7 comments
Closed

MongoDB authentication issue #9085

uchauhan1994 opened this issue Sep 30, 2022 · 7 comments

Comments

@uchauhan1994
Copy link

What happened?

we have upgrade our MongoDB version 5 to 6 and we are facing issue with authentication. earlier in MongoDB version 5 authentication and access control working fine but after upgrading MongoDB version 6 then we faced authentication issue.

What did you expect to happen?

authentication should happens in any version of mongoDB.

How can we reproduce it (as minimally and precisely as possible)?

No response

Anything else we need to know?

No response

EMQX version

$ ./bin/emqx_ctl broker
# paste output here

we are using v4.4.1

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Log files

[error] MzA3MDU4Njk1OTU0ODUzNzIzMTgyNDI0NDUwNTg0NDEyMTG@xxx.xxx.xxx.xxx:xxxxx [Hooks] Failed to execute {fun emqx_auth_mongo:check/3,[#{authquery => {authquery,<<"mqtt_user">>,[<<"password">>],sha256,[{<<"username">>,<<"%u">>}]},pool => emqx_auth_mongo,superquery => {superquery,<<"mqtt_user">>,<<"is_superuser">>,[{<<"username">>,<<"%u">>}]}}]}: {error,{bad_query,#{<<"$err">> => <<"OP_QUERY is no longer supported. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal">>,<<"code">> => 5739101,<<"ok">> => 0.0}},[{mc_connection_man,process_error,2,[{file,"mc_connection_man.erl"},{line,76}]},{mc_connection_man,read_one,2,[{file,"mc_connection_man.erl"},{line,33}]},{poolboy,transaction,3,[{file,"poolboy.erl"},{line,84}]},{emqx_auth_mongo,check,3,[{file,"emqx_auth_mongo.erl"},{line,47}]},{emqx_hooks,safe_execute,2,[{file,"emqx_hooks.erl"},{line,191}]},{emqx_hooks,do_run_fold,3,[{file,"emqx_hooks.erl"},{line,170}]},{emqx_access_control,authenticate,1,[{file,"emqx_access_control.erl"},{line,80}]},{emqx_channel,auth_connect,2,[{file,"emqx_channel.erl"},{line,1302}]},{emqx_misc,pipeline,3,[{file,"emqx_misc.erl"},{line,135}]},{emqx_channel,handle_in,2,[{file,"emqx_channel.erl"},{line,303}]},{emqx_connection,with_channel,3,[{file,"emqx_connection.erl"},{line,696}]},{emqx_connection,process_msg,2,[{file,"emqx_connection.erl"},{line,396}]},{emqx_connection,process_msg,2,[{file,"emqx_connection.erl"},{line,402}]},{emqx_connection,handle_recv,3,[{file,"emqx_connection.erl"},{line,360}]},{proc_lib,wake_up,3,[{file,"proc_lib.erl"},{line,236}]}]}
@lafirest
Copy link
Member

lafirest commented Oct 1, 2022

@uchauhan1994 @zmstone
Currently our mongo Deliver does not support newer versions of mongo

@uchauhan1994
Copy link
Author

which version of MongoDB support EMQX v5.0.8.
any plan to support MongoDB version 6?

@msc-ghub
Copy link

msc-ghub commented Oct 6, 2022

We have had the same issue.
Had to revert our MongoDB cluster back to v5.

Anything on the horizon, when you want to update the MongoDB driver that emqx uses to support MongoDB v6 as well?

@xtianus79
Copy link

This is extremely important. Mongo 6 has been out now and people are going to upgrade, start or transition to 6 and effectively this is a really important issue.

@TDannhauer
Copy link

I agree, all projects using Mongo based ACLs are blocked by this issue, I regard it as a complete blocker for EMQX in general.

@thalesmg
Copy link
Contributor

Hi, sorry for the late reply.

Support for MongoDB 6 was recently added, and the auth problem was fixed here.

This will be included in the next release (5.0.21).

@thalesmg
Copy link
Contributor

Closing as the fix has been released.

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

No branches or pull requests

7 participants