FreePBX - there was an error - just minutes after fresh install

freepbx
v7

(HAYD3N) #1

NethServer Version: System version
NethServer release 7.5.1804 (final)
Module: FreePBX

installed the server 3 times till i got the hint… its not me its the nethserver…

everytime i install nethserver and i dont touch any settings or anything… minutes hours after i get an error that look strange

i have no idea how to explain it or how to so i uploaded a photo…

i want to think the issue is its AUTO updating thats why so maybe if i find away to turn off updates might work.


(Stefano Fancello) #2

Sometimes I’ve seen this, but wasn’t able to reproduce. I’ll try again.
meanwile, you can fix by launching
scl enable rh-php56 -- fwconsole chown


(Stefano Fancello) #3

also, disabling FreePBX modules auto updates is a bit tricky, on the enterprise we do it by overwriting the modules repository in the database. Remember that you are disabling also FreePBX security updates

mysql asterisk -e 'UPDATE `module_xml` SET `data` = "http://nethserver.org" WHERE id = "module_repo"'
mysql asterisk -e 'UPDATE `freepbx_settings` SET `value` = "http://nethserver.org" WHERE keyword = "MODULE_REPO"'

When you want to manually update modules, launch

# enable FreePBX mirrors to update modules
mysql asterisk -e 'UPDATE `module_xml` SET `data` = "http://mirror1.freepbx.org,http://mirror2.freepbx.org" WHERE id = "module_repo"'
mysql asterisk -e 'UPDATE `freepbx_settings` SET `value` = "http://mirror1.freepbx.org,http://mirror2.freepbx.org" WHERE keyword = "MODULE_REPO"'

# update all modules
scl enable rh-php56 -- fwconsole ma upgradeall

and then disable again


(HAYD3N) #4

it worked. amazing.


(HAYD3N) #5

this is the error i get after doing it… minutes later

PHP Parse error: syntax error, unexpected ‘class’ (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or ‘{’ or ‘$’ in /var/www/html/freepbx/admin/libraries/Composer/vendor/symfony/translation/Translator.php on line 90
Whoops\Exception\ErrorException: syntax error, unexpected ‘class’ (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or ‘{’ or ‘$’ in file /var/www/html/freepbx/admin/libraries/Composer/vendor/symfony/translation/Translator.php on line 90
Stack trace:

  1. Whoops\Exception\ErrorException->() /var/www/html/freepbx/admin/libraries/Composer/vendor/symfony/translation/Translator.php:90

(Stefano Fancello) #6

where do you get this error?

take a look at this issue: https://github.com/NethServer/dev/issues/5499 if you have nethserver-freepbx at version 14.0.10-1 it should be fixed. (check with rpm -ql nethserver-freepbx)

if you get it in AGI, it should be fixed for AGI that uses #!/usr/bin/env php as shebang, two FreePBX AGI doesn’t, I’ve PR for that but they didn’t merged yet https://github.com/FreePBX/calendar/pull/3 and https://github.com/FreePBX/recordings/pull/5. Meanwhile you can manually change those AGI, you found them in /var/lib/asterisk/agi-bin/

Another workaround you can do is this:
edit /var/www/html/freepbx/admin/libraries/Composer/vendor/symfony/translation/Translator.php
and change line 90

-            @trigger_error(sprintf('Passing a "%s" instance into the "%s" as a second argument is deprecated since Symfony 3.4 and will be removed in 4.0. Inject a "%s" implementation instead.', MessageSelector::class, __METHOD__, MessageFormatterInterface::class), E_USER_DEPRECATED);
+            @trigger_error(sprintf('Passing a "%s" instance into the "%s" as a second argument is deprecated since Symfony 3.4 and will be removed in 4.0. Inject a "%s" implementation instead.', 'MessageSelector::class', __METHOD__, 'MessageFormatterInterface::class'), E_USER_DEPRECATED);

Php update to 7.X?
(HAYD3N) #7

all working… turns out i just had to re-install and once i used the info above all worked no issues since.