Lab - Configuration File- YAML duplicate key error

Hi,

I keep getting the following error when I try to run the config in vagrant. I have tried different things to resolve, but nothing seems to be working.

Error:

Error parsing YAML config: duplicate key: security.authorization(canonical key: security.authorization)
try ‘mongod --help’ for more information
Screenshot:
image

My config file is stored in vagrant home, under: /etc/mongod.conf
mongod.conf file contains:
image

Command used to run the config file:
mongod --config /etc/mongod.conf

If you have any suggestions that would help. Please let me know if further details are needed.

Thank you in advance!

Is the output given complete config file?
I don’t see any duplicates
Normally /etc/mongod.conf is a master file available on the server.Did you edit that file or created a new one?
Try to create a new file at a different location with just needed entries and try to bring up mongod

Hi @jramanan,

Please create a new file at a different location as suggested by @Ramachandra_37567 and take care of the below points while creating the new file:

  • Use spaces only and no tabs

  • Try removing the double quotes from the values if it still doesn’t work.

Kindly get back to us if you face any more issues here.

Thanks,
Muskan
Curriculum Support Engineer

Hi @Ramachandra_37567, @Muskan_Sharma:

I created a different file this time. I made sure that I have only spaces and no tabs in the config setting. I’ve also removed the double-quotes. But, now I am getting a different error:
image

My current config file looks like the following:
image

This config is in /data/mongod.conf
I am not sure about this error.

Thanks

I got it working, thank you so much!! Phew! :slight_smile:

1 Like