[ZBX-5006] PHP Fatal error: Allowed memory size after 1.8.13 upgrade Created: 2012 May 16  Updated: 2017 May 30  Resolved: 2012 May 28

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 1.8.13
Fix Version/s: 1.8.14rc1

Type: Incident report Priority: Critical
Reporter: Mike Brady Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Centos 5.8 x86_64
Postgresql 8.4
PHP 5.3.3


Attachments: JPEG File screenshot-1.jpg    
Issue Links:
Duplicate
is duplicated by ZBX-5217 Unable to connect to the WEB-interfac... Closed
is duplicated by ZBX-5221 I did the update to 1.8.13-9, and my ... Closed
is duplicated by ZBX-6570 PHP Fatal error: Allowed memory size... Closed
is duplicated by ZBX-4876 PHP Fatal error: Allowed memory Closed
is duplicated by ZBX-5023 apache gets a segmantion fault when I... Closed
is duplicated by ZBX-5097 Frontend, SQL loop Closed

 Description   

After upgrading from 1.8.12 to 1.8.13 the Web front end no longer works. The system continues to do monitoring as email notifications are still being received. It just seems to be frontend problem.

The initial configuration of the fornt end works succesfully up until step 8 "Finish"> When the Finish button is clicked on the browser posts the page, but the web server never comes back. Eventually the following error is logged in /var/logs/http/error.log

[Tue May 15 21:38:44 2012] [error] [client 192.168.42.91] PHP Fatal error: Allowed memory size of 775946240 bytes exhausted (tried to allocate 523800 bytes) in /var/www/html/zabbix-1.8.13/include/copt.lib.php on line 524, referer: http://zabbix02/zabbix/setup.php

In php.ini memory_limit = 740M, but it does not seem to matter what memory_limit is set to. It was originally set to 256M and every time I increased it the the installation of the frontend fails at that memory size.

The Postgresql postmaster process uses a lot of CPU from the time the Finish button is clicked on until the failure is logged.



 Comments   
Comment by Toms (Inactive) [ 2012 May 16 ]

How many lines of code is in your copt.lib.php file?
Error reports line 524, but the file has only 433 lines

Comment by Mike Brady [ 2012 May 16 ]

[root@zabbix02 ~]# wc -l /var/www/html/zabbix-1.8.13/include/copt.lib.php
432 /var/www/html/zabbix-1.8.13/include/copt.lib.php

I have verified that the installed copt.lib.php is the same one as is in the original tar download.
[root@zabbix02 ~]# md5sum /root/zabbix-1.8.13/frontends/php/include/copt.lib.php
d7933e228a6a2313fe499701937d40b7 /root/zabbix-1.8.13/frontends/php/include/copt.lib.php
[root@zabbix02 ~]# md5sum /var/www/html/zabbix-1.8.13/include/copt.lib.php
d7933e228a6a2313fe499701937d40b7 /var/www/html/zabbix-1.8.13/include/copt.lib.php

I see that some else has reported what sounds like the same issue in a comment in ZBX-4876, although that is not what the original issue was about.

I should have also mentioned that the install/upgrade was done from RPMs that I built. The box started with Zabbix 1.8.5 and has been upgraded using RPMs for each release since then with no issues until now. I am happy to provide my SPEC file and/or RPMs. I can also set you up ssh access to my server if that would help. Contact me directly to arrange.

<Toms> Mike, please send your contact information to [email protected]

Comment by Oleksii Zagorskyi [ 2012 May 16 ]

ZBX-4996 also could be related

Comment by Toms (Inactive) [ 2012 May 17 ]

Mike, could you try out revisions 27140, 27144 and 27200?

Comment by Mauro V. [ 2012 May 18 ]

Hi, I can confirm this bug.

I've upgraded from 1.8.12 to 1.8.13, and after the upgraded of the fronted, the fronted stoped working with the following error:

PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 523800 bytes) in /var/www/html/include/copt.lib.php on line 524

I had to go back to 1.8.12 fronted to have it work again.

Comment by Oleksii Zagorskyi [ 2012 May 18 ]

Please in such cases report also info about used PHP version.
Attaching an output (as a separate file) of phpinfo() function is appreciated.

Comment by Paris Jean-Christophe [ 2012 May 19 ]

I have the same problem. Everything goes well until I click the "Finish" button. At that time, the mysql process goes crazy and is almost 100% instead of 4-5% usually. And I find, as in the description, the error "PHP Fatal Error: Allowed memory size of ...etc..."

I handed version 1.8.11 and I have no problem.

Comment by Oleksii Zagorskyi [ 2012 May 20 ]

