iotagent-node-lib icon indicating copy to clipboard operation
iotagent-node-lib copied to clipboard

SECURITY_INFORMATION_MISSING error is missing information

Open rosieks opened this issue 2 years ago • 2 comments

I try to setup OPC UA agent with OAuth authentication and I get the following error:

2023-03-07 08:51:11 time=2023-03-07T07:51:11.428Z | lvl=ERROR | corr=70688d7e-4ec4-4040-804a-dc0070d1156c | trans=70688d7e-4ec4-4040-804a-dc0070d1156c | op=IoTAgentNGSI.Devices-LD | from=n/a | srv=gtm_jakob | subsrv=/demo | msg=ORION-001: Connection error creating inital entity in the Context Broker: SecurityInformationMissing {
2023-03-07 08:51:11   name: 'SECURITY_INFORMATION_MISSING',
2023-03-07 08:51:11   message: 'Some security information was missing for device type:undefined'
2023-03-07 08:51:11 } | comp=IoTAgent

Unfortunately, this error doesn't provide any helpful information. Could you improve it by logging somehow real error here: https://github.com/telefonicaid/iotagent-node-lib/blob/ed74c96d0a6b8fe485ef4e428a25aa2b60091b94/lib/services/northBound/restUtils.js#L217

rosieks avatar Mar 07 '23 08:03 rosieks

Eventually I found that this problem was caused by using OAuth2 authentication and there was no trust defined for device. I had to analyse code to figure it out so defiantly it would be good to have better description

rosieks avatar Mar 07 '23 12:03 rosieks

I try to setup OPC UA agent with OAuth authentication and I get the following error:

2023-03-07 08:51:11 time=2023-03-07T07:51:11.428Z | lvl=ERROR | corr=70688d7e-4ec4-4040-804a-dc0070d1156c | trans=70688d7e-4ec4-4040-804a-dc0070d1156c | op=IoTAgentNGSI.Devices-LD | from=n/a | srv=gtm_jakob | subsrv=/demo | msg=ORION-001: Connection error creating inital entity in the Context Broker: SecurityInformationMissing {
2023-03-07 08:51:11   name: 'SECURITY_INFORMATION_MISSING',
2023-03-07 08:51:11   message: 'Some security information was missing for device type:undefined'
2023-03-07 08:51:11 } | comp=IoTAgent

Unfortunately, this error doesn't provide any helpful information. Could you improve it by logging somehow real error here:

https://github.com/telefonicaid/iotagent-node-lib/blob/ed74c96d0a6b8fe485ef4e428a25aa2b60091b94/lib/services/northBound/restUtils.js#L217

Since you identified where the logging needs to improve, are you wiling to contribute by adding the required information to the log message? A PR is welcome.

mapedraza avatar Mar 14 '23 08:03 mapedraza