I was baffled, I could not see any difference between the (2) mongod.cfg files I was playing with. One would work, the other would not.
To the naked eye, the only difference was an extra line. Could the startup process be so delicate and so flimsy that an innocent extra line could cause a failure to start up the mongodb database? Apparently so.
After further examining that innocent extra line in the mongod.cfg file, I found I had pressed the “tab” key, so if I kept the extra line in, but with no “tab” indentation in the line, I could successfully startup the mongodb database. However, put that “tab” in the extra blank line, it fails to startup mondodb.
I am baffled, how easily this can happen. 4 hours ago I made a change to the mongod.cfg file according to the online manual at https://docs.mongodb.com/manual/tutorial/enable-authentication/, and then it did not work.
Well I proceeded to backout line by line and trying with no success, until I was down to the only difference between the mongod.cfg that worked and the mongod.cfg the did NOT work was an extra line with a “tab” indentation that is not visible to the naked eye.
Question:
What is wrong with the mongo configuration reader that it cannot handle and extra “tab” in a line?
See my attached two mongod.cfg files
#1. mongod.cfg <— that works
#2. mongod.cfg <— that does not work with one extra blank line. See line number 12. Mongodb supplies no log messages in an empty mongod.log to analyze. It fails hard and fast.
Mongodb version 4.4.0
Windows 10 pro 64bit
Editor windows Notepad++