title: Mongod.service not found => Pop from an empty deque => Authentication failed
body: <p><br><hr></p>
  <h1>The Problem</h1>
  <p><strong>I'm getting started with <code>MongoDB</code> on <code>Python</code>, I have a <code>Ubuntu</code> machine in my <code>local network</code> and <code>MongoDB</code> is installed there. When I try to connect with database using <code>Python</code> from <code>Mac</code> it throughs me an error. I searched about it and found out there is a <code>.service</code> called <code>mongod.service</code> that needs to be started along with <code>mongodb.service</code>. But when I try to start the <code>mongod.service</code> the it says the <code>.service</code> doesn't even exist. I tried both with IP and mongodb url, nothing works.</strong></p>
  <h1>Ubuntu Terminal</h1>
  <pre><code>$ sudo service mongod start
  $ Failed to start mongod.service: Unit mongod.service not found.
  $ sudo systemctl start mongod
  $ Failed to start mongod.service: Unit mongod.service not found.
  </code></pre>
  <p><br><hr></p>
  <h1>DataBase Link (a)</h1>
  <pre><code>mongodb://user:password@192.168.0.106/database
  </code></pre>
  <h1>Python Script (a)</h1>
  <pre><code>#!/usr/bin/env python3
  
  from pymongo import MongoClient
  
  client = MongoClient('mongodb://user:password@192.168.0.106/database')
  
  db = client['database']
  
  collection = db['collection']
  
  json = dict(message='hello world', token=0)
  
  collection.insert_one(json)
  </code></pre>
  <h1>macOS Terminal (a)</h1>
  <pre><code>pymongo.errors.ServerSelectionTimeoutError: 192.168.0.106:27017: [Errno 61] Connection refused, Timeout: 30s, Topology Description: &lt;TopologyDescription id: 60e140982a43032aef0dd634, topology_type: Single, servers: [&lt;ServerDescription ('192.168.0.106', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('192.168.0.106:27017: [Errno 61] Connection refused')&gt;]&gt;
  </code></pre>
  <p><br><hr></p>
  <h1>DataBase Link (b)</h1>
  <pre><code>mongodb+srv://user:password@cluster0.h9fmz.mongodb.net/database?retryWrites=true&amp;w=majority
  </code></pre>
  <h1>Python Script (b)</h1>
  <pre><code>#!/usr/bin/env python3
  
  from pymongo import MongoClient
  
  client = MongoClient('mongodb+srv://user:password@cluster0.h9fmz.mongodb.net/database?retryWrites=true&amp;w=majority')
  
  db = client['database']
  
  collection = db['collection']
  
  json = dict(message='hello world', token=0)
  
  collection.insert_one(json)
  </code></pre>
  <h1>macOS Terminal (b)</h1>
  <pre><code>Traceback (most recent call last):
    File &quot;/usr/local/lib/python3.9/site-packages/pymongo/pool.py&quot;, line 1278, in _get_socket
      sock_info = self.sockets.popleft()
  IndexError: pop from an empty deque
  
  During handling of the above exception, another exception occurred:
  .....
  .....
  .....
  pymongo.errors.OperationFailure: bad auth : Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth : Authentication failed.', 'code': 8000, 'codeName': 'AtlasError'}
  </code></pre>
  <p><br><hr></p>
  <h1>Note That</h1>
  <ul>
  <li><strong>I'm providing the correct username and password for the database.</strong></li>
  <li><strong>I'm using a machine on my local network, which is not a live server.</strong></li>
  <li><strong>I've also tried the following commands but they did not solve anything.</strong></li>
  </ul>
  <h1>Ubuntu Terminal</h1>
  <pre><code>$ mongod --auth --port 27017
  $ mongod --port 27017
  $ sudo rm /var/lib/mongodb/mongod.lock
  $ sudo mongod --repair
  </code></pre>
  <p><br><hr></p>