[SOLVED] PHP error Wireguard plugin after upgrading to 22.7.7

Started by marcog, November 04, 2022, 09:38:01 AM

Previous topic - Next topic
Hi,
after upgrading to 22.7.7 I noticed this error in the reporter, (this seems to persist even in 22.7.7_1:

[04-Nov-2022 09:30:45 Europe/Rome] TypeError: array_merge(): Argument #1 must be of type array, null given in /usr/local/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/GeneralController.php:93
Stack trace:
#0 /usr/local/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/GeneralController.php(93): array_merge(NULL, Array)
#1 [internal function]: OPNsense\Wireguard\Api\GeneralController->getStatusAction()
#2 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->callActionMethod(Object(OPNsense\Wireguard\Api\GeneralController), 'getStatusAction', Array)
#3 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->dispatch()
#4 /usr/local/opnsense/www/api.php(24): Phalcon\Mvc\Application->handle('/api/wireguard/...')
#5 {main}
[04-Nov-2022 09:31:03 Europe/Rome] TypeError: array_merge(): Argument #1 must be of type array, null given in /usr/local/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/GeneralController.php:93
Stack trace:
#0 /usr/local/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/GeneralController.php(93): array_merge(NULL, Array)
#1 [internal function]: OPNsense\Wireguard\Api\GeneralController->getStatusAction()
#2 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->callActionMethod(Object(OPNsense\Wireguard\Api\GeneralController), 'getStatusAction', Array)
#3 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->dispatch()
#4 /usr/local/opnsense/www/api.php(24): Phalcon\Mvc\Application->handle('/api/wireguard/...')
#5 {main}


November 05, 2022, 06:39:46 AM #2 Last Edit: November 05, 2022, 09:12:01 AM by Fright
I can't quickly check, but maybe just a typo at L54: getAttributes()?

UPD: sorry. look like there is already a fix pr
https://github.com/opnsense/plugins/pull/3180

Yup, and it can be applied by 'opnsense-patch -c plugins e807ec61bbddcf8834095f56d47e5c9e164d438b'.
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005

1100 down / 800 up, Bufferbloat A+

That's a bit funny, of course you can abbreviate the commit hash for manual typing..

# opnsense-patch -c plugins e807ec61

;)

Thanks everyone for the support. I'll mark the thread as solved