# Mongo connection error

**URL:** <https://forum.genieacs.com/t/mongo-connection-error/2392>\
**Category:** Uncategorized\
**Created:** [February 7, 2022, 5:25pm UTC](https://forum.genieacs.com/t/mongo-connection-error/2392 "2022-02-07T17:25:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Radha](https://avatars.discourse-cdn.com/v4/letter/r/ecb155/32.png) [@Radha](https://forum.genieacs.com/u/Radha)\
**Post date:** [February 7, 2022, 5:25pm UTC](https://forum.genieacs.com/t/mongo-connection-error/2392/1 "2022-02-07T17:25:48Z")

</div>

Hi all,

I am trying to deploy genieacs in kubernetes, I have mongo running perfectly fine without any problems but genieacs-gui, genieacs-cwmp, genieacs-nbi, genieacs-fs are all giving me the same mongo connection error as shown below. Any leads on how to solve this error would be really appreciated  
.  
thank you.

sudo kubectl logs -n netlinq genieacscwmp-0  
2022-02-07 17:13:19,201 INFO Set uid to user 0 succeeded  
2022-02-07 17:13:19,203 INFO supervisord started with pid 1  
2022-02-07 17:13:20,206 INFO spawned: ‘genieacs-cwmp’ with pid 9  
2022-02-07 17:13:21,208 INFO success: genieacs-cwmp entered RUNNING state, process has stayed up for \> than 1 seconds (startsecs)  
2022-02-07T17:13:22.358Z [INFO] genieacs-cwmp starting; pid=9 version=“1.2.8+20220112123519”  
2022-02-07T17:13:54.661Z [ERROR] Uncaught exception; pid=28 exceptionName=“MongoServerSelectionError” exceptionMessage=“connect ECONNREFUSED 127.0.0.1:27017” exceptionStack="/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610\n const timeoutError = new MongoServerSelectionError(\n ^\n\nMongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017\n at Timeout.\_onTimeout (/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610:30)\n at listOnTimeout (node:internal/timers:557:17)\n at processTimers (node:internal/timers:500:7)"  
2022-02-07T17:13:54.673Z [ERROR] Worker died; pid=28 exitCode=1  
2022-02-07T17:13:54.765Z [ERROR] Uncaught exception; pid=69 exceptionName=“MongoServerSelectionError” exceptionMessage=“connect ECONNREFUSED 127.0.0.1:27017” exceptionStack="/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610\n const timeoutError = new MongoServerSelectionError(\n ^\n\nMongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017\n at Timeout.\_onTimeout (/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610:30)\n at listOnTimeout (node:internal/timers:557:17)\n at processTimers (node:internal/timers:500:7)"  
2022-02-07T17:13:54.779Z [ERROR] Worker died; pid=69 exitCode=1  
2022-02-07T17:13:54.840Z [ERROR] Uncaught exception; pid=94 exceptionName=“MongoServerSelectionError” exceptionMessage=“connect ECONNREFUSED 127.0.0.1:27017” exceptionStack="/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610\n const timeoutError = new MongoServerSelectionError(\n ^\n\nMongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017\n at Timeout.\_onTimeout (/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610:30)\n at listOnTimeout (node:internal/timers:557:17)\n at processTimers (node:internal/timers:500:7)"  
2022-02-07T17:13:54.842Z [ERROR] Uncaught exception; pid=49 exceptionName=“MongoServerSelectionError” exceptionMessage=“connect ECONNREFUSED 127.0.0.1:27017” exceptionStack="/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610\n const timeoutError = new MongoServerSelectionError(\n ^\n\nMongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017\n at Timeout.\_onTimeout (/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610:30)\n at listOnTimeout (node:internal/timers:557:17)\n at processTimers (node:internal/timers:500:7)"  
2022-02-07T17:13:54.851Z [ERROR] Worker died; pid=94 exitCode=1  
2022-02-07T17:13:54.861Z [ERROR] Worker died; pid=49 exitCode=1  
2022-02-07T17:13:54.865Z [ERROR] Uncaught exception; pid=22 exceptionName=“MongoServerSelectionError” exceptionMessage=“connect ECONNREFUSED 127.0.0.1:27017” exceptionStack="/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610\n const timeoutError = new MongoServerSelectionError(\n ^\n\nMongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017\n at Timeout.\_onTimeout (/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610:30)\n at listOnTimeout (node:internal/timers:557:17)\n at processTimers (node:internal/timers:500:7)"  
2022-02-07T17:13:54.886Z [ERROR] Worker died; pid=22 exitCode=1  
2022-02-07T17:13:55.067Z [ERROR] Uncaught exception; pid=114 exceptionName=“MongoServerSelectionError” exceptionMessage=“connect ECONNREFUSED 127.0.0.1:27017” exceptionStack="/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610\n const timeoutError = new MongoServerSelectionError(\n ^\n\nMongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017\n at Timeout.\_onTimeout (/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610:30)\n at listOnTimeout (node:internal/timers:557:17)\n at processTimers (node:internal/timers:500:7)"  
2022-02-07T17:13:55.087Z [ERROR] Worker died; pid=114 exitCode=1  
2022-02-07T17:13:55.184Z [ERROR] Uncaught exception; pid=16 exceptionName=“MongoServerSelectionError” exceptionMessage=“connect ECONNREFUSED 127.0.0.1:27017” exceptionStack="/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610\n const timeoutError = new MongoServerSelectionError(\n ^\n\nMongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017\n at Timeout.\_onTimeout (/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610:30)\n at listOnTimeout (node:internal/timers:557:17)\n at processTimers (node:internal/timers:500:7)"  
2022-02-07T17:13:55.207Z [ERROR] Worker died; pid=16 exitCode=1  
2022-02-07T17:13:55.219Z [ERROR] Uncaught exception; pid=83 exceptionName=“MongoServerSelectionError” exceptionMessage=“connect ECONNREFUSED 127.0.0.1:27017” exceptionStack="/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610\n const timeoutError = new MongoServerSelectionError(\n ^\n\nMongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017\n at Timeout.\_onTimeout (/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610:30)\n at listOnTimeout (node:internal/timers:557:17)\n at processTimers (node:internal/timers:500:7)"  
2022-02-07T17:13:55.230Z [ERROR] Worker died; pid=83 exitCode=1  
2022-02-07T17:13:55.337Z [ERROR] Uncaught exception; pid=90 exceptionName=“MongoServerSelectionError” exceptionMessage=“connect ECONNREFUSED 127.0.0.1:27017” exceptionStack="/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610\n const timeoutError = new MongoServerSelectionError(\n ^\n\nMongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017\n at Timeout.\_onTimeout (/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610:30)\n at listOnTimeout (node:internal/timers:557:17)\n at processTimers (node:internal/timers:500:7)"  
2022-02-07T17:13:55.352Z [ERROR] Worker died; pid=90 exitCode=1  
2022-02-07T17:13:55.485Z [ERROR] Uncaught exception; pid=59 exceptionName=“MongoServerSelectionError” exceptionMessage=“connect ECONNREFUSED 127.0.0.1:27017” exceptionStack="/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610\n const timeoutError = new MongoServerSelectionError(\n ^\n\nMongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017\n at Timeout.\_onTimeout (/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610:30)\n at listOnTimeout (node:internal/timers:557:17)\n at processTimers (node:internal/timers:500:7)"  
2022-02-07T17:13:55.497Z [ERROR] Worker died; pid=59 exitCode=1  
2022-02-07T17:13:55.587Z [ERROR] Uncaught exception; pid=35 exceptionName=“MongoServerSelectionError” exceptionMessage=“connect ECONNREFUSED 127.0.0.1:27017” exceptionStack="/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610\n const timeoutError = new MongoServerSelectionError(\n ^\n\nMongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017\n at Timeout.\_onTimeout (/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610:30)\n at listOnTimeout (node:internal/timers:557:17)\n at processTimers (node:internal/timers:500:7)"  
2022-02-07T17:13:55.606Z [ERROR] Worker died; pid=35 exitCode=1  
2022-02-07T17:13:55.733Z [ERROR] Uncaught exception; pid=41 exceptionName=“MongoServerSelectionError” exceptionMessage=“connect ECONNREFUSED 127.0.0.1:27017” exceptionStack="/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610\n const timeoutError = new MongoServerSelectionError(\n ^\n\nMongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017\n at Timeout.\_onTimeout (/opt/genieacs/node\_modules/mongodb/src/sdam/topology.ts:610:30)\n at listOnTimeout (node:internal/timers:557:17)\n at processTimers (node:internal/timers:500:7)"

---

<div class="post-metadata">

**Author:** ![jfdumont](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/jfdumont/32/815_2.png) [@jfdumont](https://forum.genieacs.com/u/jfdumont)\
**Post date:** [March 28, 2022, 5:15am UTC](https://forum.genieacs.com/t/mongo-connection-error/2392/2 "2022-03-28T05:15:10Z")

</div>

> [@Radha](#):
>
> am trying to deploy genieacs in kubernetes, I have mongo running perfectly fine without any problems but genieacs-gui, genieacs-cwmp, genieacs-nbi, genieacs-fs are all giving me the same mongo connection error as shown below. Any leads on how to solve this error would be really appreciated  
> .

Hi Radha

I’m also trying to deploy GenieACS in kubernetes.  
I’m having a lot of problems but not connecting to MongoDB.  
I would be happy to share our experiences.  
For mongodb I made a separate deployment  
I pass the login url via genieacs.env  
`GENIEACS_MONGODB_CONNECTION_URL=mongodb://mongodb-genieacs.genieacs/genieacs`  
something like mongodb://servicename.namespace/genieacs

For my tests I disabled authentication in MongoDB and the connection is made.  
This is where other problems come in.
