title: Mongo::Error::NoServerAvailable: No primary server is available in cluster
body: <p>I am getting the following error when deploying to production environment (via gitlab):</p>
  
  <pre><code>Mongo::Error::NoServerAvailable: No primary server is available in cluster: 
  #&lt;Cluster topology=
     ReplicaSetNoPrimary[url1:27017,url2:27017,url3:27017,url4:27017,url5:27017,name=mobile01] 
     servers=[
       #&lt;Server address=url1:27017 UNKNOWN&gt;,
       #&lt;Server address=url2:27017 UNKNOWN&gt;,
       #&lt;Server address=url3:27017 UNKNOWN&gt;,
       #&lt;Server address=url4:27017 UNKNOWN&gt;,
       #&lt;Server address=url5:27017 UNKNOWN&gt;]&gt; with timeout=30, LT=0.015
  </code></pre>
  
  <p>I have been trying to reproduce the error locally in a rails console, here is the configuration I have:</p>
  
  <pre><code>ap Mongoid.client(:default).instance_values
  {
    "srv_records" =&gt; nil,
      "options" =&gt; {
          "database" =&gt; "mydb",
          "auth_source" =&gt; "admin",
          "retry_reads" =&gt; true,
          "retry_writes" =&gt; true,
          "user" =&gt; "rp_projects",
          "password" =&gt; "xxxxxxxxxxxxxxxxx",
          "ssl" =&gt; true,
          "replica_set" =&gt; "mobile01",
          "connect" =&gt; :replica_set,
          "platform" =&gt; "mongoid-7.0.5"
     },
     "database" =&gt; #&lt;Mongo::Database:0x70156564542240 name=mydb&gt;,
     "cluster" =&gt; #&lt;Mongo::Cluster:0x70156564540720 servers=[] 
                     topology=
                     ReplicaSetNoPrimary[url1:27017,url2:27017,url3:27017,url4:27017,url5:27017,
                     name=mobile01]&gt;
  }
  </code></pre>
  
  <p>The server is running in a docker image. Am I missing something in the configuration? What should I look for here?</p>