Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleFinding the detailed error message is important!

In DSpace 7, there are two main places where detailed error messages may be found. It is important to locate these detailed error messages in order to debug any issues you are seeing. (The generic error messages that appear in the User Interface do not provide enough information to debug the problem.)

  1. In your web browser's DevTools when running the User Interface - because the v7 User Interface is built with JavaScript (Angular.io), some errors are only visible in your browser (and therefore will never appear in log files). See "Finding the Error Message in the User Interface" below.
  2. In the backend's log files - Some errors (especially 500 responses/errors) will result in the error message being logged to your dspace.log or Tomcat logs. See "Finding error messages in the REST API logs" below.

Once you locate the detailed error, see the section on "Found an error message! Now what?" below.

...

1. Finding the Error Message in the User Interface (Try this first!)

In DSpace 7, the User Interface is built with JavaScript (Angular.io). This means that some errors are only visible in your browser (and therefore will never appear in log files).

...

Note

If the User Interface error is a generic 500 response, that means there's an error that occurred on your backend.  Check your DSpace logs or Tomcat logs for information on the exact error.  See the below section on "Finding error messages in the REST API logs".

2. Finding error messages in the REST API logs

Some (but not necessarily all) errors will result in logged errors on the backend. Similar to DSpace 6.x and below, the error message should be in either [dspace]/log/dspace.log OR [tomcat]/logs/.

...

  • yyyy-mm-dd time ERROR ... OR,
  • yyyy-mm-dd time WARN ...

3. Debug mode for the REST API (

...

if necessary)

If you are not seeing the error appear in the REST API logs, and the error information is minimal in the User Interface, you can tell the REST API to always return the entire error stacktrace in any error response.  This is done by temporarily adding the following to your local.cfg (on the backend): 

...

WARNING: Keep in mind that you should only enable this setting TEMPORARILY.  Keeping this set to "always" is a security issue in Production scenarios, as it allows anyone to view the detailed stacktrace of any error they cause.  These stacktraces can sometimes leak important information about your underlying system which can help hackers to find vulnerabilities.

4. Turning on Debug Logging for the REST API (

...

if necessary)

If none of the above helped, or you are hitting a very strange backend error, you can change the DSpace logger settings to DEBUG which will sometimes provide you with more information about the error. To turn on debugging, visit the [dspace]/config/log4j2.xml file and do the following:

  • To enable DEBUG logging in the dspace.log file, change the loglevel.dspace Property to DEBUG rather than INFO.

  • NOTE: You'll need to restart Tomcat after enabling DEBUG mode in the log4j2.xml file.

  • WARNING: Make sure to turn off debugging once you are finished. Leaving debugging turned on will cause the log files to grow very large very quickly!

5. Found an error message! Now what?

See "Report the Error and Describe How You Encountered It" below.

...