Duplicate keyerror for : security.authorization

Hi, I am trying to create a config file as below but i keep getting same error every time:

Error:

Error parsing YAML config: duplicate key: security.authorization(canonical key: se
curity.authorization)

Config file:

vagrant@m103:~$ cat etc/mongod.conf
storage:
dbPath: /data/db
systemLog:
path:/data/log/mongod.log
destination:file
net:
bindIp:localhost,192.168.0.100
port:27000
security:
keyFile:/data/keyfile
authorization:enabled
processManagement:
fork:true

I have even tried creating a new file without using tab key even once and only used spaces while, editing using nano and I am still getting the same error. Please help

Hi @Rounak_65961,

You need to be very careful about proper indentation. Please use only spaces and not tabs for YAML config file indentation purposes.

Also, you need to rectify the IP address in bindIp - 192.168.0.100. It should be 192.168.103.100.

Hope this helps!

Thanks,
Muskan

Thanks Muskan,
I solved the problem and passed the lab.

1 Like