# MongoServerSelectionError

**URL:** <https://forums.rocket.chat/t/mongoserverselectionerror/17931>\
**Category:** Community Support\
**Created:** [October 2, 2023, 5:26pm UTC](https://forums.rocket.chat/t/mongoserverselectionerror/17931 "2023-10-02T17:26:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nick.phelps](https://avatars.discourse-cdn.com/v4/letter/n/5f9b8f/32.png) [@nick.phelps](https://forums.rocket.chat/u/nick.phelps)\
**Post date:** [October 2, 2023, 5:26pm UTC](https://forums.rocket.chat/t/mongoserverselectionerror/17931/1 "2023-10-02T17:26:01Z")

</div>

### Description

BLUF: This is my first time working with Docker so my question may be basic.

I am attempting to gradually upgrade Rocket Chat from v3.18.2 to the latest. I have successfully dockerized the deployment and migrated the database into the dockerized mongodb container using the Rocket Chat directions. I have even managed to upgrade from v3.18.2 to 4.4.0.

The issue arises when I attempt to go from 4.4.0 → 4.5.0. I get a MongoServerSelectionError: getaddrinfo ENOTFOUND mongodb error.

Please note that I’m aware the NodeJS version is not what it needs to be, however, I was under the impression that when I change the version in the .env that it would pull the correct image. If this is not true, please let me know how I should update NodeJS within the container.

Additionally, I’m not sure if it matters, however, I am using a local mongodb container, I do not have a Mongo Atlas account.

### Server Setup Information

- Version of Rocket.Chat Server: 4.5.0
- Operating System: CentOS
- Deployment Method: Docker Compose
- Number of Running Instances: 1
- NodeJS Version: 14.18.2
- MongoDB Version: 5.0.21
- Proxy: nginx

### Any additional Information

```auto
rocketchat-rocketchat-1 | /app/bundle/programs/server/node_modules/fibers/future.js:313
rocketchat-rocketchat-1 | throw(ex);
rocketchat-rocketchat-1 | ^
rocketchat-rocketchat-1 |
rocketchat-rocketchat-1 |
rocketchat-rocketchat-1 | MongoServerSelectionError: getaddrinfo ENOTFOUND mongodb
rocketchat-rocketchat-1 | at Timeout._onTimeout (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/topology.js:437:30)
rocketchat-rocketchat-1 | at listOnTimeout (internal/timers.js:557:17)
rocketchat-rocketchat-1 | at processTimers (internal/timers.js:500:7) {
rocketchat-rocketchat-1 | reason: TopologyDescription {
rocketchat-rocketchat-1 | type: 'ReplicaSetNoPrimary',
rocketchat-rocketchat-1 | setName: null,
rocketchat-rocketchat-1 | maxSetVersion: null,
rocketchat-rocketchat-1 | maxElectionId: null,
rocketchat-rocketchat-1 | servers: Map(1) {
rocketchat-rocketchat-1 | 'mongodb:27017' => ServerDescription {
rocketchat-rocketchat-1 | address: 'mongodb:27017',
rocketchat-rocketchat-1 | error: Error: getaddrinfo ENOTFOUND mongodb
rocketchat-rocketchat-1 | at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:71:26) {
rocketchat-rocketchat-1 | name: 'MongoNetworkError'
rocketchat-rocketchat-1 | },
rocketchat-rocketchat-1 | roundTripTime: -1,
rocketchat-rocketchat-1 | lastUpdateTime: 497663426,
rocketchat-rocketchat-1 | lastWriteDate: null,
rocketchat-rocketchat-1 | opTime: null,
rocketchat-rocketchat-1 | type: 'Unknown',
rocketchat-rocketchat-1 | topologyVersion: undefined,
rocketchat-rocketchat-1 | minWireVersion: 0,
rocketchat-rocketchat-1 | maxWireVersion: 0,
rocketchat-rocketchat-1 | hosts: [],
rocketchat-rocketchat-1 | passives: [],
rocketchat-rocketchat-1 | arbiters: [],
rocketchat-rocketchat-1 | tags: []
rocketchat-rocketchat-1 | }
rocketchat-rocketchat-1 | },
rocketchat-rocketchat-1 | stale: false,
rocketchat-rocketchat-1 | compatible: true,
rocketchat-rocketchat-1 | compatibilityError: null,
rocketchat-rocketchat-1 | logicalSessionTimeoutMinutes: null,
rocketchat-rocketchat-1 | heartbeatFrequencyMS: 10000,
rocketchat-rocketchat-1 | localThresholdMS: 15,
rocketchat-rocketchat-1 | commonWireVersion: null
rocketchat-rocketchat-1 | }
rocketchat-rocketchat-1 | }
rocketchat-rocketchat-1 exited with code 0

```

---

<div class="post-metadata">

**Author:** ![nick.phelps](https://avatars.discourse-cdn.com/v4/letter/n/5f9b8f/32.png) [@nick.phelps](https://forums.rocket.chat/u/nick.phelps)\
**Post date:** [October 2, 2023, 9:36pm UTC](https://forums.rocket.chat/t/mongoserverselectionerror/17931/2 "2023-10-02T21:36:01Z")

</div>

> [@nick.phelps](#):
>
> ```auto
> MongoServerSelectionError: getaddrinfo ENOTFOUND mongodb
> rocketchat-rocketchat-1 | at Timeout._onTimeout (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/topology.js:437:30)
> 
> ```

**UPDATE**

When attempting to run the command

```auto
docker exec -it rocketchat-mongodb-1 bash

```

I get the response `Error response from daemon: Container 1ecfef760f2a6beac951443b6b29314864a91f47c279266f385da538cc4963c9 is restarting, wait until the container is running`

Tailing the mongodb logs results in the following messages:

```auto
rocketchat-mongodb-1 | mongodb 21:07:33.88 Welcome to the Bitnami mongodb container
rocketchat-mongodb-1 | mongodb 21:07:33.88 Subscribe to project updates by watching https://github.com/bitnami/containers
rocketchat-mongodb-1 | mongodb 21:07:33.88 Submit issues and feature requests at https://github.com/bitnami/containers/issues
rocketchat-mongodb-1 | mongodb 21:07:33.89
rocketchat-mongodb-1 | mongodb 21:07:33.89 INFO ==> **Starting MongoDB setup**
rocketchat-mongodb-1 | mongodb 21:07:33.94 INFO ==> Validating settings in MONGODB_* env vars...
rocketchat-mongodb-1 | mongodb 21:07:33.98 WARN ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
rocketchat-mongodb-1 | mongodb 21:07:34.01 INFO ==> Initializing MongoDB...
rocketchat-mongodb-1 | /opt/bitnami/scripts/libmongodb.sh: line 449: echo: write error: No space left on device

```

Long story short, it seems like perhaps my issue is the ‘No space left on device’ for the mongodb container, but I’m not entirely certain how to fix that…any ideas?