ZBX-5023 could be similar, I'm linking it to this issue

Comment by Girish KG [ 2012 May 22 ]

I can reproduce this error for 1.8.13
Installed using downloaded source from the scratch on CentOS_6.2 64bit
Web UI installation had no issues
created 80 hosts
Configured almost 80 websites for monitoring
created 15 users
Auto logged out and logged in many times
It was running for almost three days in testing environment. I have almost finished all the configuration on it and I was at the end of user creation when this error occurred. I just did hit the logout button and zabbix web interface is not coming up after that.
-------------------------------------------
Apache/2.2.15 (Unix) DAV/2
PHP/5.3.3
mod_ssl/2.2.15
OpenSSL/1.0.0-fips mod_wsgi/3.2
Python/2.6.6
mod_perl/2.0.4
Perl/v5.10.1
-----------------------------------------
Error Logs: Note that "copt.lib.php" is having only 432 lines.
-------------------------------------------------
[Tue May 22 09:39:16 2012] [error] [client 10.11.100.13] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 523800 bytes) in /var/www/html/include/copt.lib.php on line 524
[Tue May 22 09:40:32 2012] [error] [client 10.11.100.13] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 523800 bytes) in /var/www/html/include/copt.lib.php on line 524
------------------------------------------------

Below are the version in details:
zabbix_1.8.13

Apache:
-----------------------------
httpd-tools-2.2.15-15.el6.centos.1.x86_64
httpd-2.2.15-15.el6.centos.1.x86_64
httpd-manual-2.2.15-15.el6.centos.1.noarch
jakarta-commons-httpclient-3.1-0.6.el6.x86_64
----------------------------
PHP:
-----------------------------
php-bcmath-5.3.3-3.el6_2.8.x86_64
php-common-5.3.3-3.el6_2.8.x86_64
php-pear-1.9.4-4.el6.noarch
php-cli-5.3.3-3.el6_2.8.x86_64
php-xml-5.3.3-3.el6_2.8.x86_64
php-pgsql-5.3.3-3.el6_2.8.x86_64
php-5.3.3-3.el6_2.8.x86_64
php-gd-5.3.3-3.el6_2.8.x86_64
php-mbstring-5.3.3-3.el6_2.8.x86_64
php-pdo-5.3.3-3.el6_2.8.x86_64
----------------------------
POSTGRESQL
---------------------------
postgresql91-devel-9.1.3-1PGDG.rhel6.x86_64
postgresql-docs-8.4.9-1.el6_1.1.x86_64
postgresql-odbc-08.04.0200-1.el6.x86_64
postgresql-8.4.9-1.el6_1.1.x86_64
postgresql91-libs-9.1.3-1PGDG.rhel6.x86_64
postgresql-devel-8.4.9-1.el6_1.1.x86_64
postgresql-server-8.4.9-1.el6_1.1.x86_64
postgresql91-9.1.3-1PGDG.rhel6.x86_64
postgresql91-server-9.1.3-1PGDG.rhel6.x86_64
postgresql-libs-8.4.9-1.el6_1.1.x86_64
---------------------------

Comment by Girish KG [ 2012 May 22 ]

[Tue May 22 09:39:16 2012] [error] [client 10.11.100.13] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 523800 bytes) in /var/www/html/include/copt.lib.php on line 524

Comment by Toms (Inactive) [ 2012 May 28 ]

Fixed in dev. branch: svn://svn.zabbix.com/branches/dev/ZBX-5006

Comment by Pavels Jelisejevs (Inactive) [ 2012 May 28 ]

TESTED.

Comment by Toms (Inactive) [ 2012 May 28 ]

Fixed in 1.8.14rc1 r27874

Comment by Paulo Belloni [ 2012 Jun 08 ]

I tried to apply the patch in 1.8.13, but it still getting "PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 523800 bytes) in /usr/share/zabbix/include/copt.lib.php on line 524". Is there something else we can do to fix this issue in 1.8.13 till get an 1.8.14 stable release?


— a/frontends/php/include/audit.inc.php
+++ b/frontends/php/include/audit.inc.php
@@ -70,7 +70,7 @@
function add_audit($action,$resourcetype,$details){
global $USER_DETAILS;

  • if(!isset($USER_DETAILS['userid'])) check_authorisation();
    + if(!isset($USER_DETAILS['userid'])) return false;

$auditid = get_dbid('auditlog','auditid');

Comment by Paulo Belloni [ 2012 Jun 08 ]

It was due to multiple installations causing file duplicity. The patch indeed fixed the problem. Tks.

Generated at Tue Apr 23 10:54:24 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.