Lightsquid Graph 500 Server Error Resolution



  • Hi All

    I recently updated my Firewalls to the latest release of pfSense 2.0.2. Once the update was completed and the packages had been re-installed I ran into the issue where the Lightsquid graphs were no longer working and I instead was getting a "Server 500 Error". I have encountered this error before and had to do the research twice to fix it so here is a quick resolution so that I can easily find it again if I need to.

    SSH as root to the firewall and go to

    cd /usr/local/www/lightsquid
    

    Then run the lightsquid check which will check for all the lightsquid dependencies

    ./check-setup.pl
    

    If this command throws an error then you will need to install perl which can be done with the following command:

    pkg_add -rvf ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/Latest/perl.tbz
    

    Try running the check-setup command again. If you still encounter errors you may need to resolve the links from /usr/bin to /usr/local/bin
    Here are the commands to do so: (Note: the version numbers on your system may be different to those stated below)

    
    ln -s /usr/local/bin/perl5.14.2 /usr/bin/perl
    ln -s /usr/local/bin/perl5.14.2 /usr/bin/perl5
    
    

    You may also need to update the perl5 link in /usr/local/bin

    
    ln -s /usr/local/bin/perl5.14.2 /usr/local/bin/perl5
    
    

    When the check-setup command is runs you will likely encounter the output error: "no: GD.PM found, please install or set $graphreport=0 to disable"
    To resolve this we will need to install the p5-GD libraries. Use the command below to do so

    pkg_add -rvf ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/Latest/p5-GD.tbz
    

    Run the check-setup command after the install completes and you should get an output similar to:

    
    LightSquid Config Checker, (c) 2005-9 Sergey Erokhin GNU GPL
    
    LogPath   : /var/squid/logs
    reportpath: /var/lightsquid/report
    Lang      : /usr/local/share/lightsquid/lang/eng
    Template  : /usr/local/www/lightsquid/tpl/novosea
    Ip2Name   : /usr/local/libexec/lightsquid/ip2name.dns
    
    WARNING: $skipurl variable contain unescaped '.' char !!!
    WARNING: if you use . as regular expression metacharacter please use '' instead "" and escape . via \.
    WARNING: $skipurl now ->zzz.zzz<
    
    all check passed, now try access to cgi part in browser
    
    

    Your graphs should now work correctly.

    NOTE: On one of the firewalls I configured I had to re-run the install for perl library and dependencies again before the system picked up the missing library.



  • I encounter the "no gd.pm found" error but when i run the pkg_info it states that i do have it installed.

    What should I do?

    Great tutorial btw



  • @asmat:

    I encounter the "no gd.pm found" error but when i run the pkg_info it states that i do have it installed.

    What should I do?

    Great tutorial btw

    It is likely that your links are not in the right place but I'd need more info to go on in order to help more. eg. pkg_info output etc.

    Your other option is to run the command

    
    pkg_add -rvf ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/Latest/p5-GD.tbz
    
    

    Which will forcefully install the p5-GD package and dependencies again, hopefully repairing the links.



  •  pkg_info
    bsdinstaller-2.0.2012.1207 BSD Installer mega-package
    cyrus-sasl-2.1.25_1 RFC 2222 SASL (Simple Authentication and Security Layer)
    cyrus-sasl-2.1.25_2 RFC 2222 SASL (Simple Authentication and Security Layer)
    db3-3.3.11_3,1      The Berkeley DB package, revision 3.3
    db41-4.1.25_4       The Berkeley DB package, revision 4.1
    db42-4.2.52_5       The Berkeley DB package, revision 4.2
    expat-2.0.1_2       XML 1.0 parser written in C
    fontconfig-2.8.0,1  An XML-based font configuration API for X Windows
    freetype2-2.4.7     A free and portable TrueType font rendering engine
    gd-2.0.35_7,1       A graphics library for fast creation of images
    gettext-0.18.1.1    GNU gettext package
    jpeg-8_3            IJG's jpeg compression utilities
    libiconv-1.13.1_1   A character set conversion library
    libiconv-1.14       A character set conversion library
    libwww-5.4.0_4      The W3C Reference Library
    lightsquid-1.8_2    A light and fast web based squid proxy traffic analyser
    neon29-0.29.6_4     An HTTP and WebDAV client library for Unix systems
    net-snmp-5.7.1_7    An extendable SNMP implementation
    nut-2.6.4           Network UPS Tools
    openldap-client-2.4.26 Open source LDAP client implementation
    openldap-sasl-client-2.4.31_1 Open source LDAP client implementation with SASL2                 support
    p5-GD-2.46          A perl5 interface to Gd Graphics Library version2
    perl-5.12.4_3       Practical Extraction and Report Language
    perl-5.14.2_2       Practical Extraction and Report Language
    perl-threaded-5.12.4_4 Practical Extraction and Report Language
    pkg-config-0.25_1   A utility to retrieve information about installed libraries
    pkgconf-0.8.7_2     pkg-config compatible utility which does not depend on glib
    png-1.4.8           Library for manipulating PNG images
    squid-2.7.9_1       HTTP Caching Proxy
    squid-3.1.20        HTTP Caching Proxy
    squidGuard-1.4_4    A fast redirector for squid
    
    

    this is the output. I already tried removing and recreating symlinks but still find the error

    I will try your suggestion to reinstall p5-GD package



  • Confirmed. That first post in this thread fixed the problems. I'm latest build 2.1.
    Had to reload / refresh browser though (Ctrl+R  / F5) to get the graphs to show.


  • Rebel Alliance Developer Netgate

    Try to remove all that and remove lightsquid as well and reinstall.

    I changed the build options on the PBI to ensure that it includes perl and GD. If that alone isn't enough, then the install code may need to make some additional symlinks and such.



  • Hi Jimp,

    When I execute per graph.cgi from the shell it come out like this:

     perl graph.cgi
    Can't load '/usr/local/lib/perl5/site_perl/5.12.4/mach/auto/GD/GD.so' for module GD: /usr/local/lib/perl5/site_perl/5.12.4/mach/auto/GD/GD.so: Undefined symbol "PL_sv_undef" at /usr/local/lib/perl5/5.12.4/mach/DynaLoader.pm line 200.
     at graph.cgi line 23
    Compilation failed in require at graph.cgi line 23.
    BEGIN failed--compilation aborted at graph.cgi line 23.
    
    

    I even tried uninstalling all packages and try almost every install sequence but still having this error.

    For the record, the lightsquid graph is the only thing not working in my setup. Everything else is just perfect.



  • Hey Jimp

    I tested your changes, by uninstalling and re-installing lightsquid the problem appears to resolve itself.

    Thanks bud  :)


  • Rebel Alliance Developer Netgate

    So it does… with one exception. If you install git (for gitsync) before lightsquid, git's perl install doesn't have GD so it won't find it.

    But if you uninstall git, remove/reinstall lightsquid, then it works.



  • Please note that the perl package location has changed.

    Use to update link:

    
    pkg_add -rvf ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/Latest/perl.tbz
    
    

Log in to reply