Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1761

Report invalid SRV records

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.9
    • Affects Version/s: None
    • Component/s: None
    • None

      I made a test1.mdb.bsdpower.com host with two SRV records, one of which is valid (foo.test1.mdb.bsdpower.com) and one which is not (hhhh).

      The driver rejects such a SRV URI but does not report which record it rejected, creating a suboptimal user experience:

      >>> pymongo.MongoClient('mongodb+srv://test1.mdb.bsdpower.com')
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "pymongo/mongo_client.py", line 514, in __init__
          res = uri_parser.parse_uri(entity, port, warn=True)
        File "pymongo/uri_parser.py", line 414, in parse_uri
          raise ConfigurationError("Invalid SRV host")
      pymongo.errors.ConfigurationError: Invalid SRV host
      

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

              Created:
              Updated:
              Resolved: