Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1750

Two-part hostname requirement error message is confusing

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Dev Exp
    • Labels:
      None

      https://github.com/mongodb/specifications/blob/master/source/initial-dns-seedlist-discovery/initial-dns-seedlist-discovery.rst#seedlist-discovery has this language:

      > A driver MUST verify that in addition to the {hostname}, the {domainname} consists of at least two parts: the domain name, and a TLD. 
      

      It makes sense in the spec, but when copied to an exception message, it becomes confusing:

      irb(main):002:0> a=Mongo::Client.new('mongodb+srv://hai.xx')
      
      Mongo::Error::InvalidURI (Bad URI: mongodb+srv://hai.xx)
      The domain name must consist of at least two parts: the domain name, and a TLD.
      MongoDB URI must be in the following format: mongodb+srv://[username:password@]host[/[database][?options]]
      Please see the following URL for more information: http://docs.mongodb.org/manual/reference/connection-string/
      

      From the user's perspective,`hai.xx` is a domain name, it has two parts, a domain name and a TLD.

      A better error message would state the requirement of 3 total parts, similar to:

      > The domain name must consist of at least three parts (e.g. host.domain.tld).

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: