HTTP Error 500 @ /ports/ - Resolved

Just got this up and running with little over 170 devices deployed from the VMDK into a VMWare environment. I have run ./validate.php and worked through a couple minor issues and I up to date. When I try to access “Ports” from the drop down menu I get HTTP Error 500. This only happens on the root “/ports/” page. The other two “Ports” pages work just fine “/ports/errors=1/” & “/ports/ignore=1/”.

I could use some help just knowing where to look for errors, I am not sure where to start.

Update: I found the debug option (/debug=yes/) but I am still getting the HTTP 500 error with no support information.

==========================================================

Component Version
LibreNMS c8ba28a1e3007930b0f34483c0388a95a7e9535e
DB Schema 159
PHP 7.0.13-0ubuntu0.16.04.1
MySQL 10.0.29-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

==========================================================

[OK] Database connection successful

That page is paginated so I wouldn’t expect it’s because it’s a php memory limit but add /debug=true/ to the end of /ports/ and try again + check web server logs.

If that doesn’t show anything check your developers console.

Thank you for the tip on /debug=true/. If I had read, a bit more I would have found this useful document.

I solved the issue but here are some notes in case someone else runs into the issue.

Start with monitoring the error log file:

tail /opt/librenms/logs/error_log --follow

Browse to your page that you have issue adding /debug=yes/ to the end. Then review your tailed error log. Mine had this Allowed memory size issue.

PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 81920 bytes) in /opt/librenms/html/index.php on line 33

Edit the php.ini with your editor of choice.

nano /etc/php/7.0/fpm/php.ini

Find the option: memory_limit = 128M

Increase this limit until your error is no longer occurring in the error log. I started with 256M but doubled it again to 512M to resolve the error. Apparently, I have over 20k ports, so I guess it just needed more room. I hope this helps someone.

1 Like

I had same problem and your solution works for me. Thanks a lot!