openwisp / openwisp-config

OpenWRT configuration agent for OpenWISP Controller
https://openwisp.io/docs/dev/openwrt-config-agent/
GNU General Public License v3.0
374 stars 59 forks source link

[change] Show errors of openwisp-update-config #168

Closed nemesifier closed 2 years ago

nemesifier commented 2 years ago

I incurred in a case in which the following happens:

mkdir: can't create directory '/etc/openwisp/remote': No space left on device
tar: can't change directory to '/etc/openwisp/remote': No such file or directory
touch: /etc/openwisp/added.list: No space left on device
touch: /etc/openwisp/modified.list: No space left on device
lua: /usr/sbin/openwisp-update-config:155: /usr/lib/lua/openwisp/utils.lua:151: cannot open /etc/openwisp/remote: No such file or directory
stack traceback:
    [C]: in function '(for generator)'
    /usr/sbin/openwisp-update-config:155: in main chunk
    [C]: ?

However, from the OpenWrt syslog log (logread), the only error I saw was:

Tue Apr  5 01:28:47 2022 daemon.crit openwisp: Could not apply configuration, openwisp-update-config exit code was 1
Tue Apr  5 01:28:52 2022 daemon.info openwisp: Called post-reload-hook: /etc/openwisp/post-reload-hook - exit code: 0
Tue Apr  5 01:28:52 2022 daemon.info openwisp: The most recent configuration backup was restored

It would be great to show these type of errors in the log output.