OPNsense Forum

Archive => 22.7 Legacy Series => Topic started by: blaster on September 27, 2022, 03:53:16 pm

Title: PHP Fatal error after update
Post by: blaster on September 27, 2022, 03:53:16 pm
I can't find what went wrong, in the bug report I only have:

PHP Fatal error:  Cannot declare class OPNsense\Phalcon\Config\ConfigWrapper, because the name is already in use in /usr/local/opnsense/mvc/app/library/OPNsense/Phalcon/Config/Config.php on line 9

In previous versions everything worked, there was no ConfigWrapper.
There are no references to methods or information about what caused this error. What can I check?

Title: Re: PHP Fatal error after update
Post by: franco on September 28, 2022, 08:56:58 am
Is this from the crash reporter? System working regardless?


Cheers,
Franco
Title: Re: PHP Fatal error after update
Post by: blaster on September 28, 2022, 10:01:15 am
Is this from the crash reporter? System working regardless?

Yes, a message from crash reporter. The error occurs only when I load the index page of the plugin.
I'm trying to migrate a self-written plugin to a new version and trying to figure out what's going on, because there are no links to my code in the report.

Title: Re: PHP Fatal error after update
Post by: franco on September 28, 2022, 04:25:22 pm
Can you install os-debug? It will add a full stack trace to it.

But as far as I understand this is for a third party plugin not found on our GitHub?


Cheers,
Franco
Title: Re: PHP Fatal error after update
Post by: blaster on September 28, 2022, 05:45:00 pm
Can you install os-debug? It will add a full stack trace to it.
But as far as I understand this is for a third party plugin not found on our GitHub?
Yes, you're right. Unfortunately, after installing the plugin, the report is the same, without stack trace.
The problem was that I used require_once 'config.inc' and the &config_read_array function to conveniently get filter rules, gateway groups, interfaces. Is there a legal analogue of this function for the MVC environment?
Title: Re: PHP Fatal error after update
Post by: franco on September 29, 2022, 08:11:23 am
The install alone might not be enough... Worst case try to reboot and then it should start to emit the additional information in the crash report.


Cheers,
Franco
Title: Re: PHP Fatal error after update
Post by: blaster on September 30, 2022, 09:13:01 am
The install alone might not be enough... Worst case try to reboot and then it should start to emit the additional information in the crash report.
Tracelog for some reason did not appear. I made a test "helloworld" plugin that shows what's going on. It will work on older versions, but not on new ones.