Using this plugin on a new Icinga server running Debian 12 and PHP 8.2 from the Debian repos.
Getting this error when going to Import Source, select an import source and then Preview.
Deprecated
: Creation of dynamic property Icinga\Module\Netbox\Netbox::$baseurl is deprecated in
/usr/share/icingaweb2/modules/netbox/library/Netbox/Netbox.php
on line
23
Deprecated
: Creation of dynamic property Icinga\Module\Netbox\Netbox::$token is deprecated in
/usr/share/icingaweb2/modules/netbox/library/Netbox/Netbox.php
on line
24
Using this plugin on a new Icinga server running Debian 12 and PHP 8.2 from the Debian repos.
Getting this error when going to Import Source, select an import source and then Preview.
Deprecated : Creation of dynamic property Icinga\Module\Netbox\Netbox::$baseurl is deprecated in /usr/share/icingaweb2/modules/netbox/library/Netbox/Netbox.php on line 23
Deprecated : Creation of dynamic property Icinga\Module\Netbox\Netbox::$token is deprecated in /usr/share/icingaweb2/modules/netbox/library/Netbox/Netbox.php on line 24
And lots more of that.
This is due to the creation of dynamic properties being deprecated in PHP 8.2. https://www.php.net/manual/en/migration82.deprecated.php
This will become an error exception in PHP 9.0 and will get removed completely at some point in the future.
A hacky work around is to add the attribute
[\AllowDynamicProperties]
directly above the Netbox class
// use Icinga\Module\Director\Daemon\Logger;
[\AllowDynamicProperties]
class Netbox {
That resolved the issue for me.
According to the PHP 8.2 documentation the long term solution is to declare all used properties in the class declaration.