title: Querying a mongo DB causes Heroku timeout?
body: <p>I'm using a simple node app with an express server and attempting to deploy it to heroku and a single query to the database causes my app to crash with an H13 error after about 10 seconds. The error says it closed without response.</p>
  <p>crash logs:</p>
  <pre><code>2022-06-20T04:01:55.992187+00:00 app[web.1]: const err = new MongooseError(message);      
  2022-06-20T04:01:55.992188+00:00 app[web.1]: ^
  2022-06-20T04:01:55.992189+00:00 app[web.1]:
  2022-06-20T04:01:55.992190+00:00 app[web.1]: MongooseError: Operation `classifications.findOne()` bufdOne()` buffering timed out after 10000ms
  2022-06-20T04:01:55.992191+00:00 app[web.1]: at Timeout.&lt;anonymous&gt; (/app/node_modules/mongoose/lib/dgoose/lib/drivers/node-mongodb-native/collection.js:151:23)
  2022-06-20T04:01:55.992191+00:00 app[web.1]: at listOnTimeout (node:internal/timers:559:17))                                                                                         2022-06-20T
  2022-06-20T04:01:55.992192+00:00 app[web.1]: at processTimers (node:internal/timers:502:7)2022-06-20T04:01:55.992196+00:00 app[web.1]:
  2022-06-20T04:01:55.992197+00:00 app[web.1]: Node.js v17.7.2                               without re
  2022-06-20T04:01:56.002582+00:00 heroku[router]: at=error code=H13 desc=&quot;Connection closed728b0fb8-d2 without response&quot; method=GET path=&quot;/al/classes/class-1a&quot; host=wcsn-backend.herokuapp.com s=503 bytes
  request_id=728b0fb8-d2bf-44f4-ae5c-793401a76653 fwd=&quot;216.198.98.78&quot; dyno=web.1 connect=0ms service=10015ms status=503 bytes=0 protocol=https
  2022-06-20T04:01:56.161890+00:00 heroku[web.1]: Process exited with status 1
  2022-06-20T04:01:56.253251+00:00 heroku[web.1]: State changed from up to crashed
  </code></pre>
  <p>The entire code can be found <a href="https://i.stack.imgur.com/CO9RS.png" rel="nofollow noreferrer">here</a>.</p>
  <p>or here with omitted commented out code:</p>
  <pre><code>server.get('/:state/:classification/:className', async (req, res) =&gt; {
    let className = req.params.className.replaceAll('-', ' ');
    className = className.replaceAll('/', ' ');
    const { url } = await classificationsModel.findOne(
      {
        name: className.toLowerCase(),
        associatedState: req.params.state.toUpperCase(),
      },
      { url: 1, _id: 0 }
    );
    console.log(url);
    res.json('hello world');
    teamList = [];
  });
  </code></pre>
  <p>Again locally <a href="https://i.stack.imgur.com/O9yRY.png" rel="nofollow noreferrer">this</a> is produced in the console and 'hello world' is returned as json. Why is it different on heroku and how can I fix it?</p>