Diagnosing and reporting critical errors

It is essential to gather as many details as possible about an issue once it appears. For this purpose, we provide utilities that generate such issue reports by collecting data from various log files, JVM, etc. Using these issue reports helps us to investigate the problem and provide an appropriate solution as quickly as possible.

Running a system report

GraphDB provides an easy way to gather all important system information and package it as an archive that can be sent to graphdb-support@graphwise.ai. Run the report using the GraphDB Workbench, or from the generate-report script in the bin directory of your distribution. The report is saved in the GraphDB-Work/report directory. There is always one report — the one that has been generated most recently.

Report content

  • GraphDB version

  • recursive directory list of the files in GraphDB-Home as home.txt

  • recursive directory list of the files in GraphDB-Work as work.txt

  • recursive directory list of the files in GraphDB-Data data.txt

  • the 30 most recent logs files from GraphDB-Logs ordered by time of creation

  • full copy of the content of GraphDB-Conf

  • the output from jcmd GC.class_histogram as jcmd_histogram.txt

  • the output from jcmd Thread.print as thread_dump.txt

  • the System Properties for the GraphDB instance

  • the repository configurations info as system.ttl. All repositories can be found in this file.

  • the owlim.properties file for each repository if found. It exists only when the repository has been initialized at least once.

_images/report.png

In a cluster, the report can be run from each node in the group. It adds the following to the standard report:

  • Report data for each node in the cluster

  • Information about the cluster status in the graphdb-server-report-<timestamp>/cluster/cluster-status.json file: endpoints, status, and state of each node

  • cluster-config.ttl: The cluster configuration in Turtle format

Each node where a report is requested triggers the report for other nodes, and waits for the result until it is ready, or until a certain time limit is reached. The maximum time to wait is configured via the graphdb.wait.report.minutes property in the graphdb.properties with a default of 120 minutes. In case of a timeout or an error, it will be written to the info.txt file for the corresponding node.

Create report from the Workbench

Go to Help ‣ System information. Click on New report in the Application info tab to obtain a new one, wait until it is ready, and download it. It is downloaded in .zip format as graphdb-server-report-<timestamp>.

_images/create-report.png

Create report through the report script

The generate-report script can be found in the bin folder in the GraphDB distribution. It needs graphdb-pid — the GraphDB for which you want a report. An optional argument is output-file, the default for which is graphdb-server-report.zip.

Logs

GraphDB uses slf4j for logging through the Logback implementation (the RDF4J facilities for log configuration discovery are no longer used). Instead, the whole distribution has a central place for the logback.xml configuration file in GraphDB-HOME/conf/logback.xml. If you use the .war file setup, you can provide the log file location through a system parameter, or GraphDB will pick it up from the generated .war file.

Note

Check the Logback configuration location rules for more information.

On startup, GraphDB logs the logback configuration file location:

[INFO ] 2022-06-06 09:44:26,179 [main | c.o.g.Config] Using 'file:/opt/graphdb/conf/logback.xml' as logback's configuration file

Setting up the root logger

The default root logger is set to info. You can change it in several ways:

  • Edit the logback.xml configuration file.

    Note

    You do not have to restart the database as it will check the file for changes every 30 seconds, and will reconfigure the logger.

  • Change the log level through the logback JMX configurator. For more information, see the Logback manual chapter 10.

  • Start each component with graphdb.logger.root.level set to your desired root logging level. For example:

    bin/graphdb -Dgraphdb.logger.root.level=WARN
    

Logs location

By default, all database components and tools log in GraphDB-HOME/logs when run from the bin folder. If you set up GraphDB by deploying .war files into a standalone servlet container, the following rules apply:

  1. To log in a specified directory, set the logDestinationDirectory system property.

  2. If GraphDB is run in Tomcat, the logs can be found in $catalina.base/logs/graphdb.

  3. If GraphDB is run in Jetty, the logs can be found in $jetty.base/logs/graphdb.

  4. Otherwise, all logs are in the logs subdirectory of the current working directory for the process.

Log files

Different information is logged in different files. This makes it easier to follow what goes on in different parts of the system.

File name

Description

main.log

Contains all operational and error messages coming from the main part of the engine. Provides information about your overall system state, active repositories, plugins, operations.

error.log

Contains all ERROR messages returned while the instance was running. The error messages are also present, usually with more context, in the main log. The error log is useful mostly in cases where the main log moves too fast to examine the main log.

query.log

Contains all queries that were sent to the database, as well as the repository where they were executed. It can also contain the username of the user who initiated the query but for security reasons this has been disabled in the default GraphDB configuration (it can be enabled through graphdb.querylog.username.enabled). The format is machine-readable and allows you to replay the queries when debugging a problem. All file inserts would leave a trace somewhere, unless deleted explicitly, but an update query would be invisible to anyone but the person executing it. If this log is set to debug level, it will store all queries.

slow-query.log

Contains slow queries — queries that take more than a set amount of seconds — as well as the repository where they were executed. It can also contain the username of the user who initiated the query but for security reasons this has been disabled in the default GraphDB configuration (it can be enabled through graphdb.querylog.username.enabled). The duration after which a query will be considered a slow query is controlled by the graphdb.engine.log-slow-queries-time parameter and defaults to 60.

audit.log

This log only appears on a running GraphDB instance with security ON. Contains information about each HTTP request — from which IP address did it come from, with which user, what were the contents (truncated), what was the response code. To start an audit trail, at least one of the graphdb.audit.role and graphdb.audit.repository parameters should be enabled.

The main log is the log that is usually examined when monitoring for problems. All recent logs are included in the server report to facilitate reporting issues.

You can configure the logs with the logback.xml file. By default, this is located inside the conf directory, together with the GraphDB properties file. When starting GraphDB from bin/graphdb, it prints a message to the console with information about where it sources its logging configurations.

The logback.xml file is heavily commented with instructions about what options you can set and how to set them. Entries in this file let you set parameters such as:

  • The maximum age or size of a log file before it is archived

  • The format of log file names, such as whether and where to include the system date

  • What types of things get logged and what level of INFO/WARN/ERROR severity should trigger log entries

  • Level of verbosity for the different loggers