PHP7 breaks nethgui


(Joel Clendineng) #1

Ive been having issues with Email and DPI. The DPI tab errors

Summary

[1] Uncaught ArgumentCountError: Too few arguments to function Nethgui\System\NethPlatform::getTableAdapter(), 1 passed in /usr/share/nethesis/NethServer/Module/Ndpi.php on line 49 and at least 2 expected in /usr/share/nethesis/Nethgui/System/NethPlatform.php:157
Stack trace:
#0 /usr/share/nethesis/NethServer/Module/Ndpi.php(49): Nethgui\System\NethPlatform->getTableAdapter(‘NethServer::Dat…’)
#1 /usr/share/nethesis/Nethgui/Module/Composite.php(88): NethServer\Module\Ndpi->initialize()
#2 /usr/share/nethesis/Nethgui/Module/Main.php(75): Nethgui\Module\Composite->addChild(Object(NethServer\Module\Ndpi))
#3 /usr/share/nethesis/Nethgui/Framework.php(682): Nethgui\Module\Main->bind(Object(Nethgui\Controller\Request))
#4 /usr/share/nethesis/Nethgui/Framework.php(590): Nethgui\Framework->handle(Object(Nethgui\Controller\Request))
#5 /usr/share/nethesis/nethserver-manager/index.php(99): Nethgui\Framework->dispatch(Object(Nethgui\Controller\Request))
#6 {main}
thrown

See the system log for details.

And the Email Addresses tab under Management errors

Summary

Jan 24 09:24:43 gateway httpd: [64] Cannot use lexical variable $view as a parameter name - File /usr/share/nethesis/NethServer/Module/MailAccount/User.php, line 80

Those errors are all I get in system log as well, but it looks to me like a php issue. I have php settings from steph installed, though I doubt thats the issue since it just started happening. I had just installed the email software from nethserver-testing, though it might just be a coincidence. I was on php7 but I switched back to default version, Ive uninstalled and reinstalled the modules (dpi, email) and rebooted, Im going to try a couple more things today and report back if Ive figured it out.

Edit: [php7:error] [pid 2563] [php7:error] [pid 2564] confirmed php issue, now to determine how I broke it

Found another error in the log, this is after switching to php7 from 56 as a test. Its back to default version now.

Summary

[Wed Jan 24 09:38:00.384894 2018] [php7:error] [pid 2564] [client 192.168.10.37:51709] [ERROR] Nethgui\Framework: CSRF token verification failed!, referer: https://192.168.10.1:980/en-US/PhpAdjustableValues


OpenDKIM for all
(Stéphane de Labrusse) #2

what is the output of
# rpm -qf /usr/share/nethesis/NethServer/Module/MailAccount/User.php


(Joel Clendineng) #3

nethserver-mail-server-1.11.0-1.ns7.noarch


(Stéphane de Labrusse) #4

do not run php7 for the whole server, maybe @davidep could have some clue why php7 broke nethgui


(Joel Clendineng) #5

Well, I switch to default/54 and issue still exists, maybe I need to switch then reboot.

Edit: looking at the problem code it looks like the php syntax is wrong for php7, so maybe I broke it by switching. I can try setting it to default 54 and rebooting and see if a clean boot fixes it.

Edit2: haha I cannot seem to get my php versions correct


(Stéphane de Labrusse) #6

default is php54


(Stéphane de Labrusse) #7

fortunately I did not change some code there :confused:


(Joel Clendineng) #8

Ok I fixed it by setting php to default and rebooting. Now I know ;D