Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9383

Unix domain socket is not created if bind_ip does not include 127.0.0.1

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.9
    • Affects Version/s: 2.2.4, 2.4.1, 2.6.4, 2.7.6
    • Component/s: Usability
    • None
    • Fully Compatible
    • ALL
    • Platforms 2017-06-19, Platforms 2017-07-10

      If you use --bind_ip without including the loopback IP address (127.0.0.1) this also has the unexpected side effect of not creating a unix domain socket. Expected behaviour is that a unix socket should still be created unless --nounixsocket was specified.

      There is currently (as at 2.2.4/2.4.1) an explicit assumption in the code so the socket is only created if listening to the loopback or "any" IP: https://github.com/mongodb/mongo/blob/r2.2.4/src/mongo/util/net/listen.cpp#L91

      The unix domain socket is required for initial set up of users when a node has been started with authentication enabled and an admin needs to connect to the DB as a "local" user without authentication.

      A potential workaround until this is fixed is to include the loopback IP in the bind_ip list (which supports multiple values with a comma), eg:

      mongod --bind_ip 192.168.1.2,127.0.0.1
      

            Assignee:
            jonathan.reams@mongodb.com Jonathan Reams
            Reporter:
            stephen.steneker@mongodb.com Stennie Steneker (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: