libremesh / lime-packages

LibreMesh packages configuring OpenWrt for wireless mesh networking
https://libremesh.org/
GNU Affero General Public License v3.0
281 stars 96 forks source link

hotplug-initd-observer error #1064

Open ilario opened 1 year ago

ilario commented 1 year ago

Observed the logs shared by @LaneaLucy in LibreMesh chat:


Fri Apr 28 09:41:28 2023 daemon.err hotplug-initd-observer[11153]: /usr/bin/lua: /usr/bin/hotplug-initd-observer:13: bad argument #3 to 'format' (string expected, got nil)
Fri Apr 28 09:41:28 2023 daemon.err hotplug-initd-observer[11153]: stack traceback:
Fri Apr 28 09:41:28 2023 daemon.err hotplug-initd-observer[11153]:  [C]: in function 'format'
Fri Apr 28 09:41:28 2023 daemon.err hotplug-initd-observer[11153]:  /usr/bin/hotplug-initd-observer:13: in function </usr/bin/hotplug-initd-observer:10>
Fri Apr 28 09:41:28 2023 daemon.err hotplug-initd-observer[11153]:  [C]: in function 'run'
Fri Apr 28 09:41:28 2023 daemon.err hotplug-initd-observer[11153]:  /usr/bin/hotplug-initd-observer:23: in main chunk
Fri Apr 28 09:41:28 2023 daemon.err hotplug-initd-observer[11153]:  [C]: ?
Fri Apr 28 09:41:30 2023 daemon.err hostapd: rmdir[ctrl_interface=/var/run/hostapd]: Permission denied
Fri Apr 28 09:41:35 2023 daemon.err babeld[2223]: send: Address not available
Fri Apr 28 09:41:38 2023 daemon.err hotplug-initd-observer[31750]: /usr/bin/lua: /usr/bin/hotplug-initd-observer:13: bad argument #3 to 'format' (string expected, got nil)
Fri Apr 28 09:41:38 2023 daemon.err hotplug-initd-observer[31750]: stack traceback:
Fri Apr 28 09:41:38 2023 daemon.err hotplug-initd-observer[31750]:  [C]: in function 'format'
Fri Apr 28 09:41:38 2023 daemon.err hotplug-initd-observer[31750]:  /usr/bin/hotplug-initd-observer:13: in function </usr/bin/hotplug-initd-observer:10>
Fri Apr 28 09:41:38 2023 daemon.err hotplug-initd-observer[31750]:  [C]: in function 'run'
Fri Apr 28 09:41:38 2023 daemon.err hotplug-initd-observer[31750]:  /usr/bin/hotplug-initd-observer:23: in main chunk
Fri Apr 28 09:41:38 2023 daemon.err hotplug-initd-observer[31750]:  [C]: ?
ilario commented 2 weeks ago

As inspected by @pony1k in #1068, this error happens when evData.service is nil. A possible solution is to replace evData.service with evData.service or '' in this line (untested): https://github.com/libremesh/lime-packages/blob/5a50b6f8571ec94f171214fc43add787fee0a6fc/packages/hotplug-initd-services/files/usr/bin/hotplug-initd-observer#L14

ilario commented 2 weeks ago

Seems that that SERVICE variable is used only here: https://github.com/libremesh/lime-packages/blob/08a3948a5a80f6e26318c96227e02466bd09345e/packages/shared-state-babeld_hosts/files/etc/hotplug.d/initd/shared-state-babeld_hosts#L6