# MongoS error in database

**URL:** <https://forums.percona.com/t/mongos-error-in-database/20881>\
**Category:** Uncategorized\
**Created:** [March 22, 2023, 9:42pm UTC](https://forums.percona.com/t/mongos-error-in-database/20881 "2023-03-22T21:42:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fjareta](https://avatars.discourse-cdn.com/v4/letter/f/e36b37/32.png) [@fjareta](https://forums.percona.com/u/fjareta)\
**Post date:** [March 22, 2023, 9:42pm UTC](https://forums.percona.com/t/mongos-error-in-database/20881/1 "2023-03-22T21:42:46Z")

</div>

Hey guys.

I have in my Openshift environment the percona mongodb operator installed in version 1.12.1 that an error occurs almost monthly where only the mongos pods present a strange error that seems to be related to some mongo user not being able to list or read the databases inside the pod.

I searched about this error in the forum and in the releases as well but didn’t find anything very specific. Does anyone know what this error could be?  
I have a percona mongo operator on version 1.11.0 and I don’t have this kind of problem on another cluster.

 ![Erro mongo 1](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/3/30e08ef4882cce493032f166a9739f7c345053c6.png)

I installed version 1.13.1 on another newer cluster and so far I haven’t had the same issue.

Regards.

---

<div class="post-metadata">

**Author:** ![fjareta](https://avatars.discourse-cdn.com/v4/letter/f/e36b37/32.png) [@fjareta](https://forums.percona.com/u/fjareta)\
**Post date:** [April 24, 2023, 7:38pm UTC](https://forums.percona.com/t/mongos-error-in-database/20881/2 "2023-04-24T19:38:48Z")

</div>

Updating the topic, I realized that the error probably started from Percona Operator.  
Reading the log I saw that Mongo-cfg Pod changed the name for some reason:

_/go/src/github.com/percona/percona-server-mongodb-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:227_

_502023-04-24T16:58:04.388Z INFO controller\_psmdb StatefulSet is changed, starting smart update {“name”: “mongo-cluster-cfg”}_

\*512023-04-24T16:58:14.461Z ERROR controller.psmdb-controller Reconciler error {“name”: “mongo-cluster”, “namespace”: “mongodb-ebagagem”, “error”: “reconcile StatefulSet for cfg: failed to run smartUpdate: failed to stop balancer: failed to get mongos connection: ping mongo: server selection error: context deadline exceeded, current topology: { Type: Unknown, Servers: [{ Addr: myservice:port, Type: Unknown },] }”, “errorVerbose”: "reconcile StatefulSet for cfg: failed to run smartUpdate: failed to stop balancer: failed to get mongos connection: ping mongo: server selection error: context deadline exceeded, current topology: { Type: Unknown, Servers: [{ Addr: myservice:port, Type: Unknown },] }\ngithub.com/percona/percona-server-mongodb-operator/pkg/controller/perconaservermongodb.(_ReconcilePerconaServerMongoDB).Reconcile\n\t/go/src/github.com/percona/percona-server-mongodb-operator/pkg/controller/perconaservermong…_

\*[52sigs.k8s.io/controller-runtime/pkg/internal/controller.](http://52sigs.k8s.io/controller-runtime/pkg/internal/controller.)(_Controller).processNextWorkItem_

_53/go/src/github.com/percona/percona-server-mongodb-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:266_

\*[54sigs.k8s.io/controller-runtime/pkg/internal/controller.](http://54sigs.k8s.io/controller-runtime/pkg/internal/controller.)(_Controller).Start.func2.2_

Overall, the error persists at 1.13 version.

---

<div class="post-metadata">

**Author:** ![fjareta](https://avatars.discourse-cdn.com/v4/letter/f/e36b37/32.png) [@fjareta](https://forums.percona.com/u/fjareta)\
**Post date:** [April 27, 2023, 6:21pm UTC](https://forums.percona.com/t/mongos-error-in-database/20881/3 "2023-04-27T18:21:34Z")

</div>

Well, even that no one answered me I would like to share the solution in this case.

I figure out that the error was ocurring because during the cluster instalation I make a mistake creating other secret. So a mongo namespace had two or more secret to the users environment. Sometimes for some reason the operator confused what secret file to use as reference. Then the database service stopped.

The solution was delete all secrets leaving just the secret created during installation by default.  
I also had to change at instance mongo yaml from operator, appointing what secret I should to use.
