iotagent-ul icon indicating copy to clipboard operation
iotagent-ul copied to clipboard

Loss of service groups and devices after agent restart

Open dberenguer opened this issue 5 years ago • 3 comments

Version 1.10.0

Every time the UL agent is restarted all service groups and devices are lost. The database still contains the items but the API only returns empty lists. As result, UL devices can no longer transmit values to the agent (HTTP 404 response).

dberenguer avatar Oct 26 '19 17:10 dberenguer

That’s not the usual behavior. You may have some configuration, deployment issues that make the agent lose the DB location/configuration when it restarts.

I recommend to ask for help in stack overflow giving as much detail as possible about your current deployment characteristics.

Anyway we will take a look just in case something unexpected happened.

El 26 oct 2019, a las 19:52, Daniel Berenguer [email protected] escribió:

 Version 1.10.0

Every time the UL agent is restarted all service groups and devices are lost. The database still contains the items but the API only returns empty lists. As result, UL devices can no longer transmit values to the agent (HTTP 404 response).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

perrolobo avatar Oct 26 '19 19:10 perrolobo

Like issue #391 doing IOTA_REGISTRY_TYPE=mongodb fixes this problem. I just confirm that this is the default behavior for IOTA_REGISTRY_TYPE commented out.

dberenguer avatar Oct 27 '19 08:10 dberenguer

Like issue #391 doing IOTA_REGISTRY_TYPE=mongodb fixes this problem. I just confirm that this is the default behavior for IOTA_REGISTRY_TYPE commented out.

Yes, that's correct. Please find the following piece of documentation about it (https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/installationguide.md):

deviceRegistry [equivalent to IOTA_REGISTRY_TYPE ]: type of Device Registry to create. Currently, two values are supported: memory and mongodb. If the former is configured, a transient memory-based device registry will be used to register all the devices. This registry will be emptied whenever the process is restarted. If the latter is selected, a MongoDB database will be used to store all the device information, so it will be persistent from one execution to the other. Mongodb databases must be configured in the mongob section (as described bellow)

All real-world utilization cases use mongodb as registry. Memory registry only makes sense for testing and things like that.

Maybe what could be done in the scope of thi issue is to change de default to mongodb (as far as I understand the default right now, i.e. if IOTA_REGISTRY_TYPE is not provided, is memory).

fgalan avatar Oct 28 '19 16:10 fgalan