Alfredo's picture

Error in define variables:

When I try to access the knowledge-based categories:

Fails! × compact(): Undefined variable: time

When I try to create new agent too:

Fails! × compact(): Undefined variable: assign

According to what I found on the internet the problem occurs with php7.3.

PHP7.3 is the one that is installed by default on v16.0.

 

Install and active php7.2 solve this problem. Apparently.

Forum: 
Jeremy Davis's picture

Thanks so much for reporting this. I'll have a closer look into it ASAP.

FWIW, the Faveo Helpdesk docs suggest that it should support PHP7.3.

I wonder if it's a missing PHP dependency? From a glance, I think we have them mostly covered. Except I note "ionCube Loaders v10.3 and above for PHP 7.3.x" in the list. That does not appear to be packaged for Debian?! So I don't think we're installing that! I'm not sure if that would cause the issue you've hit, but it needs further investigation anyway.

I'll set one up and see if I can reproduce the issue you've reported. Hopefully I can and we'll work it out. It's good to know that using PHP7.2 might be a workaround, but if we can find a proper fix that ensure's it's compatible with PHP7.3 would be better! :)

Jeremy Davis's picture

My instance isn't actually giving exactly the same errors, but close. I.e. in the browser I get "Sorry, something went wrong" and in the log (/var/www/faveo-helpdesk/storage/logs/laravel-2021-03-31.log) I have these errors:

[2021-03-31 00:36:06] production.ERROR: Command "horizon" is not defined. {"exception":"[object] (Symfony\\Component\\Console\\Exception\\CommandNotFoundException(code: 0): Command \"horizon\" is not defined. at /var/www/faveo-helpdesk/vendor/symfony/console/Application.php:632)
[2021-03-31 00:36:08] production.ERROR: Command "horizon" is not defined. {"exception":"[object] (Symfony\\Component\\Console\\Exception\\CommandNotFoundException(code: 0): Command \"horizon\" is not defined. at /var/www/faveo-helpdesk/vendor/symfony/console/Application.php:632)
[2021-03-31 00:36:09] production.ERROR: Command "horizon" is not defined. {"exception":"[object] (Symfony\\Component\\Console\\Exception\\CommandNotFoundException(code: 0): Command \"horizon\" is not defined. at /var/www/faveo-helpdesk/vendor/symfony/console/Application.php:632)
[2021-03-31 00:36:12] production.ERROR: Command "horizon" is not defined. {"exception":"[object] (Symfony\\Component\\Console\\Exception\\CommandNotFoundException(code: 0): Command \"horizon\" is not defined. at /var/www/faveo-helpdesk/vendor/symfony/console/Application.php:632)
[2021-03-31 00:36:16] production.ERROR: Command "horizon" is not defined. {"exception":"[object] (Symfony\\Component\\Console\\Exception\\CommandNotFoundException(code: 0): Command \"horizon\" is not defined. at /var/www/faveo-helpdesk/vendor/symfony/console/Application.php:632)
[2021-03-31 00:40:03] production.ERROR: compact(): Undefined variable: article_id {"exception":"[object] (ErrorException(code: 0): compact(): Undefined variable: article_id at /var/www/faveo-helpdesk/app/Http/Controllers/Client/kb/UserController.php:160)
[2021-03-31 00:40:04] production.ERROR: compact(): Undefined variable: article_id {"exception":"[object] (ErrorException(code: 0): compact(): Undefined variable: article_id at /var/www/faveo-helpdesk/app/Http/Controllers/Client/kb/UserController.php:160)

FWIW, I got that via this command:

grep ERROR /var/www/faveo-helpdesk/storage/logs/laravel-*.log

There are esentially 2 errors here; a "horizon" error and a "compat()" error.

Whilst the message is different, the compat() error, likely has the same cause as yours. It also appears to be a known issue in Faveo. And as you noted, it seems likely that this is related to PHP7.3! If you read the link provided in that post (see the "Undefined variables in compact()" section in Deprecations and Changes for PHP 7.3) it notes that the change in v7.3 is that undefined variables in calls to compat() are now raised as errors (instead of ignored as they were in

Re the "horizon" error I'm seeing. That appears to be a missing (Laravel) dependency which can't be resolved via composer. I'm going to need to work that out, but may also be resolvable via downgrading PHP (to v7.2)? I'll report back ASAP.

Alfredo's picture

Yes, it also appeared to me, after trying to go to the categories, the message Ooops something went wrong.

To have more information I activated the debug function in FAVEO.

Jeremy Davis's picture

TBH, it's far from ideal, but downgrading PHP to 7.2 definitely resolves the issues.

I cleaned the log file and downgraded PHP to 7.2. I then poked around the webUI, including checking the "knowledgebase" links and logging in. All appears to be ok and the log file is still empty! :)

I'll rebuild the appliance with PHP7.2 ASAP (will probably not be available for a week or so). In the meantime, to make it easier to get going with the current appliance, I've built a script to downgrade PHP. Try this:

wget https://raw.githubusercontent.com/JedMeister/downgrade-php/master/downgrade-php
chmod +x downgrade-php
./downgrade-php

Thanks again for reporting and I hope that helps.

[update] I've open an issue on our issue tracker.

Alfredo's picture

This script works great.

Thanks a lot!!!

I will be attentive to future updates!

 

Thanks Jeremy !!! :)

Ruben Carlo Benante's picture

The log is filling with "horizon not defined" every other second.

60MB per day is a bit too much...

Any news on how to solve the problem without the need to downgrade PHP?

Thanks!

Add new comment