Mongo client not found with remote mongo db

I have installed foreman katello on a server with a remote mongo database
The command katello-service status failed with this error :

Displaying the following service(s):
Mongo client was not found

The mongo version is 2.6.
katello version : katello-3.14.1-1

I think the issue is due to this check in the file definitions/features/mongo.rb :

119 def server_version(config = configuration)
120 # do not use any core methods as we need this prior the core is created
121 mongo_cmd = base_command(available_core.client_command, config,
122 “–eval ‘db.version()’ #{config[‘name’]}”)
123 version = execute!(mongo_cmd, :hidden_patterns => [config[‘password’]])
124 version.split("\n").last
125 end

Because the remote mongo server version is 2.6 but the client installed on katello server is rh-mongodb34-mongodb-3.4.9-1
And the script is looking for the client version 2.6.

Do you think i should change the mongo server version ? Or the mongo client 3.4 is compatible ?
thanks for advance

@kalistuf are there any other traces of this error in the production.log for foreman?

Are you able to connect to the mongo server with a 3.x mongo client outside of foreman/katello?

Thank you @jjeffers
no I don’t see another error.
Yes, the 3.4 mongo client (on the katello server) is able to connect to the remote 2.6 mongodb server.
Katello is successfull installed but it is only a service management issue due to the foreman-maintain package.
It is impossible to install the rpm mongodb from epel because of an incompatibility with the package rh-mongodb34-mongodb-syspaths which installs the mongo binary in the directory : /usr/bin

yum install mongodb
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Resolving Dependencies
–> Running transaction check
—> Package mongodb.x86_64 0:2.6.12-6.el7 will be installed
–> Processing Conflict: rh-mongodb34-mongodb-syspaths-3.4.9-1.el7.x86_64 conflicts mongodb
–> Finished Dependency Resolution
Error: rh-mongodb34-mongodb-syspaths conflicts with mongodb-2.6.12-6.el7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

I don’t understand why katello-maintain binary is trying to get the mongo server version to look at the mongo client because if the mongo server is remote, the client on the mongo server is always the package rh-mongodb34 which is a dependency of katello.

The whole point of the -syspaths package is that there’s a working mongo package in $PATH. That’s all foreman-maintain should care about IMHO. It should not be trying to tie the server version to the local client tools.

1 Like