PHP7 breaks nethgui

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


[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}

See the system log for details.

And the Email Addresses tab under Management errors


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.


[Wed Jan 24 09:38:00.384894 2018] [php7:error] [pid 2564] [client] [ERROR] Nethgui\Framework: CSRF token verification failed!, referer:

1 Like

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


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

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

default is php54

fortunately I did not change some code there :confused:

1 Like

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

Interesting, this is a year ago - There is definitely interest in running a newer version of php now that some packages require php56 as a minimum, and recommend php7 (nextcloud 15 comes to mind…)

Does anyone know if this issue has been resolved?

Also, kind of an aside, but does Nethserver have an official bug reporting / tracking page, like on github or bugzilla or something?

Thanks :slight_smile:

Oh yes #bug :wink:

Ahhhhh, yes … sorry, I have a hard time seeing things that are right in front of my face (my girlfriend is always making fun of me for it)

Thank you! :slight_smile: