-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[ bug ]V1.8.2 使用root权限账号,mongo无法查询。 #1291
Comments
先把1.8.1的代码拷过来好使了 |
@hhyo 应该是mongo.py#L507-L510的实现有问题
建议改成这样,即明确区分认证的数据库、实际使用的数据库 |
方便的话直接提pr吧 |
Duplicate of #1168 |
这个是逻辑有变动吧,以前的版本是root可以查所有的集合 @LeoQuote |
这个现在就是查不了除admin外其他库的数据,已经是root角色了,正常查询只需要readAnyDatabase角色就可以了,这是要到1.8.3版本才能修复吗? |
我已经将sql/engines/mongo.py下对应的代码改成上面的,然后重启了archery容器,依旧会报 |
部署方式:手工部署
版本:1.8.2
问题:配置好root权限的账号密码后,数据库设置为admin。只能查询admin库下的表。其他库查询均报错。
报错:
[2021-12-21 14:06:46,655][MainThread:139741727864640][task_id:default][query.py:169][ERROR]- 查询异常报错,查询语句:db.store.find()
,错误信息:Traceback (most recent call last):
File "/opt/app/archery/Archery/sql/query.py", line 87, in query
query_engine.get_connection(db_name=db_name)
File "/opt/app/archery/Archery/sql/engines/mongo.py", line 510, in get_connection
self.conn[self.db_name].authenticate(self.user, self.password, self.db_name)
File "/opt/app/archery/Python-3.6.5/venv4archery/lib/python3.6/site-packages/pymongo/database.py", line 1495, in authenticate
connect=True)
File "/opt/app/archery/Python-3.6.5/venv4archery/lib/python3.6/site-packages/pymongo/mongo_client.py", line 781, in _cache_credentials
sock_info.authenticate(credentials)
File "/opt/app/archery/Python-3.6.5/venv4archery/lib/python3.6/site-packages/pymongo/pool.py", line 810, in authenticate
auth.authenticate(credentials, self)
File "/opt/app/archery/Python-3.6.5/venv4archery/lib/python3.6/site-packages/pymongo/auth.py", line 673, in authenticate
auth_func(credentials, sock_info)
File "/opt/app/archery/Python-3.6.5/venv4archery/lib/python3.6/site-packages/pymongo/auth.py", line 591, in _authenticate_default
return _authenticate_scram(credentials, sock_info, 'SCRAM-SHA-1')
File "/opt/app/archery/Python-3.6.5/venv4archery/lib/python3.6/site-packages/pymongo/auth.py", line 295, in _authenticate_scram
res = sock_info.command(source, cmd)
File "/opt/app/archery/Python-3.6.5/venv4archery/lib/python3.6/site-packages/pymongo/pool.py", line 694, in command
exhaust_allowed=exhaust_allowed)
File "/opt/app/archery/Python-3.6.5/venv4archery/lib/python3.6/site-packages/pymongo/network.py", line 162, in command
parse_write_concern_error=parse_write_concern_error)
File "/opt/app/archery/Python-3.6.5/venv4archery/lib/python3.6/site-packages/pymongo/helpers.py", line 168, in _check_command_response
max_wire_version)
pymongo.errors.OperationFailure: Authentication failed., full error: {'operationTime': Timestamp(1640066806, 6), 'ok': 0.0, 'errmsg': 'Authentication failed.', 'code': 18, 'codeName': 'AuthenticationFailed', '$clusterTime': {'clusterTime': Timestamp(1640066806, 6), 'sig
nature': {'hash': b"\xa9\xac'FK\x89\xcc\x83\x94\x1b\xaa\xf9\xbfA\x02\n\xac%:\xec", 'keyId': 7002904756918157317}}}
The text was updated successfully, but these errors were encountered: