-
Notifications
You must be signed in to change notification settings - Fork 44
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
The Orion LD dies on external targets of a notification. #1322
Comments
ok, that's interresting! There's two issues here though.
Issue 1, might be I need to add some flag to libcurl. Now, to help me reproduce, could you add the exact curl commends you do to see the errors?
For "both issues". Also, did you take a look inside the logfile? (/tmp/orionld.log). Might find something valuable in there. Pass me also ALL CLI params. "-mongocOnly" and ... what more? |
Log for 1. Unable to connect to notification endpoint:
curl for 1. add the subscribtion:
and the Entity update POST:
All the CLI parameter for orion-ld:
yes, for 2. is the only difference the endpoint |
ok, perfect. Now I have more to go on! |
Oh, the duplicate headers are due to our APISIX GW, there we currently still have to pass the old Fiware service header. Is it possible that your curl / libcurl only talks ipv6? |
Finally got some time to look at this issue! I created a new functest, as similar to your description as I could. I tried with both http and https for the notification endpoint (for http I use my own implementation and for https I use libcurl). With https:
With http:
One thing I just realized will not work with "my" implementation (http) is if you get a 302 Redirect. I haven't implemented the treatment of a 302. If you have 302s, then use https instead. Just until I get a chance to implement it (or, move to libcurl for http as well might be a good idea). That's all I have right now ... |
Hm, with the endpoint https://nodered.staging.addix.io/yvonne we have a HTTPS endpoint, which you could also use and which is accessible for tests. |
I did my tests with the very latest I'm working on right now but, those logs should be the exact same for you, if you use a not too old version of the broker. |
I have a local Docker installation set up and even with that via https I get a following error:
Important insight: if I have two subscriptions that respond to the same action, the first one, which works alone, fails.
|
ok, perfect. That's a very good clue. About "HTTP response code said error". I'll add better log messages there, to give more info. |
I cannot see what the answer to the request from Orion is. If I call the endpoint directly with curl I get the following: `url --location -v --request POST 'https://nodered.staging.addix.io/yvonne'
|
So, I found a bug that I fixed. Not sure it has anything to do with your problems, but still. Start your broker with Sorry it's taken me soooo long this time. I've been really swamped lately :( |
Very interesting: The logs in Docker, as I understand them, say something completely different.
Docker Logs: INFO@08:28:22 orionld.cpp[1065]: Orion Context Broker is running The http: endpoint received data We have not tested this in the cluster yet, but it will not behave differently. |
Looks pretty good. There's a It seems like the broker (my fault) is adding statistics amd timestamps to the wrong subscription! I will look into that. Never mind the statistics for now. Might just confuse us. Now, from what I can see, the HTTP notification went fine (I have no log messages about receiving the notification-response, unfortunately), while the HTTPS notification times out. The notification is sent, but no response comes back in time. |
Yes http works and the data arrives at the destination. |
So, I found and fixed a bug (it was an uninitialized variable making http notification ·"inherit" the curl handle from the previous https notification, and these curl handlkes are later used to look up the corresponding subscriptions to report the statistics). I also improved the logging for http/https notifications. New trace levels: 200-204. Perhaps the better logging can shed some light on the problem with https notifications ... |
ok, I have now tested this with the last version.
|
Arghh, I didn't think about http/https ... Anyway, if you give the port, you fix that problem. So, try it by setting the port and let me know (just add :443 after the IP address) |
it Works:
|
ok, good! |
We will then adopt the upcoming version into our cluster. Then we can continue testing with proper load ;-) |
What trace levels do we have available now, where did you document them, and how do we use them? |
Yes, it's a comma-separated list and it supports ranges, e,g,:
The "numbers" are defined in a header file: |
This issue is fixed, right? |
Yes,is fixed |
Our platform is a K8S in version 1.25.6
with a fiware/orion-ld:1.2.0-PRE-1255
the MongoDB is in version 6
we use the orion with -mongocOnly
We have the problem that we can't send subscriptions to a target outside our own namespace.
This is the subscribtion:
{ "id": "urn:ngsi-ld:subscription:8f6f80a4-a7a4-11ed-9cbf-16804aa0063b", "type": "Subscription", "subscriptionName": "Notify NR WeatherObserved zu addixio", "description": "NR WeatherObserved zu addixio", "entities": [ { "idPattern": "WeatherObserved", "type": "WeatherObserved" } ], "watchedAttributes": [ "dateObserved" ], "status": "active", "isActive": true, "notification": { "attributes": [ "location", "atmosphericPressure", "dateObserved" ], "format": "normalized", "endpoint": { "uri": "http://node-red-captn.captn.svc/yvonne", "accept": "application/json" }, "status": "failed", "timesSent": 2, "lastNotification": "2023-02-08T11:35:20.386Z", "lastFailure": "2023-02-08T11:35:20.386Z", "consecutiveErrors": 2, "lastErrorReason": "Unable to connect to notification endpoint" }, "origin": "cache" }
The error message is:
"lastErrorReason": "Unable to connect to notification endpoint".
If we use the following test curl from the POD shell we reach the target:
curl --location --request POST 'http://node-red-captn.captn.svc/yvonne' \ --header 'Content-Type: application/json' \ --data-raw '{ "TEST": "Test2" }'
And now it becomes critical, we replace the target in the subscribtion with a target outside the cluster and if the subscribtion is then triggered the orion-ld dies and is restarted by the K8S.
The following subscribtion lets the orion-ld die:
{ "id": "urn:ngsi-ld:subscription:ee6bc6c4-a79c-11ed-a95a-4227d0e0e9ae", "type": "Subscription", "subscriptionName": "Notify NR WeatherObserved zu addixio", "description": "NR WeatherObserved zu addixio", "entities": [ { "idPattern": "WeatherObserved", "type": "WeatherObserved" } ], "watchedAttributes": [ "dateObserved" ], "status": "active", "isActive": true, "notification": { "attributes": [ "location", "atmosphericPressure", "dateObserved" ], "format": "normalized", "endpoint": { "uri": "https://nodered.staging.addix.io/yvonne", "accept": "application/json" }, "status": "ok" }, "origin": "cache" }
Grüße aus Kiel ;-)
The text was updated successfully, but these errors were encountered: