Orion Context Broker订阅数据回调失败排查求助
Hey there, let's walk through how to diagnose why your accumulator server isn't receiving data from Orion, even though your subscription shows up in both Orion and MongoDB. Here's a step-by-step breakdown of checks you can do:
Verify network connectivity between Orion and accumulator
Since you're using nested VMs, network issues are the most likely culprit. Log into the nested VM running Orion and run these tests:- Use
curl http://10.224.24.236:1028/accumulateto see if you can reach the accumulator endpoint. If you get a connection timeout or "connection refused" error, the problem is in your network setup. - Check if the nested VM's network mode is set correctly (bridge mode is usually best for cross-device connectivity). Also, confirm that firewalls on the accumulator's host, the Orion VM, and the physical host aren't blocking port 1028.
- Use
Inspect Orion's logs for notification activity
For Orion 1.9.0 (package-installed), logs are typically at/var/log/contextBroker/contextBroker.log. Look for entries like:sending notification to http://10.224.24.236:1028/accumulate(confirms Orion is trying to send data)- Errors like
connection timeoutorfailed to send notification(points to network or accumulator issues)
Also, remember: Orion only sends notifications when the subscribed attributes (temperature,pressure) are updated. If you haven't modified theSensor_GV_01entity's values since creating the subscription, Orion won't trigger any notifications.
Check the accumulator server's logs
Whether your accumulator is running on a VM or physical Ubuntu device, check its logs for incoming requests. If you see no request records at all, that means Orion isn't reaching it (network or Orion-side issue). If there are error logs for incoming requests, you'll need to debug the accumulator's configuration or code.Manually trigger a notification to test the flow
Force an update to the subscribed entity to see if Orion sends a notification. Run this command from any machine that can reach your Orion instance (replace<orion-vm-ip>with your nested VM's IP):curl -X PUT http://<orion-vm-ip>:1026/v2/entities/Sensor_GV_01/attrs/temperature \ -H "Content-Type: application/json" \ -d '{"value": 26.0, "type": "Number"}'Immediately check Orion's logs for notification attempts and your accumulator for incoming data. This will confirm if the subscription trigger logic is working.
Check for known bugs in Orion 1.9.0
Orion 1.9.0 is a fairly old release (circa 2018) and may have unresolved bugs related to notification delivery, especially in nested VM environments. Consider upgrading to a newer stable version (like 3.x) after backing up your data—this often fixes compatibility issues with virtualized setups.Double-check the subscription's reference URL
Ensurehttp://10.224.24.236:1028/accumulateis accessible from the nested Orion VM. If your accumulator is running on the physical host and the nested VM uses NAT mode, you might need to use the host's internal private IP (e.g.,192.168.x.x) instead of a public/external IP.
内容的提问来源于stack exchange,提问作者sejego

