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

Avoid update with empty entities when using multi entity plugin or explicitAttrs=true

Open mapedraza opened this issue 4 years ago • 7 comments

When using multi entity plugin together with expressionAttrs, a particular situation could happen when the base entity does not have any attribute within the measure.

As an example, provisioning a group like this one:

{
 "commands": [],
 "type": "GPS",
 "lazy": [],
 "active": [
     {
         "name": "explicit",
         "type": "number",
         "entity_name": "SO5",
         "object_id": "x"
     },
     {
         "name": "explicit",
         "type": "number",
         "entity_name": "SO6",
         "object_id": "y"
     }
 ],
 "explicitAttrs": true
}

And sending a measure like this one to a device gps1:

[
 {
     "name": "x",
     "type": "Number",
     "value": 52
 },
 {
     "name": "y",
     "type": "Number",
     "value": 13
 },
 {
     "name": "z",
     "type": "Number",
     "value": 12
 }
]

Would result on a update operation against CB like this one:

{
   "actionType": "update",
   "entities": [
     {
       "id": "gps1",
       "type": "GPS"
     },
     {
       "explicit": {
         "type": "number",
         "value": 52
       },
       "type": "GPS",
       "id": "SO5"
     },
     {
       "explicit": {
         "type": "number",
         "value": 13
       },
       "type": "GPS",
       "id": "SO6"
     }
   ]
 }

In which the entity gps1 is updated without having any attribute.

Makes this sense? Should this entity be removed from update list?

According to @fgalan , this does not have a huge impact on CB.

This is related with test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js changes added in PR #1157

mapedraza avatar Dec 22 '21 10:12 mapedraza

For some background info, the test is just following a very specific path of execution. The expectation is checking that z is dropped totally from the CB (since we're checking explicitAttrs). The provisioning is a minimal example, so I guess a real world example would include additional attributes on the main entity.

jason-fox avatar Dec 22 '21 10:12 jason-fox

Probably fixed by https://github.com/telefonicaid/iotagent-node-lib/pull/1314 We need to retried it.

AlvaroVega avatar Apr 20 '23 08:04 AlvaroVega

Wrong test, do not consider the following information

Reproducing the issue in latest version using IOTA-JSON

EDIT: Seems multientity is not working in this case, since no other entities are created in the CB checked with the following command after completing the process:

curl --location --request GET 'http://localhost:1026/v2/entities' \
--header 'Fiware-Service: service' \
--header 'Fiware-ServicePath: /subservice' \

Group provision

curl --location --request POST 'http://localhost:4061/iot/services?protocol=IoTA-UL' \
--header 'Fiware-Service: service' \
--header 'Fiware-ServicePath: /subservice' \
--header 'X-Auth-Token: {{token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "services": [
        {
            "resource": "/iot/d",
            "apikey": "801230BJKL23Y9090DSFL123HJK09H324HV8733",
            "type": "Light",
            "trust": "8970A9078A803H3BL98PINEQRW8342HBAMS",
            "cbHost": "http://localhost:1026",
             "commands": [],
             "type": "GPS",
             "lazy": [],
             "active": [
                 {
                     "name": "explicit",
                     "type": "number",
                     "entity_name": "SO5",
                     "object_id": "x"
                 },
                 {
                     "name": "explicit",
                     "type": "number",
                     "entity_name": "SO6",
                     "object_id": "y"
                 }
             ],
             "explicitAttrs": true
        }
    ]
}'

Update

curl --location --request POST 'http://localhost:7896/iot/d?k=801230BJKL23Y9090DSFL123HJK09H324HV8733&i=gps1&getCmd=0' \
--header 'Fiware-Service: service' \
--header 'Content-Type: text/plain' \
--data-raw 'x|52|y|13|z|12'

Conclusions

The entity is created through the following request:

time=2023-04-20T14:30:31.043Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Devices-v2 | from=n/a | srv=service | subsrv=/subservice | msg=Creating initial entity in the Context Broker:
 {
    "url": "http://localhost:1026/v2/entities?options=upsert",
    "method": "POST",
    "json": {
        "id": "GPS:gps1",
        "type": "GPS",
        "TimeInstant": {
            "type": "DateTime",
            "value": "2023-04-20T14:30:31.043Z"
        }
    },
    "headers": {
        "fiware-service": "service",
        "fiware-servicepath": "/subservice",
        "fiware-correlator": "c9eb9002-048c-4922-9bc9-424dda696999"
    }
} | comp=IoTAgent

And empty updates are skipped

4922-9bc9-424dda696999 | op=IoTAgentNGSI.Entities-v2 | from=n/a | srv=service | subsrv=/subservice | msg=Not updating device value in the Context Broker at [http://localhost:1026/v2/entities/GPS:gps1/attrs?type=GPS] due to empty payload 

[{
    "url": "http://localhost:1026/v2/entities/GPS:gps1/attrs?type=GPS",
    "method": "PATCH",
    "headers": {
        "fiware-service": "service",
        "fiware-servicepath": "/subservice"
    },
    "json": {}
}]

 | comp=IoTAgent

Log

/bin/iotagent-ul
{"op":"IoTAgentNGSI.JEXL","time":"2023-04-20T14:30:20.460Z","lvl":"INFO","msg":"Trasformations can be added to JEXL parser"}
{"time":"2023-04-20T14:30:20.466Z","lvl":"WARN","msg":"***********************************************\nWARNING: authentication for secure connections is not in use,\nIt is recommended to enable authentication\n***********************************************"}
time=2023-04-20T14:30:20.466Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Global | from=n/a | srv=n/a | subsrv=n/a | msg=Starting an IoT Agent... | comp=IoTAgent
time=2023-04-20T14:30:20.467Z | lvl=WARN | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Global | from=n/a | srv=n/a | subsrv=n/a | msg=***********************************************
WARNING: authentication for secure connections is not in use,
It is recommended to enable authentication
*********************************************** | comp=IoTAgent
time=2023-04-20T14:30:20.467Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Global | from=n/a | srv=n/a | subsrv=n/a | msg=Default expression language not set, or invalid, using legacy configuration | comp=IoTAgent
time=2023-04-20T14:30:20.468Z | lvl=WARN | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Global | from=n/a | srv=n/a | subsrv=n/a | msg=***********************************************
WARNING: authentication for secure connections is not in use,
It is recommended to enable authentication
*********************************************** | comp=IoTAgent
time=2023-04-20T14:30:20.468Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Global | from=n/a | srv=n/a | subsrv=n/a | msg=Activating IOT Agent NGSI Library. | comp=IoTAgent
time=2023-04-20T14:30:20.468Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Global | from=n/a | srv=n/a | subsrv=n/a | msg=MongoDB Device registry selected for NGSI Library | comp=IoTAgent
time=2023-04-20T14:30:20.489Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.DbConn | from=n/a | srv=n/a | subsrv=n/a | msg=First connection attempt | comp=IoTAgent
time=2023-04-20T14:30:20.489Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.DbConn | from=n/a | srv=n/a | subsrv=n/a | msg=Attempting to connect to MongoDB instance with url "mongodb://localhost:27017/iotagentul" and options {}. Attempt 1 | comp=IoTAgent
(node:30510) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:30510) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
(node:30510) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
(node:30510) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
(node:30510) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
time=2023-04-20T14:30:20.548Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.DbConn | from=n/a | srv=n/a | subsrv=n/a | msg=Successfully connected to MongoDB. | comp=IoTAgent
time=2023-04-20T14:30:20.564Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.NorthboundServer | from=n/a | srv=n/a | subsrv=n/a | msg=Starting IoT Agent listening on port [4061] | comp=IoTAgent
time=2023-04-20T14:30:20.565Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.NorthboundServer | from=n/a | srv=n/a | subsrv=n/a | msg=Using config:

{
    "logLevel": "DEBUG",
    "timestamp": true,
    "contextBroker": {
        "host": "localhost",
        "port": "1026",
        "fallbackTenant": "iotagent",
        "fallbackPath": "/",
        "url": "http://localhost:1026"
    },
    "server": {
        "port": 4061
    },
    "defaultResource": "/iot/d",
    "deviceRegistry": {
        "type": "mongodb"
    },
    "mongodb": {
        "host": "localhost",
        "port": "27017",
        "db": "iotagentul"
    },
    "types": {},
    "service": "howtoService",
    "subservice": "/howto",
    "providerUrl": "http://localhost:4061",
    "deviceRegistrationDuration": "P20Y",
    "defaultType": "Thing",
    "explicitAttrs": false,
    "iotaVersion": "2.0.0-next",
    "multiCore": false,
    "relaxTemplateValidation": false,
    "defaultEntityNameConjunction": ":",
    "defaultExpressionLanguage": "legacy"
}
 | comp=IoTAgent
time=2023-04-20T14:30:20.580Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.ContextServer-v2 | from=n/a | srv=n/a | subsrv=n/a | msg=Loading NGSI-v2 Context server routes | comp=IoTAgent
time=2023-04-20T14:30:20.591Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTA-UL20.Agent | from=n/a | srv=n/a | subsrv=n/a | msg=IoT Agent services activated | comp=IoTAgent
time=2023-04-20T14:30:20.592Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.JEXL | from=n/a | srv=n/a | subsrv=n/a | msg=Trasformations can be added to JEXL parser | comp=IoTAgent
time=2023-04-20T14:30:20.682Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.AMQP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=Starting AMQP binding | comp=IoTAgent
time=2023-04-20T14:30:20.683Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.AMQP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=creating connnection | comp=IoTAgent
time=2023-04-20T14:30:20.688Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.HTTP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=HTTP Binding listening on port [7896] | comp=IoTAgent
time=2023-04-20T14:30:20.689Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=Starting MQTT binding with options {"protocol":"mqtt","host":"localhost","port":1883,"key":null,"ca":null,"cert":null,"rejectUnauthorized":true,"username":null,"password":null,"clean":true,"clientId":"iotaul_eb66ae20","keepalive":60,"connectTimeout":3600000} retries 5 retryTIme 5 | comp=IoTAgent
time=2023-04-20T14:30:20.689Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=creating connection | comp=IoTAgent
time=2023-04-20T14:30:20.710Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=connected | comp=IoTAgent
time=2023-04-20T14:30:20.715Z | lvl=ERROR | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.AMQP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=connect ECONNREFUSED 127.0.0.1:5672 | comp=IoTAgent
time=2023-04-20T14:30:20.716Z | lvl=FATAL | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.ContextServer | from=n/a | srv=n/a | subsrv=n/a | msg=GLOBAL-002: Couldn't connect with MQTT broker: {"errno":-61,"code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":1883} | comp=IoTAgent
time=2023-04-20T14:30:20.717Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=MQTT Client closed | comp=IoTAgent
time=2023-04-20T14:30:20.717Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=MQTT Client closed connected? false | comp=IoTAgent
time=2023-04-20T14:30:20.717Z | lvl=WARN | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=reconnecting #1.. | comp=IoTAgent
time=2023-04-20T14:30:25.495Z | lvl=DEBUG | corr=c1b52fe4-35e1-4209-a862-b5abd8e98061 | trans=c1b52fe4-35e1-4209-a862-b5abd8e98061 | op=IoTAgentNGSI.GenericMiddlewares | from=n/a | srv=service | subsrv=/subservice | msg=Request for path [/iot/services] from [localhost:4061] | comp=IoTAgent
time=2023-04-20T14:30:25.497Z | lvl=DEBUG | corr=c1b52fe4-35e1-4209-a862-b5abd8e98061 | trans=c1b52fe4-35e1-4209-a862-b5abd8e98061 | op=IoTAgentNGSI.GenericMiddlewares | from=n/a | srv=service | subsrv=/subservice | msg=Body:

{
    "services": [
        {
            "resource": "/iot/d",
            "apikey": "801230BJKL23Y9090DSFL123HJK09H324HV8733",
            "type": "GPS",
            "trust": "8970A9078A803H3BL98PINEQRW8342HBAMS",
            "cbHost": "http://localhost:1026",
            "commands": [],
            "lazy": [],
            "active": [
                {
                    "name": "explicit",
                    "type": "number",
                    "entity_name": "SO5",
                    "object_id": "x"
                },
                {
                    "name": "explicit",
                    "type": "number",
                    "entity_name": "SO6",
                    "object_id": "y"
                }
            ],
            "explicitAttrs": true
        }
    ]
}

 | comp=IoTAgent
