Uploaded image for project: 'PHP Legacy Driver'
  1. PHP Legacy Driver
  2. PHP-1534

php_network_getaddresses: getaddrinfo failed: Name or service not known

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 1.6.16
    • Fix Version/s: None
    • Component/s: pecl-mongo
    • Labels:
      None
    • Environment:
      PHP 5.4.45
      Pecl Mongo 1.6.16
      Mongo Server v3.4.13
      Replication Set
      Amazon Linux AMI release 2016.09
    • # Replies:
      9
    • Last comment by Customer:
      true

      Description

      This bug is relative to the latest drivers for PHP5.4 + Pecl Mongo 1.6.16.

      We have two replica servers that are directly open to each other's ports with no authentication due to the internal access only, the connection looks like this:

      $this->db = new MongoClient("mongodb://usa.x.com:27017,mongodb://london.y.com:27017?replicaSet=rs0&readPreference=nearest");

      In the hosts file we hardcode:
      X.177.Y.Z london.y.com
      127.0.0.1 usa.x.com

      Randomly we will get this error, but not always:

      Uncaught exception 'MongoConnectionException' with message 'MongoCollection::findOne(): php_network_getaddresses: getaddrinfo failed: Name or service not known

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              mknwebsolutions Michael Mikhjian
              Participants:
              Last commenter:
              Michael Mikhjian
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                2 years, 25 weeks, 2 days ago
                Date of 1st Reply: