Error 500 while trying to display Imaging Log



  • Server
    • FOG Version: 1.2.0
    • OS: Debian 7.6
    Client
    • Service Version:
    • OS:
    Description

    In the process of trying to add storage to my existing Fog server, I seemed to have corrupted something in the database. I can upload/download images just fine, but trying to display the imaging log returns an error 500. Attached is the error.log file from /var/log/apache2. It seemed to break when I did an installation of FOG on another system as a storage node for my main FOG server. I had an issue with the second system, so I deleted the storage node and went back to just the default.

    A note about the error.log file. I’ve trimmed it to remove entries that occur when our Nessus vulnerability scanner hits the webserver, the errors in the log are from when I try to view the imaging log and it looks like there’s an issue when the FOG clients check in. Looks like my MySQL server is not accessible for some reason?

    Any help you can provide would be greatly appreciated!

    Thanks,
    Dave.

    For some reason, I couldn’t upload the file (no permissions), so here it is:

    [Fri Sep 30 06:12:17 2016] [error] [client 10.30.0.88] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 5 bytes) in /var/www/fog/lib/fog/FOGController.class.php on line 58, referer: http://fogserver/fog/management/index.php?node=report
    [Fri Sep 30 06:12:20 2016] [error] [client 10.30.0.88] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 9 bytes) in /var/www/fog/lib/fog/FOGController.class.php on line 66
    [Fri Sep 30 06:16:33 2016] [error] [client 10.30.0.88] File does not exist: /var/www/fog/management/css/images/ui-bg_glass_75_e6e6e6_1x400.png, referer: http://fogserver/fog/management/css/jquery-ui.css
    [Fri Sep 30 06:16:33 2016] [error] [client 10.30.0.88] File does not exist: /var/www/fog/management/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png, referer: http://fogserver/fog/management/css/jquery-ui.css
    [Fri Sep 30 06:16:33 2016] [error] [client 10.30.0.88] File does not exist: /var/www/fog/management/css/images/ui-bg_flat_75_ffffff_40x100.png, referer: http://fogserver/fog/management/css/jquery-ui.css
    [Fri Sep 30 06:18:16 2016] [error] [client 10.30.0.88] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 5 bytes) in /var/www/fog/lib/fog/FOGController.class.php on line 58, referer: http://fogserver/fog/management/index.php?node=report
    [Fri Sep 30 06:19:25 2016] [error] [client 10.30.0.88] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes) in /var/www/fog/lib/pages/ReportManagementPage.class.php on line 684, referer: http://fogserver/fog/management/index.php?node=report
    [Fri Sep 30 06:21:02 2016] [error] [client 10.30.0.88] PHP Warning:  array_merge(): Argument #1 is not an array in /var/www/fog/lib/pages/ReportManagementPage.class.php on line 966, referer: http://fogserver/fog/management/index.php?node=report&sub=pend-mac
    [Fri Sep 30 06:21:07 2016] [error] [client 10.30.0.88] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /var/www/fog/lib/pages/ReportManagementPage.class.php on line 684, referer: http://fogserver/fog/management/index.php?node=report&sub=snapin-log
    [Fri Sep 30 06:21:11 2016] [error] [client 10.30.0.88] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 9 bytes) in /var/www/fog/lib/fog/FOGController.class.php on line 66, referer: http://fogserver/fog/management/index.php?node=report&sub=snapin-log
    [Fri Sep 30 06:47:59 2016] [error] [client 10.30.0.125] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /var/www/fog/lib/fog/FOGBase.class.php on line 53, referer: http://10.30.0.125/fog/management/index.php?node=report
    [Fri Sep 30 06:48:12 2016] [error] [client 10.30.0.125] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /var/www/fog/lib/pages/ReportManagementPage.class.php on line 684, referer: http://10.30.0.125/fog/management/index.php?node=report
    [Fri Sep 30 06:54:01 2016] [notice] caught SIGTERM, shutting down
    [Fri Sep 30 06:54:32 2016] [notice] Apache/2.2.22 (Debian) PHP/5.4.4-14+deb7u14 configured -- resuming normal operations
    [Fri Sep 30 06:54:33 2016] [error] [client 10.30.3.184] PHP Warning:  mysqli::mysqli(): (HY000/2002): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /var/www/fog/lib/db/MySQL.class.php on line 64
    [Fri Sep 30 06:54:33 2016] [error] [client 10.30.3.184] PHP Warning:  mysqli::select_db(): Couldn't fetch mysqli in /var/www/fog/lib/db/MySQL.class.php on line 165
    [Fri Sep 30 06:54:33 2016] [error] [client 10.30.3.184] PHP Warning:  mysqli::query(): Couldn't fetch mysqli in /var/www/fog/lib/db/MySQL.class.php on line 89
    [Fri Sep 30 06:54:33 2016] [error] [client 10.30.3.184] PHP Warning:  MySQL::sqlerror(): Couldn't fetch mysqli in /var/www/fog/lib/db/MySQL.class.php on line 180
    [Fri Sep 30 06:54:33 2016] [error] [client 10.30.3.184] PHP Warning:  array_key_exists() expects parameter 2 to be array, null given in /var/www/fog/lib/db/MySQL.class.php on line 150
    [Fri Sep 30 06:54:33 2016] [error] [client 10.30.3.184] PHP Warning:  mysqli::mysqli(): (HY000/2002): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /var/www/fog/lib/db/MySQL.class.php on line 64
    [Fri Sep 30 06:54:33 2016] [error] [client 10.30.3.184] PHP Warning:  mysqli::select_db(): Couldn't fetch mysqli in /var/www/fog/lib/db/MySQL.class.php on line 165
    [Fri Sep 30 06:54:33 2016] [error] [client 10.30.3.184] PHP Warning:  mysqli::query(): Couldn't fetch mysqli in /var/www/fog/lib/db/MySQL.class.php on line 89
    [Fri Sep 30 06:54:33 2016] [error] [client 10.30.3.184] PHP Warning:  MySQL::sqlerror(): Couldn't fetch mysqli in /var/www/fog/lib/db/MySQL.class.php on line 180
    [Fri Sep 30 06:54:33 2016] [error] [client 10.30.3.184] PHP Warning:  array_key_exists() expects parameter 2 to be array, null given in /var/www/fog/lib/db/MySQL.class.php on line 150
    
    [Fri Sep 30 06:55:38 2016] [error] [client 10.30.0.88] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /var/www/fog/lib/fog/FOGBase.class.php on line 53, referer: http://fogserver/fog/management/index.php?node=report
    

    Mod edited to use code box, please use code boxes in the future.



  • @Wayne-Workman said in Error 500 while trying to display Imaging Log:

    @Dave-Wolf said in Error 500 while trying to display Imaging Log:

    but if I try to use this name and password to access the mySQL database, it fails to login.

    How are you trying to use it? Give us the command, replace the password with something else but ensure the structure of the command is the same.

    @Dave-Wolf said in Error 500 while trying to display Imaging Log:

    What should the FOG_STORAGE_MYSQLUSER actually be in the web config page?

    It should be fogstorage

    I initially thought that my report display problem was an issue with the SQL database, so I was following the “Testing MySQL” section of the “Troubleshooting MySQL” section of the wiki. I was using the following command:

    mysql -u fogstorage -p****** -D fog

    and I was getting an “access denied” message, though I just checked that again now and it is working fine. So I’m not sure what was wrong, maybe it was just Friday after a long week…

    In any case, thank you so much again for your responses to help me resolve the imaging report issue.

    Cheers,
    Dave.



  • @Wayne-Workman Thanks! That change worked and got me to the date range selection page. If I select 2016-10-01 for the date range (both start and end), the report executes (after a looong time, maybe a minute or more) and shows me the imaging jobs for that date. Is there a way to clear out old entries to speed up the report? If not, no problem, I’m just glad I could get it to run again! I really appreciate the help, thanks again!

    Cheers,
    Dave.


  • Moderator

    @Dave-Wolf said in Error 500 while trying to display Imaging Log:

    but if I try to use this name and password to access the mySQL database, it fails to login.

    How are you trying to use it? Give us the command, replace the password with something else but ensure the structure of the command is the same.

    @Dave-Wolf said in Error 500 while trying to display Imaging Log:

    What should the FOG_STORAGE_MYSQLUSER actually be in the web config page?

    It should be fogstorage


  • Moderator

    @Dave-Wolf This error:

    PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted
    

    Indicates that what you’re doing requires more RAM than what PHP is allowed to use. You need to increase this. I’m not sure about FOG 1.2.0, but in the Release Candidate for 1.3.0 it’s FOG Configuration -> FOG Settings -> General Settings -> FOG_MEMORY_LIMIT just as Tom already pointed out.

    If you really do not have this setting, you can manually set this. You would edit the php.ini file on your system via CLI, as root. This is usually stored in /etc/php.ini or /etc/php.d/cgi/php.ini or /usr/local/etc/php.ini
    If it’s not in any of these places, search for it with find / | grep /php.ini

    Once you find it, edit it with your chosen text editor and add this line:

    memory_limit = 512M
    

    Or whatever limit you feel appropriate. Do not set this to the amount of RAM you have, that could crash your server. It’s limited for a reason.

    You could give the server a reboot after changing this to ensure the setting takes - I’m not all that familiar with Debian 7 really.



  • Hi Tom,

    Some more info; my FOG_STORAGENODE_MYSQLUSER is set to fogstorage with a long password, but if I try to use this name and password to access the mySQL database, it fails to login. I can login to the database with my root user and password. What should the FOG_STORAGE_MYSQLUSER actually be in the web config page?

    Thanks,
    Dave.



  • Hi Tom!

    Hmmm, I don’t have an entry for FOG_MEMORY_LIMIT under General Settings on my 1.2.0 install (which has been running for a couple of years).

    Thanks,
    Dave.


  • Senior Developer

    Goto:

    FOG Configuration Page->FOG Settings->General Settings->FOG_MEMORY_LIMIT

    It’s most likely currently set to 128, set it to say 256 or 512, and your imaging log should display. You may need to increase the memory limit further, but I have no idea.


Log in to reply
 

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.