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

Partial fix for PHP 7.4 upgrade incompatibilities #3120

Closed
reubenfarrelly opened this issue Nov 30, 2019 · 8 comments
Closed

Partial fix for PHP 7.4 upgrade incompatibilities #3120

reubenfarrelly opened this issue Nov 30, 2019 · 8 comments
Labels
bug Undesired behaviour resolved A fixed issue

Comments

@reubenfarrelly
Copy link

I'm seeing some errors now being logged in my cacti log:

2019-11-30 02:31:30 - CMDPHP PHP ERROR NOTICE Backtrace: (CactiShutdownHandler(), /lib/functions.php[4583]:CactiErrorHandler())
2019-11-30 02:31:30 - ERROR PHP : Trying to access array offset on value of type null in file: /var/www/cacti.reub.net/htdocs/lib/functions.php on line: 4583
2019-11-30 02:31:30 - CMDPHP PHP ERROR NOTICE Backtrace: (CactiShutdownHandler(), /lib/functions.php[4579]:CactiErrorHandler())
2019-11-30 02:31:30 - ERROR PHP : Trying to access array offset on value of type null in file: /var/www/cacti.reub.net/htdocs/lib/functions.php on line: 4579

This is logged every minute. Every poll since then has failed to show up in graphs.

I have upgraded to php-7.4 final release and it looks like that may be the trigger as it started at about the same time.

@cigamit cigamit changed the title PHP 7.4 Error? Trying to access array offset on value of type null error - git 1.2.x branch PHP 7.4 Compatibility Issues Nov 30, 2019
@cigamit cigamit added the bug Undesired behaviour label Nov 30, 2019
cigamit added a commit that referenced this issue Nov 30, 2019
PHP 7.4 Compatibility Issues
@cigamit
Copy link
Member

cigamit commented Nov 30, 2019

@reubenfarrelly, update to the latest lib/functions.php and let's see if you get any further. I have a hunch this will not be the only issue with 7.4

@reubenfarrelly
Copy link
Author

I've updated to the latest in git 1.2.x now, and it's better but not quite perfect.

  • Everything still works with php-7.3 (so seems we didn't break anything obvious)
  • The error has now gone with php-7.4
  • There's something else wrong, in that polling works and shows no errors but the RRDs are not being updated. I'm still investigating this as I can't see any obvious reason yet. Roll back to 7.3 and this problem goes away.

@reubenfarrelly
Copy link
Author

The rrd files are not being updated at a file level, last modification date is when they were last written to by the php-7.3 binary. I wonder if this is related?
thunderstorm /var/www/cacti.reub.net/htdocs/log # ps auxww | grep rrdtool
apache 333 0.0 0.0 17448 4436 ? S 09:14 0:00 /usr/bin/rrdtool -
apache 335 0.0 0.0 17448 4564 ? S 09:14 0:00 /usr/bin/rrdtool -
apache 336 0.0 0.0 17448 4732 ? S 09:14 0:00 /usr/bin/rrdtool -
apache 2352 0.0 0.0 17448 4548 ? S 09:19 0:00 /usr/bin/rrdtool -
apache 2353 0.0 0.0 17448 4496 ? S 09:19 0:00 /usr/bin/rrdtool -
apache 6169 0.0 0.0 17448 4496 ? S 09:29 0:00 /usr/bin/rrdtool -
apache 6170 0.0 0.0 17448 4520 ? S 09:29 0:00 /usr/bin/rrdtool -
apache 6650 0.0 0.0 8560 3140 ? S 09:30 0:00 sh -c cd '/var/www/cacti.reub.net/htdocs' ; /usr/bin/rrdtool -
apache 6651 0.0 0.0 17448 6096 ? S 09:30 0:00 /usr/bin/rrdtool -
root 6802 0.0 0.0 8092 816 pts/2 S+ 09:30 0:00 grep --colour=auto rrdtool
apache 22857 0.0 0.0 17448 4660 ? S 08:49 0:00 /usr/bin/rrdtool -
apache 22858 0.0 0.0 17448 4624 ? S 08:49 0:00 /usr/bin/rrdtool -
apache 22859 0.0 0.0 12676 4668 ? S 08:49 0:00 /usr/bin/rrdtool -
apache 26947 0.0 0.0 17448 4732 ? S 09:00 0:00 /usr/bin/rrdtool -
apache 26948 0.0 0.0 17448 4484 ? S 09:00 0:00 /usr/bin/rrdtool -
apache 26949 0.0 0.0 17448 4624 ? S 09:00 0:00 /usr/bin/rrdtool -
apache 30131 0.0 0.0 17448 4528 ? S 09:06 0:00 /usr/bin/rrdtool -
apache 30132 0.0 0.0 17448 4520 ? S 09:06 0:00 /usr/bin/rrdtool -
apache 30147 0.0 0.0 17448 4712 ? S 09:06 0:00 /usr/bin/rrdtool -
apache 30148 0.0 0.0 17448 4684 ? S 09:06 0:00 /usr/bin/rrdtool -
apache 31597 0.0 0.0 17448 4640 ? S 09:10 0:00 /usr/bin/rrdtool -
apache 31598 0.0 0.0 17448 4692 ? S 09:10 0:00 /usr/bin/rrdtool -
thunderstorm /var/www/cacti.reub.net/htdocs/log #

@reubenfarrelly
Copy link
Author

reubenfarrelly commented Nov 30, 2019

Oh and:

thunderstorm ~ # rrdtool --version
RRDtool 1.7.2 Copyright by Tobias Oetiker tobi@oetiker.ch
Compiled May 29 2019 18:56:36

I have the rrdtool version set to "RRDtool 1.7.2+" in my settings.

@cigamit
Copy link
Member

cigamit commented Dec 1, 2019

So, it looks like poller.php or poller_boost.php is crashing. Can you edit /etc/php.ini and un-comment error_log and set to /tmp/php_errors.log and record what ends up there?

@reubenfarrelly
Copy link
Author

Ok I've solved this. It was a user error. The 7.3 debug logs show:

01/Dec/2019 12:30:34 - POLLER: Poller[1] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti.reub.net/htdocs/rra/16/457.rrd --skip-past-updates --template discards_in:discards_out:errors_in:errors_out 1575163820:2660:20258:0:0

The 7.4 debug log run 10 mins later shows:

01/Dec/2019 23:40:34 - POLLER: Poller[1] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti.reub.net/htdocs/rra/16/457.rrd --skip-past-updates --template discards_in:discards_out:errors_in:errors_out 1575204020:2660:20258:0:0

The difference being, the 7.4 php did not have the right timezone so was defaulting to GMT (we are in DST now, which is GMT+11). The config files for Gentoo use completely different php.ini files for each version and it's a bit of a gotcha that only comes around infrequently. Once I updated those the RRDs are now updating again.

Aside from that, I can't find any other php-7.4 errors. Not to say there are none but there are no other obvious ones that I can see.

@cigamit
Copy link
Member

cigamit commented Dec 1, 2019

Well, let's close this one now. Open another one if/when you encounter more errors.

@cigamit cigamit closed this as completed Dec 1, 2019
@cigamit cigamit added the resolved A fixed issue label Dec 1, 2019
@netniV
Copy link
Member

netniV commented Dec 2, 2019

Glad to see it's all resolved 👍

@netniV netniV changed the title PHP 7.4 Compatibility Issues Correct issues causing incompatibility with PHP 7.4 Dec 7, 2019
@netniV netniV changed the title Correct issues causing incompatibility with PHP 7.4 Partial fix for PHP 7.4 upgrade incompatibilities Feb 10, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants