Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve compatibility for backtrace logging under PHP 8.x #5467

Closed
anarkia1976 opened this issue Aug 24, 2023 · 4 comments
Closed

Improve compatibility for backtrace logging under PHP 8.x #5467

anarkia1976 opened this issue Aug 24, 2023 · 4 comments
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team resolved A fixed issue
Milestone

Comments

@anarkia1976
Copy link

Hi @TheWitness ,

with the latest update i see these errors into cacti logs:

2023-08-24 11:40:34 - CMDPHP PHP ERROR Backtrace: (/plugins/syslog/syslog_process.php[198]:syslog_process_alerts(), /plugins/syslog/functions.php[1186]:syslog_process_alert(), /plugins/syslog/functions.php[1490]:syslog_sendemail(), /plugins/syslog/functions.php[116]:mailer(), /lib/functions.php[5090]:cacti_log(), /lib/functions.php[1365]:strpos(), CactiErrorHandler())
2023-08-24 11:40:34 - ERROR PHP DEPRECATED: strpos(): Passing null to parameter Cacti/plugin_syslog#1 ($haystack) of type string is deprecated in file: /var/www/html/cacti/lib/functions.php on line: 1365
2023-08-24 11:40:34 - CMDPHP PHP ERROR Backtrace: (/plugins/syslog/syslog_process.php[198]:syslog_process_alerts(), /plugins/syslog/functions.php[1186]:syslog_process_alert(), /plugins/syslog/functions.php[1490]:syslog_sendemail(), /plugins/syslog/functions.php[116]:mailer(), /lib/functions.php[5090]:cacti_log(), /lib/functions.php[1363]:strpos(), CactiErrorHandler())
2023-08-24 11:40:34 - ERROR PHP DEPRECATED: strpos(): Passing null to parameter Cacti/plugin_syslog#1 ($haystack) of type string is deprecated in file: /var/www/html/cacti/lib/functions.php on line: 1363
2023-08-24 11:40:34 - CMDPHP PHP ERROR Backtrace: (/plugins/syslog/syslog_process.php[198]:syslog_process_alerts(), /plugins/syslog/functions.php[1186]:syslog_process_alert(), /plugins/syslog/functions.php[1490]:syslog_sendemail(), /plugins/syslog/functions.php[116]:mailer(), /lib/functions.php[5090]:cacti_log(), /lib/functions.php[1361]:strpos(), CactiErrorHandler())
2023-08-24 11:40:34 - ERROR PHP DEPRECATED: strpos(): Passing null to parameter Cacti/plugin_syslog#1 ($haystack) of type string is deprecated in file: /var/www/html/cacti/lib/functions.php on line: 1361
2023-08-24 11:40:34 - CMDPHP PHP ERROR Backtrace: (/plugins/syslog/syslog_process.php[198]:syslog_process_alerts(), /plugins/syslog/functions.php[1186]:syslog_process_alert(), /plugins/syslog/functions.php[1490]:syslog_sendemail(), /plugins/syslog/functions.php[116]:mailer(), /lib/functions.php[5090]:cacti_log(), /lib/functions.php[1359]:strpos(), CactiErrorHandler())
2023-08-24 11:40:34 - ERROR PHP DEPRECATED: strpos(): Passing null to parameter Cacti/plugin_syslog#1 ($haystack) of type string is deprecated in file: /var/www/html/cacti/lib/functions.php on line: 1359
2023-08-24 11:40:34 - MAILER
2023-08-24 11:40:34 - CMDPHP WARNING Backtrace: (/plugins/syslog/syslog_process.php[198]:syslog_process_alerts(), /plugins/syslog/functions.php[1186]:syslog_process_alert(), /plugins/syslog/functions.php[1490]:syslog_sendemail(), /plugins/syslog/functions.php[116]:mailer(), /lib/functions.php[5090]:cacti_debug_backtrace())
2023-08-24 11:40:34 - MAILER WARNING: Mail failed via SMTP from 'example.monitoring <example.monitoring@example.it>', to 's.example@example.example.alert@example.it', cc '', bcc '', and took 1.07 seconds, Subject 'Event Alert - XXXXXX - HA - MEMBER DOWN - VIP', Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

cacti: latest 1.2.25
syslog: latest source
os: ubuntu22.04
php: PHP 8.1.2
mysql: 10.6.12-MariaDB

thanks a lot. stefano.

@TheWitness
Copy link
Member

@anarkia1976, this is actually a Cacti issue associated with PHP8.x.

@TheWitness TheWitness transferred this issue from Cacti/plugin_syslog Aug 24, 2023
@TheWitness TheWitness changed the title [CACTI 1.2.25 - SYSLOG latest] mailer PHP errors - send email Cacti logging throws error when attempting to generate a log message from empty log string Aug 24, 2023
@TheWitness TheWitness changed the title Cacti logging throws error when attempting to generate a log message from empty log string Cacti logging throws error when attempting to generate a log message from empty log string in PHP 8.x Aug 24, 2023
TheWitness added a commit that referenced this issue Aug 24, 2023
Cacti logging throws error when attempting to generate a log message from empty log string in PHP 8.x
TheWitness added a commit that referenced this issue Aug 24, 2023
Cacti logging throws error when attempting to generate a log message from empty log string in PHP 8.x
@TheWitness TheWitness added bug Undesired behaviour resolved A fixed issue confirmed Bug is confirm by dev team labels Aug 24, 2023
@TheWitness TheWitness added this to the v1.2.25 milestone Aug 24, 2023
@TheWitness
Copy link
Member

@anarkia1976, simple update to lib/functions.php.

@TheWitness
Copy link
Member

@anarkia1976, validate ASAP. Since we are are technically in 1.2.25 freeze, confirmation via your closure that things are normal now is pretty important. CC @netniV just in case.

@TheWitness
Copy link
Member

Thanks!

@netniV netniV changed the title Cacti logging throws error when attempting to generate a log message from empty log string in PHP 8.x Improve compatibility for backtrace logging under PHP 8.x Sep 3, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

2 participants