Error while lanching mongod with config file

i used below config in the config file
dbPath: “/data/db”
port: 27000
bindIp: “,”

getting error as follows:
C:\Users\DAS\m103\m103-vagrant-env>mongod --config config.txt
2019-08-23T18:53:45.334+0100 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols ‘none’
2019-08-23T18:53:45.338+0100 I CONTROL [initandlisten] MongoDB starting : pid=12240 port=27000 dbpath=/data/db 64-bit host=DESK
2019-08-23T18:53:45.338+0100 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2019-08-23T18:53:45.339+0100 I CONTROL [initandlisten] db version v4.0.10
2019-08-23T18:53:45.339+0100 I CONTROL [initandlisten] git version: c389e7f69f637f7a1ac3cc9fae843b635f20b766
2019-08-23T18:53:45.340+0100 I CONTROL [initandlisten] allocator: tcmalloc
2019-08-23T18:53:45.341+0100 I CONTROL [initandlisten] modules: enterprise
2019-08-23T18:53:45.342+0100 I CONTROL [initandlisten] build environment:
2019-08-23T18:53:45.343+0100 I CONTROL [initandlisten] distmod: windows-64
2019-08-23T18:53:45.344+0100 I CONTROL [initandlisten] distarch: x86_64
2019-08-23T18:53:45.345+0100 I CONTROL [initandlisten] target_arch: x86_64
2019-08-23T18:53:45.346+0100 I CONTROL [initandlisten] options: { config: “config.txt”, net: { bindIp: “,”, port: 27000 }, storage: { dbPath: “/data/db” } }
2019-08-23T18:53:45.351+0100 E STORAGE [initandlisten] Failed to set up listener: SocketException: The requested address is not valid in its context.
2019-08-23T18:53:45.351+0100 I CONTROL [initandlisten] now exiting
2019-08-23T18:53:45.352+0100 I CONTROL [initandlisten] shutting down with code:48

i checked the whitespaces between bindIP but there is no space

Please help where am i getting wrong


Perhaps reviewing the documentation on the config file can help you out.

MongoDB configuration files use the YAML format
YAML is a superset of JSON.

I have used the below command for ip
but still not solved the issue
dbPath: “/data/db”
port: 27000
bindIp: “,localhost”
authorization: enabled

Please help


I am guess this is the first lab, so:

In the first lab, you created a user with the root role on the admin database. The requirements are listed here:

  • run on port 27000
  • data files are stored in /var/mongodb/db/
  • listens to connections from the IP address and localhost
  • authentication is enabled

Why I bring this up is because you may have a permission problem use /data/db

And just for sanity sake please use the code formatting to share the contents of your config file as I do not know if what you posted is literally your config or you have proper spaces and that did not translate in the copy paste.

I am not sure but may be the quotes are problem.