Error trying to connect mongo first time
During first time of connection with mongo, if this fail, it does not try to reconnect. We still dont have a perfect way of managing connections and reconnnections with mongo, as we see in this other issue.
A solution, by the moment.... if first time cannot connect is better to exit. To use other ways of having the process always up to have a reconnection. For example, containers can be configured to be re-launched if something goes wrong. In that way, after a couple of tries if will connect with the ddbb (maybe down, becuase of running everything first time and it is not ready yet).