You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error was not related to the iotagent, instead it's related to the iotagent-node-lib who is the resposible of the Mongo connection.
When setting a mongo connection with authentication using user and password it fails throwing an Authentication Fail error.
I've been looking throw the code and it seems to be related to the iotagent-node-lib/lib/model/dbConn.js
And it seems to only generates connection strings without autentication
IoT Agent Node Lib version the issue has been seen with
3.4.4
Bound or port used (API interaction)
Other
NGSI version
NGSI-LD
Are you running a container?
Yes, I am using a contaner (Docker, Kubernetes...)
Image type
normal
Expected behaviour you didn't see
I moved this issue from the iotagent-json repo:
telefonicaid/iotagent-json#739
The error was not related to the iotagent, instead it's related to the iotagent-node-lib who is the resposible of the Mongo connection.
When setting a mongo connection with authentication using user and password it fails throwing an Authentication Fail error.
I've been looking throw the code and it seems to be related to the iotagent-node-lib/lib/model/dbConn.js
And it seems to only generates connection strings without autentication
https://github.com/telefonicaid/iotagent-node-lib/blob/master/lib/model/dbConn.js
Test passes, cause an expected result it's bad defined cause in mongo connection strings user and password goes before the host
{
mongodb: {
host: 'example.com',
port: '98765',
db: 'examples',
replicaSet: 'rs0',
user: 'user01',
password: 'pass01',
authSource: 'admin'
},
expected: {
url: 'mongodb://example.com:98765/examples',
options: {
replicaSet: 'rs0',
auth: {
user: 'user01',
password: 'pass01'
},
authSource: 'admin',
useNewUrlParser: true,
useUnifiedTopology: true
}
}
},
The error should be solved easily, checking if the options.auth is present and concat into the url string. Located in th e init function
Unexpected behaviour you saw
No response
Steps to reproduce the problem
No response
Configs
No response
Log output
No response
The text was updated successfully, but these errors were encountered: