There are a number of ways in which incoming sessions might get stuck in the XNAT prearchive. A server crash, power failure, disk error (e.g. no space left on the device), and even operator error (e.g. an administrator mistakenly deleting prearchive folders) can lead to entries in the prearchive that can't be removed through the standard UI or REST API calls.

The prearchive really consists of two components:

Depending on whether the data in the prearchive folder is valid and complete, you may be able to clear stuck entries simply by clearing the prearchive table. The prearchive table is validated and rebuilt on each restart of the Tomcat server and will be rebuilt from any data that exists in the prearchive folder. If there are issues with the data stored in the folder, you may need to remove that as well, since the new prearchive entries will be rebuilt from that faulty data.

Step-by-step guide

To clear stuck sessions from the prearchive:

  1. Shut down your Tomcat server.
  2. Drop the database table for the prearchive:

    psql -U xnat -c 'drop table xdat_search.prearchive'
  3. You can optionally delete data from your prearchive folder:
  4. Once you've dropped the database table and optionally cleared any faulty data, start your Tomcat server.

When XNAT starts up, it will rebuild the prearchive table from the data remaining in the prearchive folder. This includes creating the table if necessary and reviewing all session data.

Related articles

Related issues