Unable to connect to MongoDB
search cancel

Unable to connect to MongoDB

book

Article ID: 416123

calendar_today

Updated On:

Products

DX SaaS

Issue/Introduction

MongoDB metrics are not showing in DX SaaS

The IntroscopeAgent.log shows the following error

[ERROR] [IntroscopeAgent.mongodb-ia] Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=hostname:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]

 

 

Resolution

com.mongodb.MongoSocketReadException: Prematurely reached end of stream is from the MongoDB side.


1) Review the mongod.log and the location of this log is set in the mongod conf file.

The mongod.log shows connection requests being refused because the agent was not set to use SSL.

 
2) In the mongod config file, find the cert file being used which was mongodb.pem and converted to pkcs12 format
Run 
openssl pkcs12 -export -inkey mongodb.pem -in mongodb.pem -out cert_key.p12

3) Edit the mongodb-ia-dd040260xt317-25.5.2.10\bundle.properties 

Comment out 

#introscope.agent.mongodb.profiles.default.ssl.enabled=true


Comment out and provide absolute path cert_key.p12

#introscope.agent.mongodb.profiles.truststore.path=
 

Comment out and provide password for cert_key.p12

#introscope.agent.mongodb.profiles.truststore.password=