Configuration File Lab - Unrecognized option: net

I’m currently at Configuration File Lab, the requirements are :

  • run on port 27000
  • Authetication is enabled

Here is my config file :

net:
	port:27000
security:
    authorization: "enabled"

I’ve checked the documentation & do some googling, i’m sure the syntax is correct. However, upon running at the IDE terminal, i get : Unrecognized option : net error.

Any help, pls?
Note : If i delete the net:port:27000 line, the mongod command will run fine.

The option net should be good. Make sure you do not have anything after the colon. Make sure the indentation is with spaces. Make sure you have a space after the colon when there is a value.

2 Likes

Hi @Rickard_Peter,

This. :point_down:

~ Shubham

2 Likes

I found out that I had to use a newline (\n) and two spaces after the colon.

I passed the quiz using the following YALM structure:

security:
  authorization: enabled
net:
  port: 27000

Notice the 2 spaces before “authorization” and “port”. Apparently, the test will fail if we use more than 2 spaces.

2 Likes

If any one do it in 2022.

TIP: YAML is rigorous about syntax…
So. if you have:
net:
port:2700
it can tell you that is “net” is not recognized, but true error is that: you missing a spacebar between “:” and value. :slight_smile: