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

When given an invalid address, client connects to localhost

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 3.5.1
    • Shell
    • None
    • ALL
    • Platforms 2017-01-23

    Description

      When connecting using mongo client (command line, windows), if the address given is invalid, mongo client will connect to localhost instance, without giving any errors. This happens if you provide only a part of the server full URI. Example:

      mongo myserver -> connects to localhost, no error message. nslookup myserver returns server ip address, not mine.

      mongo myserver.fulldomain.com -> connects to myserver correctly.

      Not sure if it's a bug or it's by design (a previously taken decision), and I wasn't able to find anything on the matter. If it's by design I'd vote to change this to improvement and ask for a warning message (someone might really think they are acting on 'myserver' when it's acting on 'localhost' really - and if both localhost and myserver belongs to the same replicaSet, the prompt will be the same 'replicaSetName:SECONDARY').

      Attachments

        Activity

          People

            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            marconi Guilherme Marconi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: