New install of single node, [MongoDBPreflightCheck] MongoDB is not available

Before you post: Your responses to these questions will help the community help you. Please complete this template if you’re asking a support question.
Don’t forget to select tags to help index your topic!

1. Describe your incident:
Fresh 6.1 install following the guide : Ubuntu Installation: Single Graylog Node

Got everything installed with the exception of openseach_heap=4g, cannot find location of this entry. mongodb is up and running, I can test the connection successfully but when i try to launch graylog I see the following error in the mongod log. [MongoDBPreflightCheck] MongoDB is not available Retry 1, 2, etc…

2. Describe your environment:

  • OS Information: Ubunti 24.02 on proxmox vm

  • Package Version:
    6.1

  • Service logs, configurations, and environment variables:

2025-02-25T20:51:00.994Z INFO  [ImmutableFeatureFlagsCollector] Following feature flags are used: {default properties file=[cloud_inputs=on, investigation_report_by_ai=on, data_tiering_cloud=off, composable_index_templates=off, preflight_web=on, data_node_migration=on, remote_reindex_migration=off, instant_archiving=off, configurable_value_units=on, new_report_creation=on, threat_coverage=on]}
2025-02-25T20:51:05.201Z INFO  [CmdLineTool] Loaded plugin: AWS plugins 6.1.7+6ec0bac [org.graylog.aws.AWSPlugin]
2025-02-25T20:51:05.204Z INFO  [CmdLineTool] Loaded plugin: Integrations 6.1.7+6ec0bac [org.graylog.integrations.IntegrationsPlugin]
2025-02-25T20:51:05.205Z INFO  [CmdLineTool] Loaded plugin: Threat Intelligence Plugin 6.1.7+6ec0bac [org.graylog.plugins.threatintel.ThreatIntelPlugin]
2025-02-25T20:51:05.206Z INFO  [CmdLineTool] Loaded plugin: Elasticsearch 7 Support 6.1.7+6ec0bac [org.graylog.storage.elasticsearch7.Elasticsearch7Plugin]
2025-02-25T20:51:05.207Z INFO  [CmdLineTool] Loaded plugin: OpenSearch 2 Support 6.1.7+6ec0bac [org.graylog.storage.opensearch2.OpenSearch2Plugin]
2025-02-25T20:51:05.318Z INFO  [CmdLineTool] Running with JVM arguments: -Xms4g -Xmx4g -XX:+UseG1GC -XX:-OmitStackTraceInFastThrow -Djdk.tls.acknowledgeCloseNotify=true -Dlog4j2.formatMsgNoLookups=true -Dlog4j.configurationFile=file:///etc/graylog/server/log4j2.xml -Dgraylog2.installation_source=deb
2025-02-25T20:51:06.551Z INFO  [client] MongoClient with metadata {"driver": {"name": "mongo-java-driver|legacy", "version": "5.2.0"}, "os": {"type": "Linux", "name": "Linux", "architecture": "amd64", "version": "6.8.0-54-generic"}, "platform": "Java/Eclipse Adoptium/17.0.14+7"} created with settings MongoClientSettings{readPreference=primary, writeConcern=WriteConcern{w=null, wTimeout=null ms, journal=null}, retryWrites=true, retryReads=true, readConcern=ReadConcern{level=null}, credential=null, transportSettings=null, commandListeners=[], codecRegistry=ProvidersCodecRegistry{codecProviders=[ValueCodecProvider{}, BsonValueCodecProvider{}, DBRefCodecProvider{}, DBObjectCodecProvider{}, DocumentCodecProvider{}, CollectionCodecProvider{}, IterableCodecProvider{}, MapCodecProvider{}, GeoJsonCodecProvider{}, GridFSFileCodecProvider{}, Jsr310CodecProvider{}, JsonObjectCodecProvider{}, BsonCodecProvider{}, EnumCodecProvider{}, com.mongodb.client.model.mql.ExpressionCodecProvider@12fcc71f, com.mongodb.Jep395RecordCodecProvider@5679e96b, com.mongodb.KotlinCodecProvider@3ed7821]}, loggerSettings=LoggerSettings{maxDocumentLength=1000}, clusterSettings={hosts=[localhost:27017], srvServiceName=mongodb, mode=SINGLE, requiredClusterType=UNKNOWN, requiredReplicaSetName='null', serverSelector='null', clusterListeners='[]', serverSelectionTimeout='30000 ms', localThreshold='15 ms'}, socketSettings=SocketSettings{connectTimeoutMS=10000, readTimeoutMS=0, receiveBufferSize=0, proxySettings=ProxySettings{host=null, port=null, username=null, password=null}}, heartbeatSocketSettings=SocketSettings{connectTimeoutMS=10000, readTimeoutMS=10000, receiveBufferSize=0, proxySettings=ProxySettings{host=null, port=null, username=null, password=null}}, connectionPoolSettings=ConnectionPoolSettings{maxSize=1000, minSize=0, maxWaitTimeMS=120000, maxConnectionLifeTimeMS=0, maxConnectionIdleTimeMS=0, maintenanceInitialDelayMS=0, maintenanceFrequencyMS=60000, connectionPoolListeners=[], maxConnecting=2}, serverSettings=ServerSettings{heartbeatFrequencyMS=10000, minHeartbeatFrequencyMS=500, serverMonitoringMode=AUTO, serverListeners='[]', serverMonitorListeners='[]'}, sslSettings=SslSettings{enabled=false, invalidHostNameAllowed=false, context=null}, applicationName='null', compressorList=[], uuidRepresentation=UNSPECIFIED, serverApi=null, autoEncryptionSettings=null, dnsClient=null, inetAddressResolver=null, contextProvider=null, timeoutMS=null}
2025-02-25T20:51:06.560Z INFO  [client] MongoClient with metadata {"driver": {"name": "mongo-java-driver", "version": "5.2.0"}, "os": {"type": "Linux", "name": "Linux", "architecture": "amd64", "version": "6.8.0-54-generic"}, "platform": "Java/Eclipse Adoptium/17.0.14+7"} created with settings MongoClientSettings{readPreference=primary, writeConcern=WriteConcern{w=null, wTimeout=null ms, journal=null}, retryWrites=true, retryReads=true, readConcern=ReadConcern{level=null}, credential=null, transportSettings=null, commandListeners=[], codecRegistry=ProvidersCodecRegistry{codecProviders=[ValueCodecProvider{}, BsonValueCodecProvider{}, DBRefCodecProvider{}, DBObjectCodecProvider{}, DocumentCodecProvider{}, CollectionCodecProvider{}, IterableCodecProvider{}, MapCodecProvider{}, GeoJsonCodecProvider{}, GridFSFileCodecProvider{}, Jsr310CodecProvider{}, JsonObjectCodecProvider{}, BsonCodecProvider{}, EnumCodecProvider{}, com.mongodb.client.model.mql.ExpressionCodecProvider@12fcc71f, com.mongodb.Jep395RecordCodecProvider@5679e96b, com.mongodb.KotlinCodecProvider@3ed7821]}, loggerSettings=LoggerSettings{maxDocumentLength=1000}, clusterSettings={hosts=[localhost:27017], srvServiceName=mongodb, mode=SINGLE, requiredClusterType=UNKNOWN, requiredReplicaSetName='null', serverSelector='null', clusterListeners='[]', serverSelectionTimeout='30000 ms', localThreshold='15 ms'}, socketSettings=SocketSettings{connectTimeoutMS=10000, readTimeoutMS=0, receiveBufferSize=0, proxySettings=ProxySettings{host=null, port=null, username=null, password=null}}, heartbeatSocketSettings=SocketSettings{connectTimeoutMS=10000, readTimeoutMS=10000, receiveBufferSize=0, proxySettings=ProxySettings{host=null, port=null, username=null, password=null}}, connectionPoolSettings=ConnectionPoolSettings{maxSize=1000, minSize=0, maxWaitTimeMS=120000, maxConnectionLifeTimeMS=0, maxConnectionIdleTimeMS=0, maintenanceInitialDelayMS=0, maintenanceFrequencyMS=60000, connectionPoolListeners=[], maxConnecting=2}, serverSettings=ServerSettings{heartbeatFrequencyMS=10000, minHeartbeatFrequencyMS=500, serverMonitoringMode=AUTO, serverListeners='[]', serverMonitorListeners='[]'}, sslSettings=SslSettings{enabled=false, invalidHostNameAllowed=false, context=null}, applicationName='null', compressorList=[], uuidRepresentation=UNSPECIFIED, serverApi=null, autoEncryptionSettings=null, dnsClient=null, inetAddressResolver=null, contextProvider=null, timeoutMS=null}
2025-02-25T20:51:06.829Z INFO  [cluster] Waiting for server to become available for operation with ID 3. Remaining time: 29990 ms. Selector: ReadPreferenceServerSelector{readPreference=primary}, topology description: {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING}].
2025-02-25T20:51:07.053Z INFO  [cluster] Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=REPLICA_SET_GHOST, cryptd=false, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=21, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=18100337, minRoundTripTimeNanos=0, setName='null', canonicalAddress=null, hosts=[], passives=[], arbiters=[], primary='null', tagSet=TagSet{[]}, electionId=null, setVersion=null, topologyVersion=TopologyVersion{processId=67be2d35c27e41b20ff2d090, counter=0}, lastWriteDate=null, lastUpdateTimeNanos=59949380759}
2025-02-25T20:51:07.112Z INFO  [MongoDBPreflightCheck] MongoDB is not available. Retry #1
2025-02-25T20:51:09.115Z INFO  [MongoDBPreflightCheck] MongoDB is not available. Retry #2

3. What steps have you already taken to try and solve the problem?
I have scorched reddit, this forum and google to no avail.

4. How can the community help?
Any tips or suggestions on getting it working would be great. I cannot launch the preflight login I am assuming due to Mongodb not being available even though I can successfully test the connection.

nc -vz my_node_ip 27017 returns successful

Helpful Posting Tips: Tips for Posting Questions that Get Answers [Hold down CTRL and link on link to open tips documents in a separate tab]

Hi Drew -

I have a similar situation here with my install, with the exception that I am installing on Debian 12. I have a couple of days invested in this and am about to just move on to try something else. No way this install should be this challenging.

I am sure that there are a small handful of areas that can trip up a new user doing an install and a Install FAQ doc that addresses this area would really be helpful.

I actually had this working yesterday, after a lot of effort, and got to play with it for a bit. But after a reboot I get a “Server Unavailable” message at port 9000. I have gone through the installation steps a dozen times, to no avail in trying to resolve this.

Since we are basically in the same situation, I thought maybe we could compare notes. Maybe others that have had success installing this can help. So, if you are okay with a nubie trying to help out, just let me know.

In terms of config for me:

  1. MongoDB install seems just fine. Service is running and since it worked before, I am comfortable that on mu box here Mongo DB is installed properly.

Is MongoDB installed and running properly on your machine? Service is running and enabled so that it starts automatically after a reboot? (I would just like to “rule out” MongoDB as an issue, so that we can move on to move likely culprits.)