time=2023-04-20T14:30:25.499Z | lvl=DEBUG | corr=c1b52fe4-35e1-4209-a862-b5abd8e98061 | trans=c1b52fe4-35e1-4209-a862-b5abd8e98061 | op=IoTAgentNGSI.DeviceGroupService | from=n/a | srv=service | subsrv=/subservice | msg=Creating new set of 1 services | comp=IoTAgent
time=2023-04-20T14:30:25.499Z | lvl=DEBUG | corr=c1b52fe4-35e1-4209-a862-b5abd8e98061 | trans=c1b52fe4-35e1-4209-a862-b5abd8e98061 | op=IoTAgentNGSI.DeviceGroupService | from=n/a | srv=service | subsrv=/subservice | msg=validateGroup {"resource":"/iot/d","apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733","type":"GPS","trust":"8970A9078A803H3BL98PINEQRW8342HBAMS","cbHost":"http://localhost:1026","commands":[],"lazy":[],"active":[{"name":"explicit","type":"number","entity_name":"SO5","object_id":"x"},{"name":"explicit","type":"number","entity_name":"SO6","object_id":"y"}],"explicitAttrs":true,"service":"service","subservice":"/subservice"} | comp=IoTAgent
time=2023-04-20T14:30:25.499Z | lvl=DEBUG | corr=c1b52fe4-35e1-4209-a862-b5abd8e98061 | trans=c1b52fe4-35e1-4209-a862-b5abd8e98061 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=n/a | subsrv=n/a | msg=Looking for group params ["resource","apikey"] with queryObj {"resource":"/iot/d","apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733"} | comp=IoTAgent
(node:30510) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead. (Triggered by calling processImmediate on process.)
time=2023-04-20T14:30:25.510Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=n/a | subsrv=n/a | msg=Device group for fields [["resource","apikey"]] not found: [{"resource":"/iot/d","apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733"}] | comp=IoTAgent
time=2023-04-20T14:30:25.510Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.DeviceGroupService | from=n/a | srv=n/a | subsrv=n/a | msg=generateDuplicateHander error {"name":"DEVICE_GROUP_NOT_FOUND","message":"Couldn\t find device group for fields: [\"resource\",\"apikey\"] and values: {\"resource\":\"/iot/d\",\"apikey\":\"801230BJKL23Y9090DSFL123HJK09H324HV8733\"}","code":404} and foundGroup undefined | comp=IoTAgent
time=2023-04-20T14:30:25.516Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=n/a | subsrv=n/a | msg=Storing device group with id [64414c81a3ba5b772e58c2a0], type [GPS], apikey [801230BJKL23Y9090DSFL123HJK09H324HV8733] and resource [/iot/d] | comp=IoTAgent
time=2023-04-20T14:30:25.560Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.IOTAMService | from=n/a | srv=n/a | subsrv=n/a | msg=Looking for bindings for the function [configurationHandler] and protocol [null] | comp=IoTAgent
time=2023-04-20T14:30:25.567Z | lvl=DEBUG | corr=c1b52fe4-35e1-4209-a862-b5abd8e98061 | trans=c1b52fe4-35e1-4209-a862-b5abd8e98061 | op=IoTAgentNGSI.DomainControl | from=n/a | srv=service | subsrv=/subservice | msg=response-time: 83 | comp=IoTAgent
time=2023-04-20T14:30:25.718Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.AMQP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=creating connnection | comp=IoTAgent
time=2023-04-20T14:30:25.720Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=creating connection | comp=IoTAgent
time=2023-04-20T14:30:25.721Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=connected | comp=IoTAgent
time=2023-04-20T14:30:25.723Z | lvl=ERROR | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.AMQP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=connect ECONNREFUSED 127.0.0.1:5672 | comp=IoTAgent
time=2023-04-20T14:30:25.723Z | lvl=FATAL | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.IOTAMService | from=n/a | srv=n/a | subsrv=n/a | msg=GLOBAL-002: Couldn't connect with MQTT broker: {"errno":-61,"code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":1883} | comp=IoTAgent
time=2023-04-20T14:30:25.723Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=MQTT Client closed | comp=IoTAgent
time=2023-04-20T14:30:25.723Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=MQTT Client closed connected? false | comp=IoTAgent
time=2023-04-20T14:30:25.723Z | lvl=WARN | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=reconnecting #2.. | comp=IoTAgent
time=2023-04-20T14:30:30.732Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.AMQP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=creating connnection | comp=IoTAgent
time=2023-04-20T14:30:30.740Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=creating connection | comp=IoTAgent
time=2023-04-20T14:30:30.750Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=connected | comp=IoTAgent
time=2023-04-20T14:30:30.755Z | lvl=ERROR | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.AMQP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=connect ECONNREFUSED 127.0.0.1:5672 | comp=IoTAgent
time=2023-04-20T14:30:30.757Z | lvl=FATAL | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.IOTAMService | from=n/a | srv=n/a | subsrv=n/a | msg=GLOBAL-002: Couldn't connect with MQTT broker: {"errno":-61,"code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":1883} | comp=IoTAgent
time=2023-04-20T14:30:30.757Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=MQTT Client closed | comp=IoTAgent
time=2023-04-20T14:30:30.758Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=MQTT Client closed connected? false | comp=IoTAgent
time=2023-04-20T14:30:30.758Z | lvl=WARN | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=reconnecting #3.. | comp=IoTAgent
time=2023-04-20T14:30:30.984Z | lvl=DEBUG | corr=7d9eb21b-9283-4f1e-9105-78795b478467 | trans=7d9eb21b-9283-4f1e-9105-78795b478467 | op=IOTAUL.HTTP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=Parsing payload [x|52|y|13|z|12] | comp=IoTAgent
time=2023-04-20T14:30:30.984Z | lvl=DEBUG | corr=7d9eb21b-9283-4f1e-9105-78795b478467 | trans=7d9eb21b-9283-4f1e-9105-78795b478467 | op=IOTAUL.HTTP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=Parsed data: [[{"x":"52","y":"13","z":"12"}]] | comp=IoTAgent
time=2023-04-20T14:30:30.984Z | lvl=DEBUG | corr=7d9eb21b-9283-4f1e-9105-78795b478467 | trans=7d9eb21b-9283-4f1e-9105-78795b478467 | op=IOTAUL.HTTP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=Processing multiple HTTP measures for device [gps1] with apiKey ["801230BJKL23Y9090DSFL123HJK09H324HV8733"] | comp=IoTAgent
time=2023-04-20T14:30:30.985Z | lvl=DEBUG | corr=7d9eb21b-9283-4f1e-9105-78795b478467 | trans=7d9eb21b-9283-4f1e-9105-78795b478467 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=n/a | subsrv=n/a | msg=Looking for group params ["resource","apikey"] with queryObj {"resource":"/iot/d","apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733"} | comp=IoTAgent
time=2023-04-20T14:30:31.001Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=service | subsrv=/subservice | msg=Device group data found: {"_id":"64414c81a3ba5b772e58c2a0","commands":[],"lazy":[],"resource":"/iot/d","apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733","type":"GPS","service":"service","subservice":"/subservice","trust":"8970A9078A803H3BL98PINEQRW8342HBAMS","cbHost":"http://localhost:1026","explicitAttrs":true} | comp=IoTAgent
time=2023-04-20T14:30:31.001Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.MongoDBDeviceRegister | from=n/a | srv=service | subsrv=/subservice | msg=Looking for device with id [gps1]. | comp=IoTAgent
time=2023-04-20T14:30:31.010Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.MongoDBDeviceRegister | from=n/a | srv=service | subsrv=/subservice | msg=Device [gps1] not found. | comp=IoTAgent
time=2023-04-20T14:30:31.011Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.MongoDBDeviceRegister | from=n/a | srv=service | subsrv=/subservice | msg=Looking for device with id [gps1]. | comp=IoTAgent
time=2023-04-20T14:30:31.019Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.MongoDBDeviceRegister | from=n/a | srv=service | subsrv=/subservice | msg=Device [gps1] not found. | comp=IoTAgent
time=2023-04-20T14:30:31.019Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=n/a | subsrv=n/a | msg=Looking for group params ["service","subservice","type","apikey"] with queryObj {"service":"service","subservice":"/subservice","type":"GPS","apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733"} | comp=IoTAgent
time=2023-04-20T14:30:31.041Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=service | subsrv=/subservice | msg=Device group data found: {"_id":"64414c81a3ba5b772e58c2a0","commands":[],"lazy":[],"resource":"/iot/d","apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733","type":"GPS","service":"service","subservice":"/subservice","trust":"8970A9078A803H3BL98PINEQRW8342HBAMS","cbHost":"http://localhost:1026","explicitAttrs":true} | comp=IoTAgent
time=2023-04-20T14:30:31.041Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.DeviceService | from=n/a | srv=service | subsrv=/subservice | msg=Device name not found, falling back to deviceType:deviceId [GPS:gps1] | comp=IoTAgent
time=2023-04-20T14:30:31.041Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.DeviceService | from=n/a | srv=service | subsrv=/subservice | msg=deviceData before merge with conf: {"id":"gps1","service":"service","subservice":"/subservice","type":"GPS","transport":"HTTP","explicitAttrs":true,"apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733","name":"GPS:gps1"} | comp=IoTAgent
time=2023-04-20T14:30:31.041Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.DeviceService | from=n/a | srv=service | subsrv=/subservice | msg=deviceData after merge with conf: {"id":"gps1","service":"service","subservice":"/subservice","type":"GPS","transport":"HTTP","explicitAttrs":true,"apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733","name":"GPS:gps1","lazy":[],"active":null,"staticAttributes":[],"commands":[],"subscriptions":[],"cbHost":"http://localhost:1026"} | comp=IoTAgent
time=2023-04-20T14:30:31.041Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.DeviceService | from=n/a | srv=service | subsrv=/subservice | msg=Registering device into NGSI Service:
{
    "id": "gps1",
    "service": "service",
    "subservice": "/subservice",
    "type": "GPS",
    "transport": "HTTP",
    "explicitAttrs": true,
    "apikey": "801230BJKL23Y9090DSFL123HJK09H324HV8733",
    "name": "GPS:gps1",
    "lazy": [],
    "active": null,
    "staticAttributes": [],
    "commands": [],
    "subscriptions": [],
    "cbHost": "http://localhost:1026"
} | comp=IoTAgent
time=2023-04-20T14:30:31.042Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Registration | from=n/a | srv=service | subsrv=/subservice | msg=Registration with Context Provider is not needed. Device without lazy atts or commands | comp=IoTAgent
time=2023-04-20T14:30:31.042Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Devices-v2 | from=n/a | srv=service | subsrv=/subservice | msg=deviceData: {"id":"gps1","service":"service","subservice":"/subservice","type":"GPS","transport":"HTTP","explicitAttrs":true,"apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733","name":"GPS:gps1","lazy":[],"active":null,"staticAttributes":[],"commands":[],"subscriptions":[],"cbHost":"http://localhost:1026"} | comp=IoTAgent
time=2023-04-20T14:30:31.042Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Devices-v2 | from=n/a | srv=service | subsrv=/subservice | msg=config.timestamp undefined true | comp=IoTAgent
time=2023-04-20T14:30:31.043Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Devices-v2 | from=n/a | srv=service | subsrv=/subservice | msg=Creating initial entity in the Context Broker:
 {
    "url": "http://localhost:1026/v2/entities?options=upsert",
    "method": "POST",
    "json": {
        "id": "GPS:gps1",
        "type": "GPS",
        "TimeInstant": {
            "type": "DateTime",
            "value": "2023-04-20T14:30:31.043Z"
        }
    },
    "headers": {
        "fiware-service": "service",
        "fiware-servicepath": "/subservice",
        "fiware-correlator": "c9eb9002-048c-4922-9bc9-424dda696999"
    }
} | comp=IoTAgent
time=2023-04-20T14:30:31.043Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.RestUtils | from=n/a | srv=service | subsrv=/subservice | msg=executeWithSecurity | comp=IoTAgent
time=2023-04-20T14:30:31.043Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=n/a | subsrv=n/a | msg=Looking for group params ["type"] with queryObj {"type":"GPS"} | comp=IoTAgent
time=2023-04-20T14:30:31.050Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=service | subsrv=/subservice | msg=Device group data found: {"_id":"64414c81a3ba5b772e58c2a0","commands":[],"lazy":[],"resource":"/iot/d","apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733","type":"GPS","service":"service","subservice":"/subservice","trust":"8970A9078A803H3BL98PINEQRW8342HBAMS","cbHost":"http://localhost:1026","explicitAttrs":true} | comp=IoTAgent
time=2023-04-20T14:30:31.050Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Request | from=n/a | srv=service | subsrv=/subservice | msg=Options: {
    "url": "http://localhost:1026/v2/entities?options=upsert",
    "method": "POST",
    "json": {
        "id": "GPS:gps1",
        "type": "GPS",
        "TimeInstant": {
            "type": "DateTime",
            "value": "2023-04-20T14:30:31.043Z"
        }
    },
    "headers": {
        "fiware-service": "service",
        "fiware-servicepath": "/subservice",
        "fiware-correlator": "c9eb9002-048c-4922-9bc9-424dda696999"
    }
} | comp=IoTAgent
time=2023-04-20T14:30:31.174Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Request | from=n/a | srv=service | subsrv=/subservice | msg=Response "" | comp=IoTAgent
time=2023-04-20T14:30:31.174Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Devices-v2 | from=n/a | srv=service | subsrv=/subservice | msg=Initial entity created successfully. | comp=IoTAgent
time=2023-04-20T14:30:31.178Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.MongoDBDeviceRegister | from=n/a | srv=service | subsrv=/subservice | msg=Storing device with id [gps1] and type [GPS] | comp=IoTAgent
time=2023-04-20T14:30:31.196Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.IoTUtils | from=n/a | srv=service | subsrv=/subservice | msg=deviceData before merge with conf: {"commands":[],"staticAttributes":[],"subscriptions":[],"_id":"64414c87a3ba5b772e58c2a1","creationDate":"2023-04-20T14:30:31.176Z","id":"gps1","type":"GPS","name":"GPS:gps1","service":"service","subservice":"/subservice","apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733","transport":"HTTP","explicitAttrs":true,"__v":0} | comp=IoTAgent
time=2023-04-20T14:30:31.196Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.IoTUtils | from=n/a | srv=service | subsrv=/subservice | msg=deviceData after merge with conf: {"commands":[],"staticAttributes":[],"subscriptions":[],"_id":"64414c87a3ba5b772e58c2a1","creationDate":"2023-04-20T14:30:31.176Z","id":"gps1","type":"GPS","name":"GPS:gps1","service":"service","subservice":"/subservice","apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733","transport":"HTTP","explicitAttrs":true,"__v":0,"lazy":[],"internalAttributes":null,"active":[],"cbHost":"http://localhost:1026"} | comp=IoTAgent
time=2023-04-20T14:30:31.197Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.NGSIService | from=n/a | srv=service | subsrv=/subservice | msg=executeWithDeviceInfo entityName GPS:gps1 type GPS apikey  attributes [{"name":"x","type":"string","value":"52"},{"name":"y","type":"string","value":"13"},{"name":"z","type":"string","value":"12"}] deviceInformation {"commands":[],"staticAttributes":[],"subscriptions":[],"_id":"64414c87a3ba5b772e58c2a1","creationDate":"2023-04-20T14:30:31.176Z","id":"gps1","type":"GPS","name":"GPS:gps1","service":"service","subservice":"/subservice","apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733","transport":"HTTP","explicitAttrs":true,"__v":0,"lazy":[],"internalAttributes":null,"active":[],"cbHost":"http://localhost:1026"} | comp=IoTAgent
time=2023-04-20T14:30:31.197Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=n/a | subsrv=n/a | msg=Looking for group params ["type"] with queryObj {"type":"GPS"} | comp=IoTAgent
time=2023-04-20T14:30:31.200Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.MongoDBGroupRegister | from=n/a | srv=service | subsrv=/subservice | msg=Device group data found: {"_id":"64414c81a3ba5b772e58c2a0","commands":[],"lazy":[],"resource":"/iot/d","apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733","type":"GPS","service":"service","subservice":"/subservice","trust":"8970A9078A803H3BL98PINEQRW8342HBAMS","cbHost":"http://localhost:1026","explicitAttrs":true} | comp=IoTAgent
time=2023-04-20T14:30:31.201Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.NGSIUtils | from=n/a | srv=service | subsrv=/subservice | msg=typeInformation {"commands":[],"staticAttributes":[],"subscriptions":[],"_id":"64414c87a3ba5b772e58c2a1","creationDate":"2023-04-20T14:30:31.176Z","id":"gps1","type":"GPS","name":"GPS:gps1","service":"service","subservice":"/subservice","apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733","transport":"HTTP","explicitAttrs":true,"__v":0,"lazy":[],"internalAttributes":null,"active":[],"cbHost":"http://localhost:1026","trust":"8970A9078A803H3BL98PINEQRW8342HBAMS"} | comp=IoTAgent
time=2023-04-20T14:30:31.201Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Entities-v2 | from=n/a | srv=service | subsrv=/subservice | msg=removeHiddenAttrs [ 'x', 'y', 'z' ] | comp=IoTAgent
time=2023-04-20T14:30:31.203Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Entities-v2 | from=n/a | srv=service | subsrv=/subservice | msg=typeInformation: {"commands":[],"staticAttributes":[],"subscriptions":[],"_id":"64414c87a3ba5b772e58c2a1","creationDate":"2023-04-20T14:30:31.176Z","id":"gps1","type":"GPS","name":"GPS:gps1","service":"service","subservice":"/subservice","apikey":"801230BJKL23Y9090DSFL123HJK09H324HV8733","transport":"HTTP","explicitAttrs":true,"__v":0,"lazy":[],"internalAttributes":null,"active":[],"cbHost":"http://localhost:1026","trust":"8970A9078A803H3BL98PINEQRW8342HBAMS"} | comp=IoTAgent
time=2023-04-20T14:30:31.203Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.Entities-v2 | from=n/a | srv=service | subsrv=/subservice | msg=Not updating device value in the Context Broker at [http://localhost:1026/v2/entities/GPS:gps1/attrs?type=GPS] due to empty payload 

[{
    "url": "http://localhost:1026/v2/entities/GPS:gps1/attrs?type=GPS",
    "method": "PATCH",
    "headers": {
        "fiware-service": "service",
        "fiware-servicepath": "/subservice"
    },
    "json": {}
}]

 | comp=IoTAgent
time=2023-04-20T14:30:31.203Z | lvl=INFO | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IOTAUL.HTTP.Binding | from=n/a | srv=service | subsrv=/subservice | msg=Multiple measures for device [gps1] with apiKey [801230BJKL23Y9090DSFL123HJK09H324HV8733] successfully updated | comp=IoTAgent
time=2023-04-20T14:30:31.203Z | lvl=DEBUG | corr=c9eb9002-048c-4922-9bc9-424dda696999 | trans=c9eb9002-048c-4922-9bc9-424dda696999 | op=IoTAgentNGSI.DomainControl | from=n/a | srv=service | subsrv=/subservice | msg=response-time: 11306 | comp=IoTAgent
time=2023-04-20T14:30:35.757Z | lvl=INFO | corr=n/a | trans=n/a | op=IOTAUL.AMQP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=creating connnection | comp=IoTAgent
time=2023-04-20T14:30:35.762Z | lvl=INFO | corr=n/a | trans=n/a | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=creating connection | comp=IoTAgent
time=2023-04-20T14:30:35.765Z | lvl=INFO | corr=n/a | trans=n/a | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=connected | comp=IoTAgent
time=2023-04-20T14:30:35.767Z | lvl=ERROR | corr=n/a | trans=n/a | op=IOTAUL.AMQP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=connect ECONNREFUSED 127.0.0.1:5672 | comp=IoTAgent
time=2023-04-20T14:30:35.768Z | lvl=FATAL | corr=n/a | trans=n/a | op=n/a | from=n/a | srv=n/a | subsrv=n/a | msg=GLOBAL-002: Couldn't connect with MQTT broker: {"errno":-61,"code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":1883} | comp=IoTAgent
time=2023-04-20T14:30:35.770Z | lvl=INFO | corr=n/a | trans=n/a | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=MQTT Client closed | comp=IoTAgent
time=2023-04-20T14:30:35.770Z | lvl=DEBUG | corr=n/a | trans=n/a | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=MQTT Client closed connected? false | comp=IoTAgent
time=2023-04-20T14:30:35.770Z | lvl=WARN | corr=n/a | trans=n/a | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=reconnecting #4.. | comp=IoTAgent
^Ctime=2023-04-20T14:30:36.352Z | lvl=INFO | corr=n/a | trans=n/a | op=IoTA-UL20.Agent | from=n/a | srv=n/a | subsrv=n/a | msg=Received SIGINT, starting shutdown processs | comp=IoTAgent
time=2023-04-20T14:30:36.353Z | lvl=INFO | corr=n/a | trans=n/a | op=IoTA-UL20.Agent | from=n/a | srv=n/a | subsrv=n/a | msg=Stopping IoT Agent:  | comp=IoTAgent
time=2023-04-20T14:30:36.353Z | lvl=INFO | corr=n/a | trans=n/a | op=IOTAUL.AMQP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=Stopping AMQP Binding | comp=IoTAgent
time=2023-04-20T14:30:36.353Z | lvl=INFO | corr=n/a | trans=n/a | op=IOTAUL.HTTP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=Stopping Ultralight HTTP Binding:  | comp=IoTAgent
time=2023-04-20T14:30:36.353Z | lvl=INFO | corr=n/a | trans=n/a | op=n/a | from=n/a | srv=n/a | subsrv=n/a | msg=Stopping MQTT Binding | comp=IoTAgent
time=2023-04-20T14:30:36.354Z | lvl=DEBUG | corr=n/a | trans=n/a | op=IOTAUL.MQTT.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=Generating topics | comp=IoTAgent
time=2023-04-20T14:30:36.355Z | lvl=FATAL | corr=n/a | trans=n/a | op=n/a | from=n/a | srv=n/a | subsrv=n/a | msg=GLOBAL-002: Couldn't connect with MQTT broker: {} | comp=IoTAgent
time=2023-04-20T14:30:36.355Z | lvl=INFO | corr=n/a | trans=n/a | op=n/a | from=n/a | srv=n/a | subsrv=n/a | msg=MQTT Binding Stopped | comp=IoTAgent
time=2023-04-20T14:30:36.355Z | lvl=INFO | corr=n/a | trans=n/a | op=IOTAUL.HTTP.Binding | from=n/a | srv=n/a | subsrv=n/a | msg=HTTP Binding Stopped | comp=IoTAgent
time=2023-04-20T14:30:36.357Z | lvl=INFO | corr=efe58104-869f-4d05-81b6-493bbeab561a | trans=efe58104-869f-4d05-81b6-493bbeab561a | op=IoTAgentNGSI.NorthboundServer | from=n/a | srv=service | subsrv=/subservice | msg=Stopping IoT Agent | comp=IoTAgent
time=2023-04-20T14:30:36.358Z | lvl=INFO | corr=efe58104-869f-4d05-81b6-493bbeab561a | trans=efe58104-869f-4d05-81b6-493bbeab561a | op=IoTAgentNGSI.NorthboundServer | from=n/a | srv=service | subsrv=/subservice | msg=Agent stopped | comp=IoTAgent

mapedraza avatar Apr 20 '23 14:04 mapedraza

Maybe, as a workaround, you can try adding entity_type to multientity attrs

AlvaroVega avatar Apr 21 '23 07:04 AlvaroVega

In group provision type is double defined as Light and as GPS, what is the right value?

Using just Ligth as type:

Screenshot from 2023-04-21 10-03-43

I've obtained:

Screenshot from 2023-04-21 10-02-48

Is this not right?

AlvaroVega avatar Apr 21 '23 07:04 AlvaroVega

This multientity tests: https://github.com/telefonicaid/iotagent-node-lib/blob/7b7c9506bec8db6a29ac8ef3a193e969f09334e6/test/unit/ngsiv2/plugins/multientity-plugin_test.js#L664-L695

is expecting that Iota sends CB a empty entity: https://github.com/telefonicaid/iotagent-node-lib/blob/7b7c9506bec8db6a29ac8ef3a193e969f09334e6/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin4.json#L1-L16

AlvaroVega avatar Apr 21 '23 10:04 AlvaroVega

After reviewing the issue again for a second time, the issue is still valid:

The following situations trigger an empty update:

  • Using explicitAttrs, when measures arrive but no one is define on the attribute list
  • Using multientity, when measures arrive but no one belongs to main entity.

mapedraza avatar Apr 21 '23 10:04 mapedraza