I am working on installing mongodb on remote server I managed to install everything and tested it.

But when I tried to enable fork mode to make it run in the background via the command

mongod --config mongod.config


 destination: file
 path: "etc/mongod.log"
 logAppend: true
 dbPath: "/home/peter/data/db"
  enabled: false
 fork: true
 port: 27017
 enableLocalhostAuthBypass: false

this command is run successfully but when trying to run mongo I get this error

MongoDB shell version v3.4.9
connecting to: mongodb://
2017-09-30T01:31:07.048-0700 I -        [thread1] Invariant failure !driverName.empty() && !driverVersion.empty() && !osType.empty() && !osName.empty() && !osArchitecture.empty() && !osVersion.empty() src/mongo/rpc/metadata/client_metadata.cpp 350
2017-09-30T01:31:07.048-0700 I -        [thread1] 

***aborting after invariant() failure

2017-09-30T01:31:08.207-0700 F -        [thread1] Got signal: 6 (Aborted).

Note: everything is working fine without fork mode

Any help will be appreciated.


log file

2017-10-01T08:07:05.786-0700 I CONTROL  [initandlisten] MongoDB starting : pid=488699 port=27017 dbpath=/home/peterw3/data/db 64-bit h$
2017-10-01T08:07:05.787-0700 I CONTROL  [initandlisten] db version v3.4.9
2017-10-01T08:07:05.787-0700 I CONTROL  [initandlisten] git version: 876ebee8c7dd0e2d992f36a848ff4dc50ee6603e
2017-10-01T08:07:05.787-0700 I CONTROL  [initandlisten] allocator: tcmalloc
2017-10-01T08:07:05.787-0700 I CONTROL  [initandlisten] modules: none
2017-10-01T08:07:05.787-0700 I CONTROL  [initandlisten] build environment:
2017-10-01T08:07:05.787-0700 I CONTROL  [initandlisten]     distarch: x86_64
2017-10-01T08:07:05.787-0700 I CONTROL  [initandlisten]     target_arch: x86_64
2017-10-01T08:07:05.787-0700 I CONTROL  [initandlisten] options: { config: "etc/mongod.conf", net: { bindIp: "", port: 27017 $
2017-10-01T08:07:05.813-0700 I -        [initandlisten] Detected data files in /home/peterw3/data/db created by the 'wiredTiger' stora$
2017-10-01T08:07:05.813-0700 I STORAGE  [initandlisten]
2017-10-01T08:07:05.813-0700 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTig$
2017-10-01T08:07:05.813-0700 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2017-10-01T08:07:05.813-0700 I STORAGE  [initandlisten] Detected WT journal files.  Running recovery from last checkpoint.
2017-10-01T08:07:05.813-0700 I STORAGE  [initandlisten] journal to nojournal transition config: create,cache_size=15451M,session_max=2$
2017-10-01T08:07:05.914-0700 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=15451M,session_max=20000,eviction=(t$
2017-10-01T08:07:05.994-0700 I CONTROL  [initandlisten]
2017-10-01T08:07:05.994-0700 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-10-01T08:07:05.994-0700 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-10-01T08:07:05.994-0700 I CONTROL  [initandlisten]
2017-10-01T08:07:06.003-0700 W FTDC     [initandlisten] Error checking directory '/sys/block': No such file or directory
2017-10-01T08:07:06.003-0700 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/home/peterw3/d$
2017-10-01T08:07:06.005-0700 I NETWORK  [thread1] waiting for connections on port 27017
2017-10-01T08:07:10.193-0700 I NETWORK  [thread1] connection accepted from #1 (1 connection now open)
2017-10-01T08:07:10.209-0700 I -        [conn1] end connection (1 connection now open)

Use full path with path and dbPath. So, both "should" start with /. When you are in fork, there is no "base" directory.

|improve this answer|||||
  • thanks for your reply, but unfortunately it didn't work after I changed the path to absolute path, still the same error – Peter Wilson Oct 1 '17 at 14:34
  • Have you checked what mongod.log says about this connection attempt? – JJussi Oct 1 '17 at 17:36
  • kindly check log file output I added it in the original question – Peter Wilson Oct 1 '17 at 19:25
  • So, there is no error message about connection. One "strange" thing is in the config.. That "enableLocalhostAuthBypass: false", may I ask what is reason to it? Because you haven' t enabled authentication in your config. – JJussi Oct 1 '17 at 21:09
  • no reason for that I just copied the config file from an example so I didn't change it, but anyway I tried to remove it but still the same result – Peter Wilson Oct 2 '17 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.