Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4747

localhost/127.0.0.1 test failures in default configuration

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

      I followed the default testing instructions with this command:

      bundle exec rspec ./spec/mongoid/clients/factory_spec.rb 

      which produced these errors:

      [mongoid] Warning: No private key present, creating unsigned gem.
      W, [2019-05-30T10:44:33.568925 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017                                                            |  ETA: ??:??:?? 
      W, [2019-05-30T10:44:33.599410 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017
      W, [2019-05-30T10:44:34.397726 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017
      W, [2019-05-30T10:44:34.428548 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017                                                            |  ETA: 00:00:20 
                                                                                                                                                                                                                           
        1) Mongoid::Clients::Factory.create when provided a name when the configuration exists when the configuration is standard sets the cluster's seeds
           Failure/Error: expect(cluster.addresses.first.to_s).to eq(SpecConfig.instance.addresses.first)
           
             expected: "127.0.0.1"
                  got: "localhost:27017"
           
             (compared using ==)
           # ./spec/mongoid/clients/factory_spec.rb:43:in `block (6 levels) in <top (required)>'
      
      
      W, [2019-05-30T10:44:34.497797 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017                                                            |  ETA: 00:00:10 
      W, [2019-05-30T10:44:34.528413 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017                                                            |  ETA: 00:00:06 
      W, [2019-05-30T10:44:34.564141 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017                                                            |  ETA: 00:00:05 
      W, [2019-05-30T10:44:34.603024 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017                                                            |  ETA: 00:00:04 
      W, [2019-05-30T10:44:34.644992 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017                                                            |  ETA: 00:00:03 
      W, [2019-05-30T10:44:34.678176 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017                                                            |  ETA: 00:00:02 
      W, [2019-05-30T10:44:34.707412 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017                                                            |  ETA: 00:00:02 
      W, [2019-05-30T10:44:34.745842 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017                                                            |  ETA: 00:00:01 
      W, [2019-05-30T10:44:34.759777 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017                                                            |  ETA: 00:00:01 
      W, [2019-05-30T10:44:34.769936 #1660]  WARN -- : Retrying ismaster on localhost:27017 due to: Mongo::Error::SocketError IOError: closed stream (for 127.0.0.1:27017 (no TLS))
                                                                                                                                                                                                                           
        2) Mongoid::Clients::Factory.create when no name is provided sets the cluster's addresses
           Failure/Error: expect(cluster_addresses).to include(address)
             expected ["localhost:27017", "localhost:27018", "localhost:27019"] to include "127.0.0.1"
           # ./spec/mongoid/clients/factory_spec.rb:215:in `block (5 levels) in <top (required)>'
           # ./spec/mongoid/clients/factory_spec.rb:214:in `each'
           # ./spec/mongoid/clients/factory_spec.rb:214:in `block (4 levels) in <top (required)>'
      
      
      W, [2019-05-30T10:44:34.779477 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017                                                            |  ETA: 00:00:01 
      W, [2019-05-30T10:44:34.787347 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017======>                                                     |  ETA: 00:00:00 
      W, [2019-05-30T10:44:34.791570 #1660]  WARN -- : Retrying ismaster on localhost:27017 due to: Mongo::Error::SocketError IOError: stream closed in another thread (for 127.0.0.1:27017 (no TLS))
                                                                                                                                                                                                                           
        3) Mongoid::Clients::Factory.default sets the cluster's addresses
           Failure/Error: expect(cluster_addresses).to include(address)
             expected ["localhost:27017", "localhost:27018", "localhost:27019"] to include "127.0.0.1"
           # ./spec/mongoid/clients/factory_spec.rb:266:in `block (4 levels) in <top (required)>'
           # ./spec/mongoid/clients/factory_spec.rb:265:in `each'
           # ./spec/mongoid/clients/factory_spec.rb:265:in `block (3 levels) in <top (required)>'
      
      
      W, [2019-05-30T10:44:34.796460 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017
      W, [2019-05-30T10:44:34.803888 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017=======================>                                    |  ETA: 00:00:00 
      W, [2019-05-30T10:44:34.807437 #1660]  WARN -- : Retrying ismaster on localhost:27017 due to: Mongo::Error::SocketError IOError: stream closed in another thread (for 127.0.0.1:27017 (no TLS))
                                                                                                                                                                                                                           
        4) Mongoid::Clients::Factory when options are provided with string keys sets the cluster's addresses
           Failure/Error: expect(cluster_addresses).to include(address)
             expected ["localhost:27017", "localhost:27018", "localhost:27019"] to include "127.0.0.1"
           # ./spec/mongoid/clients/factory_spec.rb:312:in `block (4 levels) in <top (required)>'
           # ./spec/mongoid/clients/factory_spec.rb:311:in `each'
           # ./spec/mongoid/clients/factory_spec.rb:311:in `block (3 levels) in <top (required)>'
      
      
      W, [2019-05-30T10:44:34.811712 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017
      W, [2019-05-30T10:44:34.818740 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017========================================>                   |  ETA: 00:00:00 
      W, [2019-05-30T10:44:34.825801 #1660]  WARN -- : MONGODB | Removing server 127.0.0.1:27017 because it reported itself as localhost:27017
      W, [2019-05-30T10:44:34.829163 #1660]  WARN -- : Retrying ismaster on localhost:27017 due to: Mongo::Error::SocketError IOError: closed stream (for 127.0.0.1:27017 (no TLS))
       22/22 |=========================================================================================== 100 ===========================================================================================>| Time: 00:00:01 
      
      
      Finished in 1.27 seconds (files took 0.86286 seconds to load)
      22 examples, 4 failures
      
      
      Failed examples:
      
      
      rspec ./spec/mongoid/clients/factory_spec.rb:42 # Mongoid::Clients::Factory.create when provided a name when the configuration exists when the configuration is standard sets the cluster's seeds
      rspec ./spec/mongoid/clients/factory_spec.rb:213 # Mongoid::Clients::Factory.create when no name is provided sets the cluster's addresses
      rspec ./spec/mongoid/clients/factory_spec.rb:264 # Mongoid::Clients::Factory.default sets the cluster's addresses
      rspec ./spec/mongoid/clients/factory_spec.rb:310 # Mongoid::Clients::Factory when options are provided with string keys sets the cluster's addresses 

       

      It's possible that the cluster is configured to refer to node hosts as "127.0.0.1" and not as "localhost."

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

              Created:
              Updated:
              Resolved: