Hi,
# 1. RPM problems
Something is wrong with the new release: The RPM logic seems wrong.
Clients modify their cmdb.conf for their environments. This is normal. We have to.
Usually when an rpm installs new client customisable configuration files, the process either prompts the if the new files hsiould clobber the existing file or should it be backed up. If iInteractive is not meant to happen then the RPM process should write the new configuration file with a suffix.
Thus the /etc/datagerry/cmdb.conf should be left untouched by the RPM.
Unfortunately, this does not happen.
The Datagerry RPM just writes the distribution over the existing file.
Which means for many, the datagerry instances will fail because the configuration is now broken.
For examples, our mongodb database is called datagerry.
The config file has:
database_name = datagerry
The RPM deletes our cmdb.conf now we have got database_name = cmdb
so the app will not start after the new RPM is installed.
So,Best to back up your datagerry configuration files before you upgrade datagrerry. and put these back afterwards. Else, datagrerry will not start.
# 2. Exernal Mongo datbase servers problems with and without TLS
I tried again to use mongodb on an external servers with and without TLS again on version 2.2.0, but it still won’t connect.
Mongosh works just fine with the same credentials from the VM running the Datagerry instance, so I can deduce the problem lies with Datagerry. Because otherwise mongodh connection would not work, but it does.
Here are the configurations used and error messages:
# Config with TLS Disabled
# Mongod /etc/mongod.conf
systemLog:
destination: file
logAppend: true
path: /var/log/mongod/mongod.log
storage:
dbPath: /data/mongodb/mongodbdata
journal:
enabled: true
processManagement:
timeZoneInfo: /usr/share/zoneinfo
net:
port: 27017
bindIpAll: true
tls:
mode: enabled
security:
authorization: enabled
# /etc/datagerry/cmdb.conf
[Database]
host = 218.g.local
port = 27017
database_name = datagerry
username = datagerry_user
password = xxxxxx
tls = false
[WebServer]
host = 0.0.0.0
port = 4000
[MessageQueueing]
host = 127.0.0.1
port = 5672
username = guest
password = xxxxxx
exchange = datagerry.eventbus
connection_attempts = 2
retry_delay = 6
# Errors with TLS disabled
Nov 7 14:05:10 dg-server datagerry[221556]: [2024-11-07 14:05:10][INFO ] --- Checking database connection with cmdb.conf data (__main__.py)
Nov 7 14:05:10 dg-server datagerry[221556]: [2024-11-07 14:05:10][CRITICAL] --- CMDBError: Authentication failed., full error: {'ok': 0.0, 'errmsg': 'Authentication failed.', 'code': 18, 'codeName': 'AuthenticationFailed'} (__main__.py)
Nov 7 14:05:10 dg-server datagerry[221556]: [2024-11-07 14:05:10][INFO ] --- DATAGERRY stopped! (__main__.py)
# Config with TLS Enabled
# Mongod /etc/mongod.conf
systemLog:
destination: file
logAppend: true
path: /var/log/mongod/mongod.log
storage:
dbPath: /data/mongodb/mongodbdata
journal:
enabled: true
processManagement:
timeZoneInfo: /usr/share/zoneinfo
net:
port: 27017
bindIpAll: true
tls:
mode: enabled
security:
authorization: enabled
# /etc/datagerry/cmdb.conf
[Database]
host = 218.g.local
port = 27017
database_name = datagerry
username = datagerry_user
password = xxxxxx
tls = true
tlsCertificateKeyFile=/etc/pki/tls/private/mongodb-chain-218.pem
tlsCAFile=/etc/pki/tls/certs/mongodb-218.pem
[WebServer]
host = 0.0.0.0
port = 4000
[MessageQueueing]
host = 127.0.0.1
port = 5672
username = guest
password = xxxxxx
exchange = datagerry.eventbus
connection_attempts = 2
retry_delay = 6
# Errors with TLS enabled from /var/log/datagerry
Nov 7 14:00:25 dg-server datagerry[214406]: [2024-11-07 14:00:25][CRITICAL] --- DatabaseConnectionError: Could not connect to database SSL handshake failed: 218.g.local:27017: EOF occurred in violation of protocol (_ssl.c:1129) (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms), Timeout: 30s, Topology Description: <TopologyDescription id: 672cb9cb1791b784bea68852, topology_type: Unknown, servers: [<ServerDescription ('218.g.local', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('SSL handshake failed: 218.g.local:27017: EOF occurred in violation of protocol (_ssl.c:1129) (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms)')>]> (__main__.py)