cacti vs PHP 7 vs split
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cacti (Debian) |
Fix Released
|
Unknown
|
|||
cacti (Ubuntu) |
Fix Released
|
Medium
|
Nish Aravamudan | ||
Xenial |
Won't Fix
|
Medium
|
Nish Aravamudan | ||
Yakkety |
Fix Committed
|
Medium
|
Nish Aravamudan | ||
Zesty |
Fix Committed
|
Medium
|
Nish Aravamudan | ||
Artful |
Fix Released
|
Medium
|
Nish Aravamudan |
Bug Description
[Impact]
* If the administrator configures cacti to poll data at a higher frequency
than the cron job that runs the poller, a fatal error is emitted.
* As the highest cron frequency is once per minute, one will have to use this feature if higher resolution is required.
[Test Case]
* On the one hand, this is a syntactical (non-php7.0 compliant) code change, so the test case feels less necessary.
* On the other hand, one can configure cacti to poll at a higher than once-per-minute frequency, and the poller will crash with the "undefined function split()".
[Regression Potential]
* Presuming an administrator does not use a higher than one-minute polling frequency, there is no regression potential, as they are unaffected by this codepath.
* If the administrator does use a higher polling frequency, they may have already hit this bug and manually changed the source on their system. Ideally, they will have changed it in the same way upstream has, which is the backported fix in this bug -- and so when the update is installed, there should be no change.
* If the administrator left cacti in the broken state because of this bug, then it will be fixed by this change and there again, is no regression potential, because the feature was broken before.
---
poller.php calls split in two places, which fails with PHP 7. This seems to only actually cause problems if poller.php is configured to poll the snmp data sources more than once per time poller.php is called by cron (which typically happens if 10 second or 30 second polling intervals are requested), but it appears to me that these error messages may appear in the logs even when cacti is configured to only poll once per time it is called by cron.
It appears that using explode instead of split is the fix.
PHP Fatal error: Uncaught Error: Call to undefined function split() in /usr/share/
Stack trace:
#0 {main}
thrown in /usr/share/
PHP Fatal error: Uncaught Error: Call to undefined function split() in /usr/share/
Stack trace:
#0 {main}
thrown in /usr/share/
Description: Ubuntu 16.04.1 LTS
Release: 16.04
cacti:
Installed: 0.8.8f+
Candidate: 0.8.8f+
Version table:
*** 0.8.8f+
500 http://
500 http://
100 /var/lib/
0.
500 http://
500 http://
Changed in cacti (Debian): | |
status: | Unknown → Fix Released |
Changed in cacti (Ubuntu Yakkety): | |
status: | New → In Progress |
Changed in cacti (Ubuntu Xenial): | |
status: | New → In Progress |
Changed in cacti (Ubuntu Zesty): | |
status: | Confirmed → In Progress |
Changed in cacti (Ubuntu Xenial): | |
assignee: | nobody → Nish Aravamudan (nacc) |
Changed in cacti (Ubuntu Yakkety): | |
assignee: | nobody → Nish Aravamudan (nacc) |
Changed in cacti (Ubuntu Zesty): | |
assignee: | nobody → Nish Aravamudan (nacc) |
Changed in cacti (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in cacti (Ubuntu Zesty): | |
importance: | Undecided → Medium |
Changed in cacti (Ubuntu Yakkety): | |
importance: | Undecided → Medium |
Changed in cacti (Ubuntu Artful): | |
importance: | Undecided → Medium |
Thanks for reporting this issue.
The code was introduced to fix issue http:// bugs.cacti. net/view. php?id= 2446 in 0.8.8c.
Looks like already before that time Debian and Ubuntu replaced split() by explode(), so that's why this one was missed.
Code is not present in the recently released upstream version 1.0.0, so this bug will be fixed once 1.0.0 or higher is packaged for Debian and synced to Ubuntu.