Debugging GeoNode Installations¶
There are several mechanisms to debug GeoNode installations, the most common ones are discussed in the following sections.
Viewing the logs¶
There are many kinds of logs in GeoNode, most of them are located in /var/log/geonode/ and will be explained below in order of relevance:
GeoNode main log: This is the output of the Django aplication generated by Apache, it may contain detailed information about uploads and high level problems.
The default location is /var/log/geonode/apache.log or /var/log/apache2/error.log.It is set to a very low level (not very much information is logged) by default, but it’s output can be increased by setting the logging level to DEBUG in /etc/geonode/local_settings.py.
GeoServer log: It contains most of the information related to problems with data, rendering and styling errors.
This one can be accessed at GEOSERVER_DATA_DIR/logs/geoserver.log, which is usually /var/lib/geoserver/geonode-data/logs/geoserver.log`.
It may also be symlinked in /var/log/geonode/geoserver.log.
Geonetwork log: Contains information about CSW and metadata handling.
Records related to bad html parsing could be further identified by analyzing GeoNetwork logs.
It is symlinked in /var/log/geonode/geonetwork.log and originally in /var/lib/tomcat6/logs/geonetwork.log.
Tomcat logs: Tomcat logs could indicate problems loading GeoServer or GeoNetwork.
They can be found at /var/lib/tomcat6/logs/catalina.out.
PostgreSQL logs: Postgres is accessed by GeoNetwork, GeoServer and Django, therefore information abouterrors which are very hard to debug may be found by looking at PostgreSQL’s logs.
They are located at /var/log/postgresql/postgresql-8.4-main.log.
Enabling DEBUG mode¶
Django can be set to return nicely formatted exceptions which are useful for debugging instead of generic 500 errors.
This is enabled by setting DEBUG=True in /etc/geonode/local_settings.py.
After enabling DEBUG, the Apache server has to be restarted for the changes to be picked up. In Ubuntu:
sudo service apache2 restart
Other tips and tricks¶
Modifying GeoServer’s output strategy¶
Up to version 1.1, GeoNode used by default the SPEED output strategy of GeoServer, this meant that proper error messages were being sacrificed for performance. Unfortunately, this caused many errors to be masked as XML parsing errors when layers were not properly configured.
It is recommended to verify the output strategy is set to PARTIAL_BUFFER2 (or a safer one, e.g. FILE) with a high value for the buffer size. More information about the different strategies and the performance vs correctness tradeoff is available at GeoServer’s web.xml file.
The typical location of the file that needs to be modified is /var/lib/tomcat6/webapps/geoserver/WEB-INF/web.xml as shown below:
<context-param> <param-name>serviceStrategy</param-name> <param-value>PARTIAL_BUFFER2</param-value> </context-param>