Bug 1463471 - Following latest update, cacti is returning a HTTP 500 error code
Following latest update, cacti is returning a HTTP 500 error code
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: cacti (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity urgent
: ---
: ---
Assigned To: Morten Stevens
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-20 22:09 EDT by David Hill
Modified: 2017-08-21 07:05 EDT (History)
3 users (show)

See Also:
Fixed In Version: cacti-1.1.12-2.fc26
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-14 09:22:45 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
php.ini (60.94 KB, text/plain)
2017-06-27 09:11 EDT, Morten Stevens
no flags Details
cacti.conf (1.47 KB, text/plain)
2017-06-27 09:12 EDT, Morten Stevens
no flags Details

  None (edit)
Description David Hill 2017-06-20 22:09:55 EDT
Description of problem:
Following latest update, cacti is returning a HTTP 500 error code

[Tue Jun 20 22:06:48.408807 2017] [php7:error] [pid 14032] [client 192.168.1.22:64944] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in /usr/share/cacti/lib/database.php on line 293
[Tue Jun 20 22:06:48.409168 2017] [php7:error] [pid 14032] [client 192.168.1.22:64944] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0
[Tue Jun 20 22:06:51.942498 2017] [php7:error] [pid 14031] [client 192.168.1.22:64945] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in /usr/share/cacti/lib/database.php on line 293
[Tue Jun 20 22:06:51.942905 2017] [php7:error] [pid 14031] [client 192.168.1.22:64945] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Upgrade from 1.1.7-1 to 1.1.10-1
2.
3.

Actual results:
See above logs
Jun 19 18:06:46 DEBUG ---> Package cacti.noarch 1.1.7-1.fc27 will be upgraded
Jun 19 18:06:46 DEBUG ---> Package cacti.noarch 1.1.10-1.fc27 will be an upgrade
 cacti          

Expected results:
no failures

Additional info:
trying to rollback now to previous known working version
Comment 1 David Hill 2017-06-20 22:17:11 EDT
Downgrading to 1.1.7 solves the issue.
Comment 2 Morten Stevens 2017-06-21 05:28:32 EDT
This sounds not like a cacti bug. Try to increase your memory_limit size in /etc/php.ini
Comment 3 David Hill 2017-06-22 16:22:45 EDT
I increased it to 512MB before opening this case... I rolled back to 1.1.7 and it works alright.
Comment 4 Morten Stevens 2017-06-23 06:12:14 EDT
@David

Your bug report is not reproducible. I have many CentOS 7 machines running PHP7 and the latest cacti still works fine.
Comment 5 Morten Stevens 2017-06-23 06:14:12 EDT
Note: It's also working fine after upgrading my Fedora rawhide cacti installation from 1.1.7 to 1.1.10.
Comment 6 David Hill 2017-06-25 10:53:09 EDT
It's not working here... with 1.1.10 at all.  I get the 500 .  It looks like the database connection is no longer working with cacti 1.1.10:

cacti logs:
20170625 10:50:45 - DBCALL DEVEL: SQL Cell: "SELECT cacti FROM version LIMIT 1"
20170625 10:51:39 - DBCALL DEVEL: SQL Cell: "SELECT cacti FROM version LIMIT 1"

apache logs:


[Sun Jun 25 10:51:39.886511 2017] [php7:error] [pid 21862] [client 192.168.1.22:54330] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in /usr/share/cacti/lib/database.php on line 293
[Sun Jun 25 10:51:39.886924 2017] [php7:error] [pid 21862] [client 192.168.1.22:54330] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0


Code:

  if (!is_object($db_conn)) {
    $db_conn = $database_sessions["$database_hostname:$database_port:$database_default"];

    if (!is_object($db_conn)) {
      return false;
    }
Comment 7 David Hill 2017-06-25 11:19:39 EDT
[root@zappa cacti]# rpm -qa | grep php
php-common-7.1.7~RC1-1.fc27.x86_64
php-mbstring-7.1.7~RC1-1.fc27.x86_64
php-cli-7.1.7~RC1-1.fc27.x86_64
php-xml-7.1.7~RC1-1.fc27.x86_64
php-snmp-7.1.7~RC1-1.fc27.x86_64
php-pdo-7.1.7~RC1-1.fc27.x86_64
php-mysqlnd-7.1.7~RC1-1.fc27.x86_64
php-gd-7.1.7~RC1-1.fc27.x86_64
php-imap-7.1.7~RC1-1.fc27.x86_64
php-json-7.1.7~RC1-1.fc27.x86_64
php-ldap-7.1.7~RC1-1.fc27.x86_64
php-intl-7.1.7~RC1-1.fc27.x86_64
devassistant-dap-php-0.11-4.fc26.noarch
php-process-7.1.7~RC1-1.fc27.x86_64
php-7.1.7~RC1-1.fc27.x86_64
[root@zappa cacti]# rpm -qa | grep cacti
cacti-1.1.10-1.fc27.noarch
[root@zappa cacti]# rpm -qa | grep httpd
fedora-logos-httpd-26.0.1-1.fc27.noarch
httpd-2.4.26-1.fc27.x86_64
httpd-filesystem-2.4.26-1.fc27.noarch
httpd-tools-2.4.26-1.fc27.x86_64
Comment 8 David Hill 2017-06-25 11:28:16 EDT
Out of curiosity, I've also tried 1.1.8 from the cacti.net website and I have the same issue.  As soon as I downgrade to 1.1.7 (even the tarballs from the website) it resumes working.   I'll dig into the diffs between both versions and update this later on.
Comment 9 Morten Stevens 2017-06-25 12:44:32 EDT
Please report this issue directly to upstream on https://github.com/Cacti/cacti/issues

Btw on my Fedora rawhide installation with php-7.1.6-1.fc27.x86_64 it's working fine.
Comment 10 David Hill 2017-06-27 08:51:46 EDT
For reference, I opened the following issue [1] upstream.   I'm still curious as why you're not able to reproduce this on rawhide and that i'm running rawhide myself.   Would it be possible to get your package list ?  At the beginning , I had the same php version as you do but i updated to 7.1.7~RC1 later on as i hoped it'd solve this issue.

[1] https://github.com/Cacti/cacti/issues/829
Comment 11 David Hill 2017-06-27 08:58:18 EDT
And maybe your cacti /etc/httpd/conf.d/cacti.conf ?   If we have identical environment, I don't see what's the problem.   Maybe also /etc/php.ini ?  Or we can do it the other way around and I attach all of that to this case?
Comment 12 Morten Stevens 2017-06-27 09:09:57 EDT
Thank you for reporting the bug to the upstream project.

Here is my package list after the latest rawhide updates:

Cacti

# rpm -q cacti
cacti-1.1.10-2.fc27.noarch

Database

# rpm -qa | grep mariadb
mariadb-common-10.1.24-3.fc27.x86_64
mariadb-server-utils-10.1.24-3.fc27.x86_64
mariadb-config-10.1.24-3.fc27.x86_64
mariadb-10.1.24-3.fc27.x86_64
mariadb-errmsg-10.1.24-3.fc27.x86_64
mariadb-libs-10.1.24-3.fc27.x86_64
mariadb-server-10.1.24-3.fc27.x86_64

Apache

# rpm -qa | grep httpd
httpd-tools-2.4.26-1.fc27.x86_64
libmicrohttpd-0.9.55-1.fc27.x86_64
fedora-logos-httpd-26.0.1-1.fc27.noarch
httpd-2.4.26-1.fc27.x86_64
httpd-filesystem-2.4.26-1.fc27.noarch

PHP

rpm -qa | grep php
php-phpdocumentor-type-resolver-0.2.1-1.fc27.noarch
php-webmozart-assert-1.2.0-2.fc26.noarch
php-doctrine-cache-1.6.1-2.fc26.noarch
php-symfony-expression-language-2.8.22-1.fc27.noarch
php-bartlett-php-compatinfo-db-1.22.0-1.fc27.noarch
php-pdo-7.1.7~RC1-1.fc27.x86_64
php-symfony-css-selector-2.8.22-1.fc27.noarch
php-ldap-7.1.7~RC1-1.fc27.x86_64
php-phpseclib-2.0.6-1.fc27.noarch
php-xml-7.1.7~RC1-1.fc27.x86_64
php-fedora-autoloader-1.0.0-1.fc27.noarch
php-bartlett-PHP-CompatInfo-5.0.7-1.fc27.noarch
php-composer-semver-1.4.2-3.fc26.noarch
php-bartlett-PHP-Reflect-4.1.0-1.fc27.noarch
php-symfony-filesystem-2.8.22-1.fc27.noarch
php-bcmath-7.1.7~RC1-1.fc27.x86_64
php-phpmyadmin-shapefile-2.1-1.fc27.noarch
php-opcache-7.1.7~RC1-1.fc27.x86_64
php-symfony3-common-3.2.9-1.fc27.noarch
php-paragonie-random-compat-2.0.10-1.fc27.noarch
php-andrewsville-php-token-reflection-1.4.0-6.fc26.noarch
php-bartlett-umlwriter-1.2.0-2.fc27.noarch
php-php-gettext-1.0.12-2.fc26.noarch
php-symfony-common-2.8.22-1.fc27.noarch
php-symfony-process-2.8.22-1.fc27.noarch
php-common-7.1.7~RC1-1.fc27.x86_64
php-phpmyadmin-sql-parser-4.1.7-1.fc27.noarch
php-7.1.7~RC1-1.fc27.x86_64
php-symfony-config-2.8.22-1.fc27.noarch
php-imap-7.1.7~RC1-1.fc27.x86_64
php-symfony-browser-kit-2.8.22-1.fc27.noarch
php-mcrypt-7.1.7~RC1-1.fc27.x86_64
php-snmp-7.1.7~RC1-1.fc27.x86_64
php-symfony-http-kernel-2.8.22-1.fc27.noarch
php-symfony3-stopwatch-3.2.9-1.fc27.noarch
php-tcpdf-dejavu-sans-fonts-6.2.13-2.fc26.noarch
php-PsrLog-1.0.2-3.fc26.noarch
php-pecl-zip-1.14.0-1.fc27.x86_64
php-password-compat-1.0.4-4.fc26.noarch
php-phpdocumentor-reflection-docblock-3.1.1-1.fc27.noarch
php-nikic-php-parser-2.1.1-3.fc26.noarch
php-JsonSchema-1.6.1-6.fc27.noarch
php-symfony-class-loader-2.8.22-1.fc27.noarch
php-symfony-yaml-2.8.22-1.fc27.noarch
php-symfony-var-dumper-2.8.22-1.fc27.noarch
php-json-7.1.7~RC1-1.fc27.x86_64
php-mysqlnd-7.1.7~RC1-1.fc27.x86_64
php-symfony-dependency-injection-2.8.22-1.fc27.noarch
php-gmp-7.1.7~RC1-1.fc27.x86_64
php-symfony-finder-2.8.22-1.fc27.noarch
php-mbstring-7.1.7~RC1-1.fc27.x86_64
php-recode-7.1.7~RC1-1.fc27.x86_64
php-symfony-event-dispatcher-2.8.22-1.fc27.noarch
php-pear-1.10.4-2.fc27.noarch
php-tcpdf-6.2.13-2.fc26.noarch
php-udan11-sql-parser-3.4.17-3.fc26.noarch
php-jsonlint-1.6.1-1.fc27.noarch
php-gd-7.1.7~RC1-1.fc27.x86_64
php-google-recaptcha-1.1.3-1.fc27.noarch
php-process-7.1.7~RC1-1.fc27.x86_64
php-symfony-console-2.8.22-1.fc27.noarch
php-phpdocumentor-reflection-common-1.0-1.fc27.noarch
php-symfony-polyfill-1.3.0-2.fc26.noarch
php-phpunit-Version-2.0.1-2.fc26.noarch
php-doctrine-collections-1.4.0-1.fc27.noarch
php-phpmyadmin-motranslator-3.3-1.fc27.noarch
php-symfony-http-foundation-2.8.22-1.fc27.noarch
php-cli-7.1.7~RC1-1.fc27.x86_64
php-symfony-dom-crawler-2.8.22-1.fc27.noarch
php-intl-7.1.7~RC1-1.fc27.x86_64
php-symfony-debug-2.8.22-1.fc27.noarch
php-tidy-7.1.7~RC1-1.fc27.x86_64
phpMyAdmin-4.7.1-1.fc27.noarch
Comment 13 Morten Stevens 2017-06-27 09:11 EDT
Created attachment 1292315 [details]
php.ini
Comment 14 Morten Stevens 2017-06-27 09:12 EDT
Created attachment 1292316 [details]
cacti.conf

cacti apache vhost configuration
Comment 15 David Hill 2017-06-27 10:32:38 EDT
So we have the same cacti.conf file but in php.ini, the differences are the following:
- local
+ yours

-serialize_precision = 17
+serialize_precision = -1

-date.timezone = America/Toronto
+date.timezone = Europe/Berlin

-;pcre.jit=1
+pcre.jit=0

-session.hash_function = 0
+session.sid_length = 26

+session.trans_sid_tags = "a=href,area=href,frame=src,form="
-session.hash_bits_per_character = 5
-url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
+session.sid_bits_per_character = 5

Do you think it could be my php.ini?
Comment 16 David Hill 2017-06-29 18:49:45 EDT
Hello sir,
 
   I can confirm that 1.1.11 solves the issue .  You can reference the upstream bug [1].   This has to do web DEBUG logging being turned on and a recursive call going berzerg because of a time format (unless I'm mistaken).

Thank you very much,

David Hill

[1] https://github.com/Cacti/cacti/issues/829
Comment 17 Fedora Update System 2017-07-04 13:20:42 EDT
cacti-1.1.11-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-7ab0179693
Comment 18 Fedora Update System 2017-07-05 14:48:57 EDT
cacti-1.1.12-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-7ab0179693
Comment 19 Fedora Update System 2017-07-06 14:22:09 EDT
cacti-1.1.12-2.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-7ab0179693
Comment 20 Fedora Update System 2017-07-14 09:22:45 EDT
cacti-1.1.12-2.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.