OPNsense Forum

Archive => 22.7 Legacy Series => Topic started by: marcog on November 04, 2022, 09:38:01 AM

Title: [SOLVED] PHP error Wireguard plugin after upgrading to 22.7.7
Post by: marcog on November 04, 2022, 09:38:01 AM
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}
Title: Re: PHP error Wireguard plugin after upgrading to 22.7.7
Post by: franco on November 04, 2022, 10:45:52 AM
I've made a note here https://github.com/opnsense/plugins/pull/3117#issuecomment-1303184716

Thanks for the report.


Cheers,
Franco
Title: Re: PHP error Wireguard plugin after upgrading to 22.7.7
Post by: Fright on November 05, 2022, 06:39:46 AM
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
Title: Re: PHP error Wireguard plugin after upgrading to 22.7.7
Post by: meyergru on November 05, 2022, 12:53:58 PM
Yup, and it can be applied by 'opnsense-patch -c plugins e807ec61bbddcf8834095f56d47e5c9e164d438b'.
Title: Re: PHP error Wireguard plugin after upgrading to 22.7.7
Post by: franco on November 06, 2022, 08:24:06 AM
That's a bit funny, of course you can abbreviate the commit hash for manual typing..

# opnsense-patch -c plugins e807ec61

;)
Title: Re: PHP error Wireguard plugin after upgrading to 22.7.7
Post by: marcog on November 07, 2022, 02:12:39 PM
Thanks everyone for the support. I'll mark the thread as solved