Troubleshooting
From DLXS Documentation
(→Log files) |
(→Log files) |
||
Line 120: | Line 120: | ||
<table border="1"> | <table border="1"> | ||
<tr><td><b>Filename</b></td><td><b>Where configured</b></td><td><b>Errors logged</b></td></tr> | <tr><td><b>Filename</b></td><td><b>Where configured</b></td><td><b>Errors logged</b></td></tr> | ||
- | + | <tr><td><tt>/tmp/itemviewmkdiroutput.log</tt></td><td><tt>$DLXSROOT/lib/ItemView.cfg</tt></td><td>Pageviewer command errors to process source image files for web delivery and logs of all pageviewer commands when URL has <tt>debug=pageviewer </tt> <tr><td><tt>/tmp/classmkdiroutput.log</tt></td><td><tt>$DLXSROOT/lib/LibGlobals.cfg</tt></td><td>General commands create cache directories for pageviewer frames and portfolio exports if URL has <tt>debug=pageviewer</tt>. Always logs if command error. </td></tr> | |
- | + | ||
<tr><td><tt>/tmp/dbconnectionfailures.txt</tt></td><td><tt>Hardcoded in $DLXSROOT/lib/DbUtils.pm</tt></td> <td>Log of the DBI error string if a <tt>DBI->connect()</tt> to MySQL fails</td></tr> | <tr><td><tt>/tmp/dbconnectionfailures.txt</tt></td><td><tt>Hardcoded in $DLXSROOT/lib/DbUtils.pm</tt></td> <td>Log of the DBI error string if a <tt>DBI->connect()</tt> to MySQL fails</td></tr> | ||
<tr><td>/tmp/pageviewmode</td><td>Hardcoded in $DLXSROOT/lib/ItemView.pm</td><td>Records the mode (local or remote) of access to page image files. Only logged when URL has <tt>debug=pageviewer</tt></td></tr> | <tr><td>/tmp/pageviewmode</td><td>Hardcoded in $DLXSROOT/lib/ItemView.pm</td><td>Records the mode (local or remote) of access to page image files. Only logged when URL has <tt>debug=pageviewer</tt></td></tr> | ||
- | |||
===Apache error log=== | ===Apache error log=== |
Revision as of 14:57, 9 August 2007
Here are some tools, facilities and techniques useful for troubleshooting problems with the middleware after installation.
Assertion failures
If the CGI program runs but encounters a condition that makes it impossible to perform a specific function it will exit and generate an assertion failure page. An example might be a missing Terminology Mapper map file for one of your collections.
The DLPS_DEV environment variable must be set to get this output.
Note that this page displays an optional message about the nature of the failure, the URL that led to the assertion failure and a traceback of the stack up to the point the assertion failed and .
By examining each part you may be able to determine the reason for the failure. Sometimes it is useful to look at the line number in the code mentioned in the traceback to determine why the error occurred especially if no message appears.
Server errors
If you see a page similar to this page it may due to a syntax error in your code. You can check the code for correct syntax or reveal other errors you encounter when running under the web server by running at the command line.
Another possibility is that the location of Perl in your system has changed since the middleware was installed. This means the symlink to Perl in $DLXSROOT/bin/symlinks is now bad. You can change the symlink manually or restore Perl to its original location.
Debug flags
There are several useful debug flags which aid in determining the source of errors. Add ;debug=switch to the URL that caused the error and re-submit the URL in you browser. The Debugging DLXS Perl Code section describes all the debug flags. The most useful values for switch are:
- all</dt>
- Turn on all debugging switches. This generates a lot of data.</dd>
- collsinfo</dt>
- Dump the contents of the CollsInfo database object. This lets you check that the database values for each collection, which you think are set, are actually those being used by the program.</dd>
- env</dt>
- dump the environment variables and their values. You can check for the correct values of critical environment variables such as REMOTE_USER, HTTP_HOST, AUTHZD_COLL, DLXSROOT and DOCUMENT_ROOT. This is a quick sanity check on the values of these environment variables set for CGI program by the web server / virtual host. </dd>
- tpl</dt>
- show the path where files subject to fallback resolution (.xml, .xsl, .css, .js) are found.
- xml</dt>
emit the raw xml from the middleware not subjected to XSLT transformation to HTML.
- xslt</dt> emit the virtual stylesheet constructed by the middleware.
- search</dt> dump the raw XPAT queries the middleware generated for a given search</dd>
- xslt</dt> emit the virtual stylesheet constructed by the middleware.
Tools, checks and techniques
You can get additional information about what might be going wrong by using the following. It is useful if you can send us this information in support requests too.
Running at the command line
NOTE: Whenever you run at the command line, the web server is not in the loop, so set these environment variables in your csh or bash shell:
- set AUTHZD_COLL to include the collections that appear in your command line script parameters:
(csh) % setenv AUTHZD_COLL :moa:moajrnl:sampletc:workshoptc:
(bash) % export AUTHZD_COLL=:moa:moajrnl:sampletc:workshoptc: - set DLXSROOT:
(csh) % setenv DLXSROOT path_to_the_root_of_your_install_tree
(bash) % export DLXSROOT=path_to_the_root_of_your_install_tree - set DLPS_DEV to get more debugging information:
(csh) % setenv DLPS_DEV 1
(bash) % export DLPS_DEV=1
Given a URL that causes a server error, try running the CGI program at the command line with the same input to get additional information about the problem. For example, given http://pfarber.ws.umdl.umich.edu/cgi/t/text/text-idx?c=sampletc_utf8;page=simple you can run the CGI program at the command line like this (note quotes):
<b> % cd $DLXSROOT/cgi/t/text % ./text-idx 'http://pfarber.ws.umdl.umich.edu/cgi/t/text/text-idx?c=sampletc_utf8;page=simple' </b>
Running the Perl debugger at the command line
You can also run the Perl debugger at the command line with the -d switch and step through the code line by line by typing 'n' or run until an error occurs by typing 'c' at the Perl debugger prompt DB<1>. This assumes the code compiles and can be executed:
<b> % cd $DLXSROOT/cgi/t/text/text-idx % perl -d ./text-idx 'http://pfarber.ws.umdl.umich.edu/cgi/t/text/text-idx?c=sampletc;page=simple' </b> </b> <i>Current directory is /l1/dev/pfarber/cgi/f/findaid/ Loading DB routines from perl5db.pl version 1.28 Editor support enabled. Enter h or `h h' for help, or `man perldebug' for more help. DB<1></i>
Set the DLPS_DEV environment variable
Set DLPS_DEV to 1 in your shell (debugging at the command line) or in your virtual host (developing under the browser) to get a full stack trace when a compilation error or runtime assertion failure occurs.
Log files
Here is a list of log files that will contain status and error messages related to various operations.
Filename | Where configured | Errors logged |
/tmp/itemviewmkdiroutput.log | $DLXSROOT/lib/ItemView.cfg | Pageviewer command errors to process source image files for web delivery and logs of all pageviewer commands when URL has debug=pageviewer |
/tmp/classmkdiroutput.log | $DLXSROOT/lib/LibGlobals.cfg | General commands create cache directories for pageviewer frames and portfolio exports if URL has debug=pageviewer. Always logs if command error. |
/tmp/dbconnectionfailures.txt | Hardcoded in $DLXSROOT/lib/DbUtils.pm | Log of the DBI error string if a DBI->connect() to MySQL fails |
/tmp/pageviewmode | Hardcoded in $DLXSROOT/lib/ItemView.pm | Records the mode (local or remote) of access to page image files. Only logged when URL has debug=pageviewer |