Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoError - Topology was destroyed #442

Open
filgiuff opened this issue Oct 28, 2019 · 7 comments
Open

MongoError - Topology was destroyed #442

filgiuff opened this issue Oct 28, 2019 · 7 comments

Comments

@filgiuff
Copy link

filgiuff commented Oct 28, 2019

Sometimes it happens that all calls to the agent don't work, The system returns this response

{
    "name": "MongoError",
    "message": "Topology was destroyed"
}

Restarting the agent the error disappears.

I'm using version 1.5.0

@fgalan
Copy link
Member

fgalan commented Oct 28, 2019

Thanks for the report!

It could be some kind of problem in the IOTA connection to DB or in the DB itself. Maybe the logs of the IOTA could provide some useful information to help debugging this issue (the log can be long and verbose... I'd suggest to look near the timestamp when the problem starts to happen).

@filgiuff
Copy link
Author

Here it is a message from the log when this error happens:

iotstack_agent-json.1.qhlre44iss8j@vm-1    | time=2019-12-21T04:00:39.073Z | lvl=ERROR | corr=d6e924ac-9c55-447b-aff2-dc608caea292 | trans=d6e924ac-9c55-447b-aff2-dc608caea292 | op=IoTAgentNGSI.DomainControl | srv=n/a | subsrv=n/a | msg=DisconnectedError: Ran out of retries trying to reconnect to "mongodb:27017". Try setting `server.reconnectTries` and `server.reconnectInterval` to something higher. | comp=IoTAgent

@fgalan
Copy link
Member

fgalan commented Jan 7, 2020

Which values do you have in your configuration for server.reconnectTries and server.reconnectInterval? Have you tried the advice of increasing them in order to see if the problem disappears?

@filgiuff
Copy link
Author

filgiuff commented Jan 7, 2020

Which values do you have in your configuration for server.reconnectTries and server.reconnectInterval? Have you tried the advice of increasing them in order to see if the problem disappears?

Where are these configurations ? Which is the involved component ? (iotAgent or Mongodb ?)

@fgalan
Copy link
Member

fgalan commented Jan 7, 2020

Where are these configurations ? Which is the involved component ? (iotAgent or Mongodb ?)

It corresponds to the mongodb.retries and mongodb.retryTime in config.js or IOTA_MONGO_RETRIES IOTA_MONGO_RETRY_TIME env vars (depending on the configuration style you are using).

The mongodb configuration is described in https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/installationguide.md:

he MongoBD driver will retry the connection at startup time retries times, waiting retryTime seconds between attempts, if those attributes are present (default values are 5 and 5 respectively)

@filgiuff
Copy link
Author

Following your suggestion, I put 2 environment variables with these value:

IOTA_MONGO_RETRIES=10
IOTA_MONGO_RETRY_TIME=10

on the agent configuration, but the problem happens again.

Do you know what can be the correct values to insert?

I'm still using the version 1.5.0

@fgalan
Copy link
Member

fgalan commented Feb 20, 2020

I'm still using the version 1.5.0

This version is pretty old... Could you test with the newest one (1.12.0) please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants