Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mongod command on linux(ubuntu) spits out random messages

mongod command on linux(ubuntu) spits out random messages and mongo refuses to connect with 127.0.0.1:27017

Message on terminal

{"t":{"$date":"2020-08-20T22:33:58.002+05:30"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2020-08-20T22:33:58.005+05:30"},"s":"W",  "c":"ASIO",     "id":22601,   "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
{"t":{"$date":"2020-08-20T22:33:58.005+05:30"},"s":"I",  "c":"NETWORK",  "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
{"t":{"$date":"2020-08-20T22:33:58.005+05:30"},"s":"I",  "c":"STORAGE",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":17540,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"AmrutheshwarO"}}
{"t":{"$date":"2020-08-20T22:33:58.005+05:30"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.0","gitVersion":"563487e100c4215e2dce98d0af2a6a5a2d67c5cf","openSSLVersion":"OpenSSL 1.1.1f  31 Mar 2020","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2004","distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2020-08-20T22:33:58.005+05:30"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"20.04"}}}
{"t":{"$date":"2020-08-20T22:33:58.005+05:30"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{}}}
{"t":{"$date":"2020-08-20T22:33:58.006+05:30"},"s":"E",  "c":"NETWORK",  "id":23024,   "ctx":"initandlisten","msg":"Failed to unlink socket file","attr":{"path":"/tmp/mongodb-27017.sock","error":"Operation not permitted"}}
{"t":{"$date":"2020-08-20T22:33:58.006+05:30"},"s":"F",  "c":"-",        "id":23091,   "ctx":"initandlisten","msg":"Fatal assertion","attr":{"msgid":40486,"file":"src/mongo/transport/transport_layer_asio.cpp","line":919}}
{"t":{"$date":"2020-08-20T22:33:58.006+05:30"},"s":"F",  "c":"-",        "id":23092,   "ctx":"initandlisten","msg":"\n\n***aborting after fassert() failure\n\n"}

while running mongo subsequently on terminal (I run this command on a different terminal window)

MongoDB shell version v4.4.0
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:362:17
@(connect):2:6
exception: connect failed
exiting with code 1

My mongodb version is

db version v4.4.0
Build Info: {
    "version": "4.4.0",
    "gitVersion": "563487e100c4215e2dce98d0af2a6a5a2d67c5cf",
    "openSSLVersion": "OpenSSL 1.1.1f  31 Mar 2020",
    "modules": [],
    "allocator": "tcmalloc",
    "environment": {
        "distmod": "ubuntu2004",
        "distarch": "x86_64",
        "target_arch": "x86_64"
    }
}```

like image 614
Amrutheshwar O Avatar asked Aug 20 '20 17:08

Amrutheshwar O


1 Answers

I ran into the same problem. Deleting /tmp/mongodb-27017.sock should fix it.

You can see in the logs it fails to remove it:

{
  "t": {
    "$date": "2020-08-20T22:33:58.006+05:30"
  },
  "s": "E",
  "c": "NETWORK",
  "id": 23024,
  "ctx": "initandlisten",
  "msg": "Failed to unlink socket file",
  "attr": {
    "path": "/tmp/mongodb-27017.sock",
    "error": "Operation not permitted"
  }
}
like image 153
Dillon Wiggins Avatar answered Nov 15 '22 23:11

Dillon Wiggins