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

Error in subscription notifications when TROE is enabled #1715

Open
ravaga opened this issue Dec 2, 2024 · 4 comments
Open

Error in subscription notifications when TROE is enabled #1715

ravaga opened this issue Dec 2, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@ravaga
Copy link

ravaga commented Dec 2, 2024

I've deployed (with @p4lik4ri) a dockerized Orion-LD instance with TROE enabled (-troe) and the TimescaleDB properly configured. Then, we have created an entity of type Vehicle and a Subscription with an MQTT endpoint.

{
    "id": "urn:ngsi-ld:vehicle:5g-car:2",
    "type": "Vehicle",
    "category": {
        "type": "Property",
        "value": [
            "specialUsage",
            "Tracked"
        ]
    },
    "vehicleType": {
        "type": "Property",
        "value": "car"
    },
    "name": {
        "type": "Property",
        "value": "pi"
    },
    "vehiclePlateIdentifier": {
        "type": "Property",
        "value": "ncsrd"
    },
    "location": {
        "type": "GeoProperty",
        "value": {
            "type": "Point",
            "coordinates": [
                94.0913,
                38.1031
            ]
        }
    },
    "move": {
        "type": "Property",
        "value": true
    },
    "direction": {
        "type": "Property",
        "value": 40
    },
    "heading": {
        "type": "Property",
        "value": "188 degrees"
    },
    "owner": {
        "type": "Relationship",
        "object": "urn:ngsi-ld:Organization:NCSRD"
    },
    "areaServed": {
        "type": "Property",
        "value": "NCSRD-IIT"
    },
    "serviceStatus": {
        "type": "Property",
        "value": "parked"
    },
    "distanceCollision": {
        "type": "Property",
        "value": 543333
    },
    "signalQuality": {
        "type": "Property",
        "value": "0"
    },
    "cargoWeight": {
        "type": "Property",
        "value": 0.5
    },
    "speed": {
        "type": "Property",
        "value": 89
    }
}
{
    "id": "urn:aeros:subscription:car:test",
    "type": "Subscription",
    "description": "Subscription to Vehicle entity type for the demo",
    "entities": [
        {
            "id": "urn:ngsi-ld:vehicle:5g-car:2",
            "type": "Vehicle"
        }
    ],
    "watchedAttributes": [
        "distanceCollision"
    ],
    "notification": {
        "attributes": [
            "distanceCollision"
        ],
        "format": "normalized",
        "endpoint": {
            "uri": "mqtt://10.220.2.101:30083/example",
            "accept": "application/json"
        }
    }
}

However, when we modify the distanceCollision attribute, the broker crashes without displaying any error message in the logs, the notification isn't sent (although we can check in the logs of the Mosquitto server that the broker has tried to connect to it) and the failure isn't registered in the Subscription (status, isActive ... attributes are not creates).
image
image

Finally, if we restart the broker without the TROE enabled, the notifications are properly sent to the MQTT topic. However, if we restart the broker with the TROE enabled again, the notifications sometimes are sent (and the broker doesn't crash) but without including the value of the distanceCollision attribute.

{
  "metadata": {
    "Content-Type": "application/json",
    "User-Agent": "orionld/post-v1.7.0",
    "Host": "10.220.2.101:30083",
    "Accept": "application/json",
    "Ngsild-Attribute-Format": "Normalized",
    "Link": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld"
  },
  "body": {
    "id": "urn:ngsi-ld:Notification:af424890-b0c5-11ef-b29e-a623640fa18a",
    "type": "Notification",
    "subscriptionId": "urn:aeros:subscription:car:test",
    "notifiedAt": "2024-12-02T15:54:16.707Z",
    "data": [
      {
        "id": "urn:ngsi-ld:vehicle:5g-car:2",
        "type": "Vehicle"
      }
    ]
  }
}
@kzangeli kzangeli self-assigned this Dec 2, 2024
@kzangeli kzangeli added the bug Something isn't working label Dec 2, 2024
@kzangeli
Copy link
Collaborator

kzangeli commented Dec 3, 2024

ok, noted. Not sure I've ever tested TRoE and MQTT at the same time.
I will now :)

@ravaga
Copy link
Author

ravaga commented Dec 3, 2024

The issue happened also with HTTP notifications, so I think it might be a more global issue with the notifications + TRoE.

@kzangeli
Copy link
Collaborator

kzangeli commented Dec 3, 2024

So, started testing this.
All ok when creating the entity, but:
"However, when we modify the distanceCollision attribute"

I'm gonna need some more info there ... :)
Exactly how is the attribute modified?

@ravaga
Copy link
Author

ravaga commented Dec 3, 2024

We were sending a PATCH /entities/urn:ngsi-ld:vehicle:5g-car:2 with this body:

{
  "distanceCollision": {
    "type": "Property",
    "value": 525
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants