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

Helm charts for IoT Agent JSON with more recent versions (e.g. >= 1.19) #220

Open
mwr-ebc opened this issue Oct 23, 2023 · 2 comments
Open

Comments

@mwr-ebc
Copy link

mwr-ebc commented Oct 23, 2023

Hi, we are currently trying to deploy the FIWARE components in our Kubernetes cluster utilitizing the most recent versions of the components. However, using the helm charts for the IoT Agent JSON, we run into the following issue: Since the helm charts were created for version 1.14, the IoT Agent comes with a discovery for the mongoDB - and with a hint that this mechanism would be depracated in the future. Now, when trying to deploy the IoT Agent with a newer version, e.g. 1.19 or the most recent 2.4.2, this mechanism seems not be integrated any longer, which results in the IoT Agent not connecting properly to the mongoDB. We are using mongoDB 6.0.9 from bitnami.

In the values.yaml we specified the mongoDB host name as "mongodb-headless.default.svc.cluster.local". So, we are wondering how the new mechanism is currently working and if there are any more recent helm charts available to deploy the IoT Agent.

You can find the error log from the IoT Agent below:

{"time":"2023-10-23T13:01:40.218Z","lvl":"ERROR","msg":"EISDIR: illegal operation on a directory, read"}
2023-10-23T13:01:40.532553333Z {"op":"IoTAgentNGSI.JEXL","time":"2023-10-23T13:01:40.532Z","lvl":"INFO","msg":"Trasformations can be added to JEXL parser"}
 `node --trace-warnings ...` to show where the warning was created)
2023-10-23T13:01:40.657637540Z time=2023-10-23T13:01:40.656Z | lvl=ERROR | corr=92747a9f-3924-4d84-9440-27c8bab08c8e | trans=92747a9f-3924-4d84-9440-27c8bab08c8e | op=IoTAgentNGSI.DbConn | from=n/a | srv=n/a | subsrv=n/a | msg=MONGODB-001: Error trying to connect to MongoDB: MongoNetworkError: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27017
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16)
2023-10-23T13:01:40.657698591Z     at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
2023-10-23T13:01:40.657705123Z   name: 'MongoNetworkError'
    at Socket.emit (node:domain:489:12)
2023-10-23T13:01:40.657776123Z     at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
2023-10-23T13:01:40.657786800Z     at processTicksAndRejections (node:internal/process/task_queues:83:21) | comp=IoTAgent
2023-10-23T13:01:40.657803496Z time=2023-10-23T13:01:40.657Z | lvl=INFO | corr=92747a9f-3924-4d84-9440-27c8bab08c8e | trans=92747a9f-3924-4d84-9440-27c8bab08c8e | op=IoTAgentNGSI.DbConn | from=n/a | srv=n/a | subsrv=n/a | msg=Waiting 5 seconds before attempting again. | comp=IoTAgent
2023-10-23T13:01:45.665291645Z time=2023-10-23T13:01:45.664Z | lvl=INFO | corr=92747a9f-3924-4d84-9440-27c8bab08c8e | trans=92747a9f-3924-4d84-9440-27c8bab08c8e | op=IoTAgentNGSI.DbConn | from=n/a | srv=n/a | subsrv=n/a | msg=Attempting to connect to MongoDB instance with url "mongodb://localhost:27017/iotagentjson". Attempt 2 | comp=IoTAgent
2023-10-23T13:01:45.672053231Z time=2023-10-23T13:01:45.671Z | lvl=ERROR | corr=92747a9f-3924-4d84-9440-27c8bab08c8e | trans=92747a9f-3924-4d84-9440-27c8bab08c8e | op=IoTAgentNGSI.DbConn | from=n/a | srv=n/a | subsrv=n/a | msg=MONGODB-001: Error trying to connect to MongoDB: MongoNetworkError: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27017
2023-10-23T13:01:45.672086861Z     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16)
    at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17)

We appreciate your help. Thank you in advance!

@DevTobiR
Copy link

DevTobiR commented Nov 6, 2023

Hi. The path of the app in the image changed. The configmap does not replace the config.js. In my local copy I changed template/deployment.yaml to mountPath: /opt/iotagent-json/config.js. It seems to work now. Can you confirm?

@mwr-ebc
Copy link
Author

mwr-ebc commented Nov 20, 2023

Hey DevTobiR,

we have changed the mount path in our test setup (iota-json versions 1.19.0 and 2.4.2). With both versions, the iota seems to connect to mongodb successfully. We have deployed a simple sensor and a simple actuator to validate the correct data flows (via MQTT).
Thanks for your suggestion!

We will open a pull request and update the file.

Cheers,
Martin

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