[Metadata] No dependency check for support-notifications on startup #3768
Labels
2-medium
priority denoting issues with cross-cutting project impact
bug
Something isn't working
help wanted
Extra attention is needed
Core Metadata has a notifications feature used to trigger notifications when devices are added. This feature is enabled by default and configured via the
[Notifications]
configuration stanza:Since the edgexfoundry snap disables support-notifications by default (as by there are no subscriptions configured)**, when devices are added, the follow error message is logged:
level=ERROR ts=2021-10-21T19:26:14.081557524Z app=core-metadata source=notify.go:53 msg="fail to invoke device service callback for adding device test-device-3, err: request failed, status code: 500, err: {\"apiVersion\":\"v2\",\"message\":\"driver.AddDevice callback failed for test-device-3 -\\u003e error adding device: ONVIF client could not be initialized: test-device-3\",\"statusCode\":500}"
Note, if the device being added defines secrets, then these need to be added before the device is added, as the call to notify support-notifications only happens if enabled and the callback to the device service succeeds.
If this Notifications.Enabled=true, then Core Metadata should check (via go-mod-bootstrap) that Support Notifications is available on startup.
Steps to reproduce
Note, these steps could be simplified by using a different device-service snap which doesn't require secrets, but this is how I managed to reproduce this today.
add-camera-secrets.sh:
On an Ubuntu system:
The last command will display system logs continuously until you exit via Ctrl-C.
Use the UI to a device:
$ sudo snap install edgex-ui --edge
Now open the UI in a browser using the URL:
http://localhost:4000
, and add a device to the device-camera service using the following values:** We also should consider disabling this notifications by default, as it makes no sense to send a notification to Support Notifications unless someone has explicitly created at least a single subscription for this event.
Version: 2.0.1-dev.68
Deployment: snap
The text was updated successfully, but these errors were encountered: