Closed dvescovi1 closed 4 years ago
I suspect some of this has to do with differences in users and permissions. While the raspberry pi is a true Debian system yocto usually does not normally have "users" per se. Could this be the issue?
So if the issue is with that module and you've already opened a bug there, do you need us to do anything?
HI @dvescovi1, i agree with @arsing that it looks like an issue with the node red module. If you confirm this, could you please close this item and track the issue in the node red github site? Thanks!
unfortunately I have not been able to narrow it down any further. Present thinking is it is showing some similar symptoms to the "stability on constrained devices" as expressed in several iotedge bug reports/Bug fixes I been reading about. Out of desperation I tried upgrading to azureiotedge-hub:1.2.0-rc1 and I noticed the hub module failing in a very similar manor (network disconnecting with Not authorized failure) this with ONLY the agent and hub module loaded. I have also verified by building yocto images for both the rasberry pi and my iMX8 device both using the exact same components. i.e. meta-iotedge, meta-rust, poky and meta-virtualization using same component build SHA hash so the only delta is the actual low level BSP code (zeus raspberry pi BSP vs. zeus freescale BSP). raspberry pi works but iMX8 fails when node red module is deployed the exact same way on both.
Is there anyone familiar with the NXP iMX IotEdge or similar device port I could converse with?
this info from the "iotedge logs NoderedModule" upon failure seems to provide the best clue:
29 Oct 22:18:38 - [info] Server now running at http://127.0.0.1:1880/
29 Oct 22:18:38 - [info] [edgeclient:982d18c.4c939e8] Module Client created.
29 Oct 22:18:38 - [info] [edgeclient:982d18c.4c939e8] Module Client open error:UnauthorizedError: mqtt.js returned Failure on first connection (Not authorized): connect ECONNREFUSED 172.18.0.2:8883 error
29 Oct 22:18:38 - [red] Uncaught Exception:
29 Oct 22:18:38 - UnauthorizedError: mqtt.js returned Failure on first connection (Not authorized): connect ECONNREFUSED 172.18.0.2:8883 error
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-red-docker@1.1.3 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-red-docker@1.1.3 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /data/.npm/_logs/2020-10-29T22_18_38_769Z-debug.log
doing the exact same on the working raspberry pi yields this log:
29 Oct 21:03:49 - [info] Server now running at http://127.0.0.1:1880/
29 Oct 21:03:49 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
29 Oct 21:03:49 - [info] Starting flows
29 Oct 21:03:49 - [info] Started flows
29 Oct 21:03:50 - [info] [edgeclient:c4bf0ff5.466fc] Module Client created.
29 Oct 21:03:51 - [info] [edgeclient:c4bf0ff5.466fc] Module Client connected.
29 Oct 21:03:51 - [info] [moduleoutput:c9647f34.c958d] Module Output created: output1
29 Oct 21:03:51 - [info] [modulemethod:7e44a36f.ef59fc] Direct Method created: setValue
29 Oct 21:03:51 - [info] [moduleinput:17bd1ad3.c82555] Module Input created: input1
29 Oct 21:03:51 - [info] [moduleoutput:4f5c1206.7d5eec] Module Output created: output2
this log file is from same device (imx8) with ONLY hub and agent modules trying to run (1.2.0-rc1). There is no third party module at all. ,,,
<6> 2020-11-14 03:53:21.907 +00:00 [INF] - Installing certificates [CN=iotedged workload ca:02/12/2021 02:32:17],[CN=Test Edge Device CA:02/12/2021 02:32:17],[CN=Test Edge Owner CA:02/12/2021 02:32:17] to Root <6> 2020-11-14 03:53:22.041 +00:00 [INF] - Installing certificates [CN=Test Edge Owner CA:02/12/2021 02:32:17] to Root <6> 2020-11-14 03:53:22.056 +00:00 [INF] - Enabling SSL protocols: Tls, Tls11, Tls12 <6> 2020-11-14 03:53:22.445 +00:00 [INF] - Experimental features configuration: {"Enabled":false,"DisableCloudSubscriptions":false,"DisableConnectivityCheck":false,"EnableNestedEdge":false,"EnableMqttBroker":false} <6> 2020-11-14 03:53:24.088 +00:00 [INF] - Created persistent store at /tmp/edgeHub <6> 2020-11-14 03:53:24.252 +00:00 [INF] - Initializing Edge Hub <6> 2020-11-14 03:53:24.253 +00:00 [INF] - █████╗ ███████╗██╗ ██╗██████╗ ███████╗ ██╔══██╗╚══███╔╝██║ ██║██╔══██╗██╔════╝ ███████║ ███╔╝ ██║ ██║██████╔╝█████╗ ██╔══██║ ███╔╝ ██║ ██║██╔══██╗██╔══╝ ██║ ██║███████╗╚██████╔╝██║ ██║███████╗ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ██╗ ██████╗ ████████╗ ███████╗██████╗ ██████╗ ███████╗ ██║██╔═══██╗╚══██╔══╝ ██╔════╝██╔══██╗██╔════╝ ██╔════╝ ██║██║ ██║ ██║ █████╗ ██║ ██║██║ ███╗█████╗ ██║██║ ██║ ██║ ██╔══╝ ██║ ██║██║ ██║██╔══╝ ██║╚██████╔╝ ██║ ███████╗██████╔╝╚██████╔╝███████╗ ╚═╝ ╚═════╝ ╚═╝ ╚══════╝╚═════╝ ╚═════╝ ╚══════╝ <6> 2020-11-14 03:53:24.258 +00:00 [INF] - Version - 1.2.0-rc1.36607244 (dd8b529d67fcc0fc5adaa92ecf4d1758dfed4eaf) <6> 2020-11-14 03:53:24.259 +00:00 [INF] - OptimizeForPerformance=False <6> 2020-11-14 03:53:24.259 +00:00 [INF] - MessageAckTimeoutSecs=30 <6> 2020-11-14 03:53:24.262 +00:00 [INF] - Loaded server certificate with expiration date of "2021-02-12T02:32:17.0000000+00:00" <6> 2020-11-14 03:53:24.295 +00:00 [INF] - Using Asp Net server for metrics <6> 2020-11-14 03:53:24.407 +00:00 [INF] - Started task to cleanup processed and stale messages <6> 2020-11-14 03:53:24.506 +00:00 [INF] - Created new message store <6> 2020-11-14 03:53:24.694 +00:00 [INF] - Created device scope identities cache <6> 2020-11-14 03:53:24.724 +00:00 [INF] - Starting refresh of device scope identities cache <6> 2020-11-14 03:53:24.802 +00:00 [INF] - Created DeviceConnectivityManager with connected check frequency 00:05:00 and disconnected check frequency 00:02:00 <6> 2020-11-14 03:53:24.918 +00:00 [INF] - Initialized storing twin manager <6> 2020-11-14 03:53:24.960 +00:00 [INF] - Initializing configuration <6> 2020-11-14 03:53:25.021 +00:00 [INF] - New device connection for device imx8mmevk-manual-2/$edgeHub <6> 2020-11-14 03:53:25.028 +00:00 [INF] - Client imx8mmevk-manual-2/$edgeHub connected to edgeHub, processing existing subscriptions. <6> 2020-11-14 03:53:25.177 +00:00 [INF] - Attempting to connect to IoT Hub for client imx8mmevk-manual-2/$edgeHub via AMQP... <6> 2020-11-14 03:53:25.260 +00:00 [INF] - Processing pending subscriptions for imx8mmevk-manual-2/$edgeHub <6> 2020-11-14 03:53:26.319 +00:00 [INF] - Starting timer to authenticate connections with a period of 300 seconds <6> 2020-11-14 03:53:26.352 +00:00 [INF] - Experimental features configuration: {"Enabled":false,"DisableCloudSubscriptions":false,"DisableConnectivityCheck":false,"EnableNestedEdge":false,"EnableMqttBroker":false} <6> 2020-11-14 03:53:26.490 +00:00 [INF] - No routes set in the edge hub <6> 2020-11-14 03:53:26.494 +00:00 [INF] - Updated message store TTL to 7200 seconds <6> 2020-11-14 03:53:26.496 +00:00 [INF] - Updated the edge hub store and forward configuration <6> 2020-11-14 03:53:26.603 +00:00 [INF] - Started operation Get EdgeHub config <6> 2020-11-14 03:53:26.606 +00:00 [INF] - Initialized edge hub configuration <6> 2020-11-14 03:53:26.635 +00:00 [INF] - Scheduling server certificate renewal for "2021-02-12T02:29:47.0015053Z". <6> 2020-11-14 03:53:26.641 +00:00 [INF] - Starting protocol heads - (MQTT, AMQP, HTTP) <6> 2020-11-14 03:53:26.652 +00:00 [INF] - Starting MQTT head <6> 2020-11-14 03:53:26.798 +00:00 [INF] - Initializing TLS endpoint on port 8883 for MQTT head. <6> 2020-11-14 03:53:26.831 +00:00 [INF] - Done refreshing device scope identities cache. Waiting for 60 minutes. <6> 2020-11-14 03:53:27.033 +00:00 [INF] - Starting AMQP head <6> 2020-11-14 03:53:27.072 +00:00 [INF] - Started MQTT head <6> 2020-11-14 03:53:27.309 +00:00 [INF] - Started AMQP head <6> 2020-11-14 03:53:27.316 +00:00 [INF] - Starting HTTP head <6> 2020-11-14 03:53:27.641 +00:00 [INF] - Exiting disconnected state <6> 2020-11-14 03:53:27.719 +00:00 [INF] - Received device connected callback <6> 2020-11-14 03:53:27.749 +00:00 [INF] - Device connected to cloud, processing subscriptions for connected clients. <6> 2020-11-14 03:53:27.759 +00:00 [INF] - Processing subscriptions for client imx8mmevk-manual-2/$edgeHub on device connected to cloud. <6> 2020-11-14 03:53:27.760 +00:00 [INF] - Skipping imx8mmevk-manual-2/$edgeHub for subscription processing, as it is currently being processed. <6> 2020-11-14 03:53:27.770 +00:00 [INF] - Device scope identities refresh is ready because a refresh was signalled. <6> 2020-11-14 03:53:27.770 +00:00 [INF] - Starting refresh of device scope identities cache <6> 2020-11-14 03:53:27.810 +00:00 [INF] - Entering connected state <6> 2020-11-14 03:53:27.834 +00:00 [INF] - Cloud connection for imx8mmevk-manual-2/$edgeHub is True <6> 2020-11-14 03:53:27.849 +00:00 [INF] - Connection status for imx8mmevk-manual-2/$edgeHub changed to ConnectionEstablished <6> 2020-11-14 03:53:27.855 +00:00 [INF] - Client imx8mmevk-manual-2/$edgeHub connected to cloud, processing existing subscriptions. <6> 2020-11-14 03:53:27.856 +00:00 [INF] - Skipping imx8mmevk-manual-2/$edgeHub for subscription processing, as it is currently being processed. <6> 2020-11-14 03:53:27.867 +00:00 [INF] - Created cloud proxy for client imx8mmevk-manual-2/$edgeHub via AMQP, with client operation timeout 20 seconds. <6> 2020-11-14 03:53:27.900 +00:00 [INF] - Initialized cloud proxy 238a9aba-db6d-4068-85f6-dc19090121ea for imx8mmevk-manual-2/$edgeHub <6> 2020-11-14 03:53:27.907 +00:00 [INF] - Created cloud connection for client imx8mmevk-manual-2/$edgeHub <4> 2020-11-14 03:53:28.241 +00:00 [WRN] - Overriding address(es) '"http://+:80"'. Binding to endpoints defined in "UseKestrel()" instead. <0> 2020-11-14 03:53:28.300 +00:00 [FTL] - Unable to start Kestrel. System.Net.Sockets.SocketException (13): Permission denied at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Bind(EndPoint localEP) at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.Bind() at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportFactory.BindAsync(EndPoint endpoint, CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.<>c__DisplayClass21_0`1.<@dvescovi1 For Edge hub 1.2.0-rc1 on imx8, see #9. Edge hub runs as a non-privileged user, which would normally mean it can't bind to ports below 1024 (e.g., 443), except we build it with CAP_NET_BIND_SERVICE
. So your operating system needs to support that capability.
Closing this issue since the 1st part is specific to a 3rd-party module, and the 2nd part was filed separately as #3974.
2926 Expected Behavior
NoderedModule should start
Current Behavior
NoderedModule does not start with some kind of authentication issue on iMX8Mmini evk board. See documented issue here
Steps to Reproduce
Provide a detailed set of steps to reproduce the bug.
Context (Environment)
Output of
iotedge check
see attached logs here
Device Information
Runtime Versions
iotedge version
]: 1.0.8docker version
]: 18.99.0Note: when using Windows containers on Windows, run
docker -H npipe:////./pipe/iotedge_moby_engine version
insteadLogs
see attached logs here
Additional Information
Please provide any additional information that may be helpful in understanding the issue.