Bug 1463471 - Following latest update, cacti is returning a HTTP 500 error code
Summary: Following latest update, cacti is returning a HTTP 500 error code
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cacti
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
Assignee: Morten Stevens
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-21 02:09 UTC by David Hill
Modified: 2017-08-21 11:05 UTC (History)
3 users (show)

Fixed In Version: cacti-1.1.12-2.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-14 13:22:45 UTC
Type: Bug
Embargoed:


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

Description David Hill 2017-06-21 02:09:55 UTC
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-21 02:17:11 UTC
Downgrading to 1.1.7 solves the issue.

Comment 2 Morten Stevens 2017-06-21 09:28:32 UTC
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 20:22:45 UTC
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 10:12:14 UTC
@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 10:14:12 UTC
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 14:53:09 UTC
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 15:19:39 UTC
[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 15:28:16 UTC
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 16:44:32 UTC
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 12:51:46 UTC
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 12:58:18 UTC
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 13:09:57 UTC
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 13:11:42 UTC
Created attachment 1292315 [details]
php.ini

Comment 14 Morten Stevens 2017-06-27 13:12:31 UTC
Created attachment 1292316 [details]
cacti.conf

cacti apache vhost configuration

Comment 15 David Hill 2017-06-27 14:32:38 UTC
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 22:49:45 UTC
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 17:20:42 UTC
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 18:48:57 UTC
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 18:22:09 UTC
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 13:22:45 UTC
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.