Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1422

mongosh fails to connect to mongodb unix domain socket, if mongod is forked

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Minor - P4 Minor - P4
    • No version
    • Affects Version/s: None
    • Component/s: CLI Module
    • None
    • Environment:
      OS: Fedora 37 server
      node.js / npm versions: v18.15.0 / 9.5.0
      Additional info: Installed vie 9Server repo
    • Not Needed

      Problem Statement/Rationale

      If the mongod process is started with the mongod.conf including

      processManagement: fork: true 

      mongosh does not connect, it returns with an error.{}

      Steps to Reproduce

      Install and start mongod, with fork: true option, and run mongosh. 

      Expected Results

      mongosh should connect to the Unix domain socket just fine.

      Actual Results, the error:

      Current Mongosh Log ID: 64232c30d3a5196d9094ad1e

      Connecting to: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.8.0

      MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017

      Additional Notes, the mongod.conf

      1. where to write logging data.

      systemLog:

        destination: file

        logAppend: true

        path: /var/log/mongodb/mongod.log

       

      1. Where and how to store data.

      storage:

        dbPath: /var/lib/mongo

        journal:

          enabled: true

      #  engine:

        wiredTiger:

           engineConfig:

              cacheSizeGB: 4

       

      1. how the process runs

      processManagement:

        fork: true  # fork and run in background

        pidFilePath: /var/run/mongodb/mongod.pid  # location of pidfile

        timeZoneInfo: /usr/share/zoneinfo

       

      1. network interfaces

      net:

        port: 27017

        bindIp: 127.0.0.1  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.

        unixDomainSocket:

          enabled: true

          pathPrefix: /tmp

          filePermissions: 0666

            Assignee:
            Unassigned Unassigned
            Reporter:
            laking@d250.hu István Király
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: