Net options not recognizing bindIp

When trying to validate with mongo to submit the assignment I get “You need to bind the IP address.” I got these warnings but no errors.

Server has startup warnings:
2020-03-10T17:11:00.061+0000 I STORAGE [initandlisten]
2020-03-10T17:11:00.062+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2020-03-10T17:11:00.062+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2020-03-10T17:11:01.014+0000 I CONTROL [initandlisten]
2020-03-10T17:11:01.015+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2020-03-10T17:11:01.016+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2020-03-10T17:11:01.016+0000 I CONTROL [initandlisten]
2020-03-10T17:11:01.017+0000 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2020-03-10T17:11:01.018+0000 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2020-03-10T17:11:01.019+0000 I CONTROL [initandlisten] ** Start the server with --bind_ip to specify which IP
2020-03-10T17:11:01.020+0000 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2020-03-10T17:11:01.020+0000 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2020-03-10T17:11:01.021+0000 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2020-03-10T17:11:01.022+0000 I CONTROL [initandlisten]

net:

bindIp: “127.0.0.1,192.168.103.100”

port: 27000

storage:

dbPath: “/var/mongodb/db/”

security:

authorization: “enabled”

What is the exact error message?

Could you please re-post your configuration with the html pre tag so that the indentation is preserved?

When trying to validate with mongo to submit the assignment I get “You need to bind the IP address.” I got these warnings but no errors.

Server has startup warnings:
2020-03-10T17:11:00.061+0000 I STORAGE [initandlisten]
2020-03-10T17:11:00.062+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2020-03-10T17:11:00.062+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2020-03-10T17:11:01.014+0000 I CONTROL [initandlisten]
2020-03-10T17:11:01.015+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2020-03-10T17:11:01.016+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2020-03-10T17:11:01.016+0000 I CONTROL [initandlisten]
2020-03-10T17:11:01.017+0000 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2020-03-10T17:11:01.018+0000 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2020-03-10T17:11:01.019+0000 I CONTROL [initandlisten] ** Start the server with --bind_ip to specify which IP
2020-03-10T17:11:01.020+0000 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2020-03-10T17:11:01.020+0000 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2020-03-10T17:11:01.021+0000 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2020-03-10T17:11:01.022+0000 I CONTROL [initandlisten]

net:

  bindIp: "127.0.0.1,192.168.103.100"

  port: 27000

storage: 

  dbPath: "/var/mongodb/db/"

security:

  authorization: "enabled"

Please run the following from the shell and provide the result.

use admin
db.adminCommand( { getCmdLineOpts: 1  } )

I would also try to put the 192.* address before the 128.*. May be there is an issue with the validation script.

1 Like

Thank you for the response. This does not seem to work. I receive the same warnings. What does the db.adminCommand({getCmdLineOpts: 1 }) do?

{
        "argv" : [
                "mongod",
                "--port",
                "27000"
        ],
        "parsed" : {
                "net" : {
                        "port" : 27000
                }
        },
        "ok" : 1
}

For all the information you might need

https://docs.mongodb.com/manual/reference/command/getCmdLineOpts/#dbcmd.getCmdLineOpts

From the output of getCmdLineOpts it looks like you are not starting mongod with the configuration file.

Yes that was the problem. But now I’m getting a large printout with a “***aborting after invariant() failure”

I’m assuming it can’t find the var directory but I’m not sure why.

Last login: Tue Mar 10 16:41:13 2020 from 10.0.2.2
vagrant@m103:~$ mongod --config /shared/config/config.conf
2020-03-10T19:37:33.277+0000 I CONTROL [initandlisten] MongoDB starting : pid=10039 port=27000 dbpath=/var/mongodb/db/ 64-bit host=m103
2020-03-10T19:37:33.278+0000 I CONTROL [initandlisten] db version v3.6.17
2020-03-10T19:37:33.279+0000 I CONTROL [initandlisten] git version: 3d6953c361213c5bfab23e51ab274ce592edafe6
2020-03-10T19:37:33.279+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2020-03-10T19:37:33.279+0000 I CONTROL [initandlisten] allocator: tcmalloc
2020-03-10T19:37:33.280+0000 I CONTROL [initandlisten] modules: enterprise
2020-03-10T19:37:33.281+0000 I CONTROL [initandlisten] build environment:
2020-03-10T19:37:33.283+0000 I CONTROL [initandlisten] distmod: ubuntu1404
2020-03-10T19:37:33.284+0000 I CONTROL [initandlisten] distarch: x86_64
2020-03-10T19:37:33.286+0000 I CONTROL [initandlisten] target_arch: x86_64
2020-03-10T19:37:33.286+0000 I CONTROL [initandlisten] options: { config: “/shared/config/config.conf”, net: { bindIp: “192.168.103.100,127.0.0.1”, port: 27000 }, security: { authorization: “enabled” }, storage: { dbPath: “/var/mongodb/db/” } }
2020-03-10T19:37:33.287+0000 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /var/mongodb/db/ not found., terminating
2020-03-10T19:37:33.289+0000 F - [initandlisten] Invariant failure globalStorageEngine src/mongo/db/service_context_d.cpp 272
2020-03-10T19:37:33.290+0000 F - [initandlisten]

***aborting after invariant() failure

2020-03-10T19:37:33.306+0000 F - [initandlisten] Got signal: 6 (Aborted).

0x7fa306cd4ba1 0x7fa306cd3db9 0x7fa306cd429d 0x7fa301a27330 0x7fa301684c37 0x7fa301688028 0x7fa305299f58 0x7fa305489cc8 0x7fa306b50271 0x7fa306b4c357 0x7fa3053175d3 0x7fa306ccff65 0x7fa30529b131 0x7fa30522e70c 0x7fa30531ef5a 0x7fa30529c089 0x7fa30166ff45 0x7fa3053070cf
----- BEGIN BACKTRACE -----
{“backtrace”:[{“b”:“7FA3048CB000”,“o”:“2409BA1”,“s”:"_ZN5mongo15printStackTraceERSo"},{“b”:“7FA3048CB000”,“o”:“2408DB9”},{“b”:“7FA3048CB000”,“o”:“240929D”},{“b”:“7FA301A17000”,“o”:“10330”},{“b”:“7FA30164E000”,“o”:“36C37”,“s”:“gsignal”},{“b”:“7FA30164E000”,“o”:“3A028”,“s”:“abort”},{“b”:“7FA3048CB000”,“o”:“9CEF58”,“s”:"_ZN5mongo22invariantFailedWithMsgEPKcS1_S1_j"},{“b”:“7FA3048CB000”,“o”:“BBECC8”,“s”:"_ZN5mongo20ServiceContextMongoD9_newOpCtxEPNS_6ClientEj"},{“b”:“7FA3048CB000”,“o”:“2285271”,“s”:"_ZN5mongo14ServiceContext20makeOperationContextEPNS_6ClientE"},{“b”:“7FA3048CB000”,“o”:“2281357”,“s”:"_ZN5mongo6Client20makeOperationContextEv"},{“b”:“7FA3048CB000”,“o”:“A4C5D3”},{“b”:“7FA3048CB000”,“o”:“2404F65”},{“b”:“7FA3048CB000”,“o”:“9D0131”,“s”:"_ZN5mongo8shutdownENS_8ExitCodeERKNS_16ShutdownTaskArgsE"},{“b”:“7FA3048CB000”,“o”:“96370C”,“s”:"_ZZN5mongo13duration_castINS_8DurationISt5ratioILl1ELl1000EEEES2_ILl1ELl1EEEET_RKNS1_IT0_EEENKUlvE_clEv"},{“b”:“7FA3048CB000”,“o”:“A53F5A”,“s”:“ZN5mongo11mongoDbMainEiPPcS1”},{“b”:“7FA3048CB000”,“o”:“9D1089”,“s”:“main”},{“b”:“7FA30164E000”,“o”:“21F45”,“s”:"__libc_start_main"},{“b”:“7FA3048CB000”,“o”:“A3C0CF”}],“processInfo”:{ “mongodbVersion” : “3.6.17”, “gitVersion” : “3d6953c361213c5bfab23e51ab274ce592edafe6”, “compiledModules” : [ “enterprise” ], “uname” : { “sysname” : “Linux”, “release” : “3.13.0-170-generic”, “version” : “#220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019”, “machine” : “x86_64” }, “somap” : [ { “b” : “7FA3048CB000”, “elfType” : 3, “buildId” : “6ACAF269F5944FAB5A293A46CBA9DEA6B6F74E3A” }, { “b” : “7FFD9D732000”, “elfType” : 3, “buildId” : “8BEB43CA1BD4CFDB90BC2BFCE0EC3042E4090782” }, { “b” : “7FA30443F000”, “path” : “/usr/lib/x86_64-linux-gnu/libcurl.so.4”, “elfType” : 3, “buildId” : “4ACB08147817E6291B181CEF491FB4724336AC04” }, { “b” : “7FA303FD2000”, “path” : “/usr/lib/x86_64-linux-gnu/libnetsnmpmibs.so.30”, “elfType” : 3, “buildId” : “931606F6B9E4CCB05C628D0525E564CE5E7A2DB4” }, { “b” : “7FA303DC3000”, “path” : “/usr/lib/x86_64-linux-gnu/libsensors.so.4”, “elfType” : 3, “buildId” : “859FDBFDD82F0EFDEB44A433D9D8020A232A35E2” }, { “b” : “7FA303BBF000”, “path” : “/lib/x86_64-linux-gnu/libdl.so.2”, “elfType” : 3, “buildId” : “1B38A86853776548628FA4090913C7A12C8F3F4D” }, { “b” : “7FA303956000”, “path” : “/usr/lib/x86_64-linux-gnu/libnetsnmpagent.so.30”, “elfType” : 3, “buildId” : “AD37989D875C4B4DAAF96CD26387B8BFBAA9EE4F” }, { “b” : “7FA30374C000”, “path” : “/lib/x86_64-linux-gnu/libwrap.so.0”, “elfType” : 3, “buildId” : “54FCBC5B0F994A13A9B0EAD46F23E7DA7F7FE75B” }, { “b” : “7FA303472000”, “path” : “/usr/lib/x86_64-linux-gnu/libnetsnmp.so.30”, “elfType” : 3, “buildId” : “2A8B93895720278AAE3C1C44E38A217A4A83E134” }, { “b” : “7FA303095000”, “path” : “/lib/x86_64-linux-gnu/libcrypto.so.1.0.0”, “elfType” : 3, “buildId” : “0430E61DA2B4291F7CE5512101F7AE23C93236D4” }, { “b” : “7FA302E7A000”, “path” : “/usr/lib/x86_64-linux-gnu/libsasl2.so.2”, “elfType” : 3, “buildId” : “666B276BD134B0E9579B67D4EE333F2D0FB813CD” }, { “b” : “7FA302C29000”, “path” : “/usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2”, “elfType” : 3, “buildId” : “372822D0E17BF7C615B6345E5ECEFB1B27BCA57B” }, { “b” : “7FA302A1A000”, “path” : “/usr/lib/x86_64-linux-gnu/liblber-2.4.so.2”, “elfType” : 3, “buildId” : “B39BBBBA44739593151523E5F03459BC3E2D3205” }, { “b” : “7FA3027D3000”, “path” : “/usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2”, “elfType” : 3, “buildId” : “F53E78DECA2C22259B2FD54DC32C9E3B010BBBF8” }, { “b” : “7FA3024CD000”, “path” : “/lib/x86_64-linux-gnu/libm.so.6”, “elfType” : 3, “buildId” : “1B288F3B11CB908F03FA568752126AD1AE3C6D1E” }, { “b” : “7FA3022B2000”, “path” : “/lib/x86_64-linux-gnu/libresolv.so.2”, “elfType” : 3, “buildId” : “9FCED6C1BB3F783375497F9C98FF2CF025ABBEBB” }, { “b” : “7FA302053000”, “path” : “/lib/x86_64-linux-gnu/libssl.so.1.0.0”, “elfType” : 3, “buildId” : “5BB10EACF0B497C21806AACAAF45C36328E831A3” }, { “b” : “7FA301E4B000”, “path” : “/lib/x86_64-linux-gnu/librt.so.1”, “elfType” : 3, “buildId” : “D27A253ACFC83E639AE80A606BBA2C058302D07A” }, { “b” : “7FA301C35000”, “path” : “/lib/x86_64-linux-gnu/libgcc_s.so.1”, “elfType” : 3, “buildId” : “36311B4457710AE5578C4BF00791DED7359DBB92” }, { “b” : “7FA301A17000”, “path” : “/lib/x86_64-linux-gnu/libpthread.so.0”, “elfType” : 3, “buildId” : “C4D728AC02A328301C070F5C220B826492273FCD” }, { “b” : “7FA30164E000”, “path” : “/lib/x86_64-linux-gnu/libc.so.6”, “elfType” : 3, “buildId” : “5A49BF8DEF435AC3FE9208DF3C6B5622FE347A97” }, { “b” : “7FA3046A6000”, “path” : “/lib64/ld-linux-x86-64.so.2”, “elfType” : 3, “buildId” : “2C5922FE5D8F6A77F42349579B5D9AF51E17C591” }, { “b” : “7FA30141B000”, “path” : “/usr/lib/x86_64-linux-gnu/libidn.so.11”, “elfType” : 3, “buildId” : “A4CF3D2F3AD65050A8199AFC54BD29893EE88902” }, { “b” : “7FA301201000”, “path” : “/usr/lib/x86_64-linux-gnu/librtmp.so.0”, “elfType” : 3, “buildId” : “B194D58FAD21CCFA9B4321CA687678D82B712994” }, { “b” : “7FA300FE8000”, “path” : “/lib/x86_64-linux-gnu/libz.so.1”, “elfType” : 3, “buildId” : “61ECB1C9E746126B3CCCC7E82705E539ECAEC3AB” }, { “b” : “7FA300C5F000”, “path” : “/usr/lib/libperl.so.5.18”, “elfType” : 3, “buildId” : “3B7B9ECBAD558BC0248513DA1FDFF1A9D1C0B8C2” }, { “b” : “7FA300A45000”, “path” : “/lib/x86_64-linux-gnu/libnsl.so.1”, “elfType” : 3, “buildId” : “313621B833833F024B472A4ADDB794FE9AE20188” }, { “b” : “7FA300807000”, “path” : “/usr/lib/x86_64-linux-gnu/libgssapi.so.3”, “elfType” : 3, “buildId” : “3DD3615C50982A067E390FC2443D7EF749ADAA4D” }, { “b” : “7FA300548000”, “path” : “/usr/lib/x86_64-linux-gnu/libgnutls.so.26”, “elfType” : 3, “buildId” : “31C8FF1B8CFAA077ECE92C00C11FCAB72272C5E2” }, { “b” : “7FA3002C8000”, “path” : “/lib/x86_64-linux-gnu/libgcrypt.so.11”, “elfType” : 3, “buildId” : “75E1DDBDFDD5DB837EC6E83928DB65A0A3CE4084” }, { “b” : “7FA2FFFFD000”, “path” : “/usr/lib/x86_64-linux-gnu/libkrb5.so.3”, “elfType” : 3, “buildId” : “35C054BECC0C5FB1AE9CDF7CDFA4F54089878BF0” }, { “b” : “7FA2FFDCE000”, “path” : “/usr/lib/x86_64-linux-gnu/libk5crypto.so.3”, “elfType” : 3, “buildId” : “0788D6F3B7675F5373F8D2F66D8284ADB7D2B7B7” }, { “b” : “7FA2FFBCA000”, “path” : “/lib/x86_64-linux-gnu/libcom_err.so.2”, “elfType” : 3, “buildId” : “8D56938ABD6462C4C29822D8E48A131BE1C61F6A” }, { “b” : “7FA2FF9BF000”, “path” : “/usr/lib/x86_64-linux-gnu/libkrb5support.so.0”, “elfType” : 3, “buildId” : “3D4F9028A10CC566F8CDC9FEFB09683B8A20FB92” }, { “b” : “7FA2FF786000”, “path” : “/lib/x86_64-linux-gnu/libcrypt.so.1”, “elfType” : 3, “buildId” : “8C9454C84B882A57EAA28D8F8D92F8D2C8B21A79” }, { “b” : “7FA2FF57D000”, “path” : “/usr/lib/x86_64-linux-gnu/libheimntlm.so.0”, “elfType” : 3, “buildId” : “F284B367B83FC07B7309FA086DC6634C9CC8A005” }, { “b” : “7FA2FF2F5000”, “path” : “/usr/lib/x86_64-linux-gnu/libkrb5.so.26”, “elfType” : 3, “buildId” : “7CC32240A00456FA57B74BFB922E31BA8EEF57C2” }, { “b” : “7FA2FF054000”, “path” : “/usr/lib/x86_64-linux-gnu/libasn1.so.8”, “elfType” : 3, “buildId” : “7CF4C34552B60E44902EA2DFCC4EE4906A90DE3C” }, { “b” : “7FA2FEE21000”, “path” : “/usr/lib/x86_64-linux-gnu/libhcrypto.so.4”, “elfType” : 3, “buildId” : “5F0EF0E1DDE5070F686668B93E6A9BEC44D83220” }, { “b” : “7FA2FEC0C000”, “path” : “/usr/lib/x86_64-linux-gnu/libroken.so.18”, “elfType” : 3, “buildId” : “DF1229739A9F5E6A9850B519C95D8A811B63B8EF” }, { “b” : “7FA2FE9F8000”, “path” : “/usr/lib/x86_64-linux-gnu/libtasn1.so.6”, “elfType” : 3, “buildId” : “1477FEC6F18A279343616F89650A2737E83358C0” }, { “b” : “7FA2FE7B6000”, “path” : “/usr/lib/x86_64-linux-gnu/libp11-kit.so.0”, “elfType” : 3, “buildId” : “D4B5C925023E4142D335EEFB6106F47245A3F97C” }, { “b” : “7FA2FE5B1000”, “path” : “/lib/x86_64-linux-gnu/libgpg-error.so.0”, “elfType” : 3, “buildId” : “38CA3EE1AE3847D38BF2F3ED9CA1A17FAC217CF7” }, { “b” : “7FA2FE3AD000”, “path” : “/lib/x86_64-linux-gnu/libkeyutils.so.1”, “elfType” : 3, “buildId” : “0F03635F97B93D3DACD84F0ED363C56BD266044F” }, { “b” : “7FA2FE184000”, “path” : “/usr/lib/x86_64-linux-gnu/libwind.so.0”, “elfType” : 3, “buildId” : “DBCF291C6CF70F0D0BF62F07347AEF28E040E1A5” }, { “b” : “7FA2FDF76000”, “path” : “/usr/lib/x86_64-linux-gnu/libheimbase.so.1”, “elfType” : 3, “buildId” : “F4FDBD38788250E843523FFEA869A4DA933B6BBC” }, { “b” : “7FA2FDD2D000”, “path” : “/usr/lib/x86_64-linux-gnu/libhx509.so.5”, “elfType” : 3, “buildId” : “C03FF77D3A35A40589C712C74A8597FF532C8ED7” }, { “b” : “7FA2FDA74000”, “path” : “/usr/lib/x86_64-linux-gnu/libsqlite3.so.0”, “elfType” : 3, “buildId” : “183703AF20E0C5BC50D86864CF0FA578F79564DB” }, { “b” : “7FA2FD86C000”, “path” : “/usr/lib/x86_64-linux-gnu/libffi.so.6”, “elfType” : 3, “buildId” : “C114D2C23BD2F3B1705F37FBF9CA06163C8B89A6” } ] }}
mongod(_ZN5mongo15printStackTraceERSo+0x41) [0x7fa306cd4ba1]
mongod(+0x2408DB9) [0x7fa306cd3db9]
mongod(+0x240929D) [0x7fa306cd429d]
libpthread.so.0(+0x10330) [0x7fa301a27330]
libc.so.6(gsignal+0x37) [0x7fa301684c37]
libc.so.6(abort+0x148) [0x7fa301688028]
mongod(_ZN5mongo22invariantFailedWithMsgEPKcS1_S1_j+0x0) [0x7fa305299f58]
mongod(_ZN5mongo20ServiceContextMongoD9_newOpCtxEPNS_6ClientEj+0x158) [0x7fa305489cc8]
mongod(_ZN5mongo14ServiceContext20makeOperationContextEPNS_6ClientE+0x41) [0x7fa306b50271]
mongod(_ZN5mongo6Client20makeOperationContextEv+0x27) [0x7fa306b4c357]
mongod(+0xA4C5D3) [0x7fa3053175d3]
mongod(+0x2404F65) [0x7fa306ccff65]
mongod(_ZN5mongo8shutdownENS_8ExitCodeERKNS_16ShutdownTaskArgsE+0x364) [0x7fa30529b131]
mongod(_ZZN5mongo13duration_castINS_8DurationISt5ratioILl1ELl1000EEEES2_ILl1ELl1EEEET_RKNS1_IT0_EEENKUlvE_clEv+0x0) [0x7fa30522e70c]
mongod(ZN5mongo11mongoDbMainEiPPcS1+0x87A) [0x7fa30531ef5a]
mongod(main+0x9) [0x7fa30529c089]
libc.so.6(__libc_start_main+0xF5) [0x7fa30166ff45]
mongod(+0xA3C0CF) [0x7fa3053070cf]
----- END BACKTRACE -----
Aborted (core dumped)
vagrant@m103:~$

You got

All directories must exist and be writable by user vagrant.

Ok I think I understand what went wrong. I have already created the var directory. Is it possible that I made it not writable? How can I remove or change the directory?

The message says /var/mongodb/db/ is not not found. Having create var is not sufficient.

You may change the owner of a directory with chown vagrant.vagrant path-of-the-directory.

Hi @Devin_22245,

Can you please confirm that your issue has been resolved ?

Thanks,
Shubham Ranjan
Curriculum Services Engineer