fogcontroller.class.php on line 260 : Allowed memory size of 3145728000 bytes exhausted



  • Hello,

    /var/log/apache2/error.log

    [Fri Jun 08 10:53:59.123807 2018] [proxy_fcgi:error] [pid 64815] [client 10.1.65.42:55466] AH01071: Got error 'PHP message: PHP Fatal error:  Allowed memory size of 3145728000 bytes exhausted (tried to allocate 16384 bytes) in /var/www/html/fog/lib/fog/fogcontroller.class.php on line 260\n', referer: http://fog.insa-rennes.fr/fog/management/index.php?node=host&sub=edit&id=387
    [Fri Jun 08 10:54:44.326295 2018] [proxy_fcgi:error] [pid 64815] [client 10.1.65.42:55497] AH01071: Got error 'PHP message: PHP Fatal error:  Allowed memory size of 3145728000 bytes exhausted (tried to allocate 16384 bytes) in /var/www/html/fog/lib/fog/fogcontroller.class.php on line 260\n', referer: http://fog.insa-rennes.fr/fog/management/index.php?node=host&sub=edit&id=394
    [Fri Jun 08 10:55:39.221879 2018] [proxy_fcgi:error] [pid 64874] [client 10.1.65.42:55516] AH01071: Got error 'PHP message: PHP Fatal error:  Allowed memory size of 3145728000 bytes exhausted (tried to allocate 8192 bytes) in /var/www/html/fog/lib/fog/fogcontroller.class.php on line 260\n', referer: http://fog.insa-rennes.fr/fog/management/index.php?node=host&sub=edit&id=397
    

    How to fix the problem ?



  • mysql> select * from userTracking where utHostID=1312;
    +-------+----------+------------+----------+---------------------+--------+------------+---------+
    | utID  | utHostID | utUserName | utAction | utDateTime          | utDesc | utDate     | utAnon3 |
    +-------+----------+------------+----------+---------------------+--------+------------+---------+
    |  5583 |     1312 | rechit     | 0        | 2018-04-03 16:50:44 |        | 2018-04-03 |         |
    | 19841 |     1312 | rechit     | 1        | 2018-04-18 10:57:47 |        | 2018-04-18 |         |
    | 26357 |     1312 | rechit     | 1        | 2018-04-25 09:41:23 |        | 2018-04-25 |         |
    | 33295 |     1312 | rechit     | 1        | 2018-05-16 08:40:23 |        | 2018-05-16 |         |
    | 43095 |     1312 | rechit     | 0        | 2018-05-28 14:19:27 |        | 2018-05-28 |         |
    | 43111 |     1312 | rechit     | 1        | 2018-05-28 14:32:43 |        | 2018-05-28 |         |
    +-------+----------+------------+----------+---------------------+--------+------------+---------+
    6 rows in set (0,00 sec)
    
    mysql> select count(*) from userTracking;
    +----------+
    | count(*) |
    +----------+
    |    53885 |
    +----------+
    1 row in set (0,00 sec)
    


  • Report Management -> User tracking -> Search for same host => error (white page)

    [Thu Jun 14 08:48:36.951824 2018] [proxy_fcgi:error] [pid 78806] [client 10.1.65.176:40664] AH01071: Got error 'PHP message: PHP Fatal error:  Allowed memory size of 3145728000 bytes exhausted (tried to allocate 36864 bytes) in /var/www/html/fog/lib/fog/fogcontroller.class.php on line 260\n', referer: http://fog.insa-rennes.fr/fog/management/index.php?node=report&sub=file&f=dXNlciB0cmFja2luZw==
    


  • @tom-elliott :
    No virus history
    0_1528958467280_v_h.png
    One Imaging History
    0_1528958503975_i_h.png
    Five Login history (a login for each date)
    0_1528958483430_l_h.png
    No Snapins


  • Senior Developer

    @quazz my best guess? Imaging history, snapin history, and (most likely) user tracking.


  • Moderator

    @fredg said in fogcontroller.class.php on line 260 : Allowed memory size of 3145728000 bytes exhausted:

    3145728000 bytes

    That’s 3GB if I’m not mistaken. I’m not sure why it decides to use so much memory for a host page in certain cases, seems like a bug perhaps.

    @Tom-Elliott any ideas on this?



  • a2disconf php7.1-fpm
    systemctl reload apache2
    
    [Wed Jun 13 15:03:50.180784 2018] [proxy_fcgi:error] [pid 30996] [client 10.1.65.176:41740] AH01071: Got error 'PHP message: PHP Fatal error:  Allowed memory size of 3145728000 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/fog/lib/fog/fogcontroller.class.php on line 260\n', referer: http://fog.insa-rennes.fr/fog/management/index.php?node=host&sub=edit&id=45
    


  • Error 2 : solved

    Error 3 : Here is the capture of the top when editing a host
    0_1528894185351_top.png

    There is no memory overflow


  • Moderator

    @quazz said in fogcontroller.class.php on line 260 : Allowed memory size of 3145728000 bytes exhausted:

    you are running a reverse proxy Nginx

    If I had to guess (unless the OP is doing something strange) that ngix might be the FOG servers. I believe that is where the FOG management gui reaches out to the FOG Project servers to get the information, both on the login and configuration pages.

    The memory exhaustion issue could be php-fpm but that issue should have been fixed with FOG 1.5.4. We can test if it is php-fpm by turning it off in the configuration file to see if the memory error is coming from there. I can see issue #1 could be related to the tighter (more exact) restrictions on php code than apache php.


  • Moderator

    @fredg You seem to have made some modifications as you are running a reverse proxy Nginx.

    Still, it’s Apache/PHP-FPM timing out on the FOG Version info page (although the proxy settings in Nginx could be related to this as well!!)

    Memory exhaustion is definitely Apache/PHP-FPM related.

    Can you navigate to a host edit page where memory exhaustion happens and then take a look at the top program in terminal. Press shift+m to sort on memory usage, take note of the ones at the top and how much they’re using.



  • I have several different errors.

    1 Dashboard

    [Tue Jun 12 09:18:40.964761 2018] [proxy_fcgi:error] [pid 9105] [client 10.2.3.11:33038] AH01071: Got error 'PHP message: PHP Notice:  A non well formed numeric value encountered in /var/www/html/fog/status/bandwidth.php on line 109\nPHP message: PHP Notice:  A non well formed numeric value encountered in /var/www/html/fog/status/bandwidth.php on line 109\nPHP message: PHP Notice:  A non well formed numeric value encountered in /var/www/html/fog/status/bandwidth.php on line 110\nPHP message: PHP Notice:  A non well formed numeric value encountered in /var/www/html/fog/status/bandwidth.php on line 110\n'
    

    2 FOG Version Information and login page

    0_1528788506534_Error_fog_version.png

    0_1528788637474_error_login.png

    3 Host -> List All Hosts -> Select host

    [Tue Jun 12 09:44:25.520305 2018] [proxy_fcgi:error] [pid 9882] [client 10.1.65.176:40332] AH01071: Got error 'PHP message: PHP Fatal error:  Allowed memory size of 3145728000 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/fog/lib/fog/fogcontroller.class.php on line 260\n', referer: http://fog.insa-rennes.fr/fog/management/index.php?node=host&sub=edit&id=1137
    

    4 ???

    [Tue Jun 12 09:45:15.182778 2018] [proxy_fcgi:error] [pid 9105] [client 10.3.1.243:53492] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Exception: Error multiple hosts returned for list of mac addresses in /var/www/html/fog/lib/fog/hostmanager.class.php:209\nStack trace:\n#0 /var/www/html/fog/lib/fog/fogbase.class.php(571): HostManager->getHostByMacAddresses(Array)\n#1 /var/www/html/fog/lib/client/registerclient.class.php(46): FOGBase::getHostItem(true, false, false, true)\n#2 /var/www/html/fog/lib/fog/fogpage.class.php(3013): RegisterClient->json()\n#3 /var/www/html/fog/lib/fog/fogpage.class.php(249): FOGPage->requestClientInfo()\n#4 /var/www/html/fog/lib/pages/processlogin.class.php(57): FOGPage->__construct('')\n#5 /var/www/html/fog/lib/fog/fogpagemanager.class.php(381): ProcessLogin->__construct()\n#6 [internal function]: FOGPageManager->{closure}('/var/www/html/f...')\n#7 /var/www/html/fog/lib/fog/fogpagemanager.class.php(386): array_map(Object(Closure), Array)\n#8 /var/www/html/fog/lib/fog/fogpagemanager.class.php(79): FOGPageManager->loadPageClasses()\n#9 [internal function]: FOGPageManager->__construct...\n'
    
    mysql> select count(*) from hostMAC GROUP by hmMAC HAVING COUNT(*) > 1 order by hmHostID;
    Empty set (0,00 sec)
    

    I tried to determine as precisely as possible the errors


  • Senior Developer

    Is there a particular page that you’re going to when you receive this error?

    I’m just going to guess here, but you’re going to a host to edit, and when you select that host, this is when you’re seeing the error? Or you’re going through reports and seeing the error? Just guessing here.


  • Moderator

    @fredg Hmmm interesting you have the right version, this issue should be fixed.

    What were you doing to cause this error? For example I was uploading a snapin, or something else?

    That is 3GB in size I want to make sure we focus on the right problem here since 1.5.4 should have fixed the memory exhaustion issue.



  • Ubuntu 16.04
    Fog 1.5.4


  • Moderator

    What version of FOG are you using? The memory exhaustion may be related to a missing parameter in php-fpm if you have fog 1.5.1 or 1.5.2.


 

420
Online

41.8k
Users

12.3k
Topics

116.0k
Posts