Thanks,
Kevin

I did find a link to this doc, which was pretty close to an “Install FAQ”. Possibly it can offer some insights for you as well.

Initial Configuration Settings Doc

Hi Kevin,

mongodb is running fine per systemctl status. I did notice some errors in the mongodb log that reference “Failed to refresh key cache”.

where did you place opensearch_heap=8gb? Thanks

For my install:
-Installation and config of the Server and Data Nodes worked fine.
-SHA2 and Password_Secret values done in both Config files.
-IP and Port binding setup per the instructions (0.0.0.0:9000)

Services:
-Mongo DB is running fine
-DataNode Service is running fine
-Server is running fine (Although this seems to error out and need to be restarted after awhile)

Questions I have:
-How do you get back to the Pre-Flight Check page?
-After an initial config, you can just “tail” the Log file to get the initial password. But pretty quickly it won’t be visible using this command any longer, because it’s too far down - or gone completely. How can you regenerate this password?

Thanks,
Kevin.

you should be able to just cat the log file and zoom up, I’m not sure how the login preflight check page is displayed. I think I saw a flag that is 1 and sets to 0 after its setup. maybe you can just reset the flag.

do you have any errors in your mongodb log?
which os are you using?
what version of mongo?
Thanks

My server.log file is a few thousand lines long right now. I would fully expect this to be at the bottom towards the start of the file, but I really don’t see any hint of it yet. That’s why I was hoping to find a keyword close by that I could search for that might get me “in the Neighborhood.”

Possibly it is removed from the log file as part of the “Pre-Flight Check.”

My environment worked for a few hours yesterday, so my log files have a ton of data in them. When I look at /var/log/mongodb/mongodb.log, I don’t see any errors (and since it worked and is full of data, I really wouldn’t expect to see any errors in it.)

OS is Debian 12. Mongo is 8.0

can you do grep "pre-flight" server.log?

Just did. The only thing I find is “Skip PreFlight Checks” Boolean:

Do not perform any preflight checks when starting Graylog

Default: false

#skip_preflight_checks = false

I will play with this in a minute…

Hi! I got into your same problem.
If you look on the mongodb log you will see that it’s not communicating with it’s own replica.
The solution for this is:
execute ‘sudo mongosh’ on terminal.
then run ‘rs.initiate()’ from there. As soon it finishes, just type ‘CTRL+D’ to leave and restart graylog server service: ‘sudo systemctl restart graylog-server.service’

Then tail it’s log to see your credentials:
sudo tail -f -n 200 /var/log/graylog-server/server.log

Hope this helps you.

1 Like

Relative to this question - I am trying (and actually did for a bit) just trying to do a “Single Graylog Node” installation - which to my understanding and experience doesn’t use that variable at all.

I think the datanode is either “Graylog” or ElasticSearch. Graylog node doesn’t use it, Elasticsearch likely does.

Thanks for your tips Ricardo!

When I try to do an rs.initiate() I get the following:

MongoServerError[NoReplicationEnabled]: This node was not started with replication enabled.

I only have one Data Node and it’s on the same server as MongoDB and Graylog Server, so I wouldn’t expect replication to be relevant right now.
Tailing the log just shows the same old stuff.

But I absolutely appreciate your taking time to offer these worthwhile suggestions my friend!

Thanks, that got it working for me but its using 100% of the memory. Did you have to add the opensearch_heap=8g to you file?

Thanks again!

Hi Drew - I definitely didn’t add that variable to my config when I was setting this up. When it was working, it was working just fine without that variable.

I have wasted too much time on this effort. If someone chimes in with some tips, I will sure pursue any and all of them to see if any of them can resolve this. If not, when this thread expires, I will just move on from Graylog.

Hi Drew - Glad you have it working now. I have read a few threads related to installation issues and none of them seem to be productive for this issue. I am going to pursue other options. Glad for you tho!

what are the errors in your log? server.log? if any

this setting goes into the datanode.conf file. I had been thinking that we state this quite prominently in the installation docs, but maybe not enough then. A colleague already took this as an opportunity to create an issue to improve the default file.

1 Like
  • can you share the logs when it starts to error out?

  • the preflight page is not supposed to come back after you made your initial install. why do you need it back?

  • the preflight password is only created once, I’d recommend copy/pasting it if you think you need it again. But it’s disabled/removed after the initial install and you can’t use it for anything else but the preflight