Skip to content

Troubleshooting Common Issues

dbeasley1 edited this page Jul 8, 2026 · 5 revisions

Do NOT attempt to rebuild XNAT.

It will overwrite everything - data and containers.

Read the Maintenance and Scripts page before proceeding.

Debugging

Logfiles:

XNAT logfiles are located in:

[STORAGE PATH]/xnat/tomcat_log

The default _STORAGE PATH _is /xnat-data/ and is set in the xnat.cfg configuration file. When an error occurs, it is good to check the log files by modified date/time to see the latest files which may indicate the source of the error.

Nginx log files can be found in:

[STORAGE PATH]/xnat/nginx_logs

Server Issues:

If the browser returns an 501 error or nothing:

Check to see if all docker containers are running:

docker ps

All three containers should be running - xnat-stack_xnat-nginx1, xnat-stack_xnat-db1, xnat-stack_xnat-web1.

Try restarting tomcat:

cd [install dir]/Linux
sudo ./restart_tomcat.sh

If this does not solve the issue:

sudo ./restart.sh

If this still does not resolve the issue, check the tomcat_log and nginx_log files. Check for possible issues with the server - space remaining, etc.

Lost access to PACS from XNAT

If you have restarted the sever and are unable to reach PACS using the DQR plugin, for example:

Administer -> Plugin Settings -> DQR Settings

Click on ping but it fails.

Follow these steps:

Try pinging the PACS from the host:

ping [PACS ip]

Try pinging the PACS from inside the container:

cd Linux
./docker-bash.sh
ping [PACS ip]

If you can ping from the host, but not the container, your default routing may have changed. Restarting XNAT should reset this:

cd Linux
sudo ./restart.sh

Broken Database? Restore from a backup:

If the database is truly broken (sometimes after upgrading) use the script:

restore_from_pg_backup.sh

A nightly backup of the database is produced and stored in /xnat-data/xnat/scripts/pg_backup/. Locate the latest usable backup file [xnat.sql.gz] and follow the instructions.

Scans arrive in pre-archive incomplete, 'directory cannot be created' error

Check space and inodes - the numberof files permitted on the filesystem. Scans can contain many seperate dicom files and some default limits for filesystems can be too low when XNAT contains thousands of large scans.

To check space:
df -h    

To check inodes:
df -i

Contact your IT to change inode limits.

failed to create table Error opening tab on Project Page

Check the Project ID - the project ID is intended to be short and is used by the Postgresql Database to generate tables. If the project ID is too long, it will create errors as there is a limit in the length of database table names. This is the source of this error. You will need to create a new project with a shorter Project ID.

Unable to delete subject

Make sure that the datatype of the experiment is installed. For example, if you have a dxSession imported, XNAT does not have this installed by default and will return an error if you attempt to delete this. To add the dataype, go to Administer/datatypes , click on 'Add Datatype' and select the session datatype from the dropdown menu, and click on submit on the windows that open.

Firewall/DQR

See the page on UFW, Ports and Firewall Configuration before continuing.

Steps to take if DQR not working:

Is AET/Port correct?

Are the ports in Docker open and correctly mapped?

[install dir]/docker-compose.yml

Under the 1st section(xnat-web), the ports section describes how the ports in the containers are mapped. PACS may send to port 104 to a reciver on port 8104 (this is common). Therefore instead of using the host firewall to redirect traffic to port 104 to port 8104, it can be configured in the docker-compose.yml file as follows:

- "104:8104"

All ports are blocked that are not listed. Once you make changes to the ports, you must restart XNAT:

cd [install dir]/Linux
sudo ./restart.sh

Is the server firewall correctly configured?

If using ufw:

sudo ufw status

This will return

sudo ufw rules

This will return the firewall rules. You may have to allow a port, for example:

sudo allow 104

Is the project ID SHORT and without spaces, underscores, dashes or any other special character? If not, delete the project and follow the rules for creating project IDs.

DQR Upgrade Bug

If the data is received, but not processed and returns an error in the preachive after upgrading the DQR plugin:

https://groups.google.com/g/xnat_discussion/c/HwER8wwYe8g

Tomcat Stops When Downloading Zipped Sessions...

People often download very large zip files from the web interface - often 10s of GBs in size. This causes Tomcat to stop due to memory issues. Tell the person trying to download giant zip files to stop and use the XNAT Desktop CLient (which uses REST to download individual files).

SQL tomcat log error:

Example in /path/to/xnat/tomcat_logs/sql.log:

An database or SQL error occurred trying to validate or create the XNAT item cache. org.postgresql.util.PSQLException: ERROR: could not create unique index "idx_xs_item_cache_lookup" Detail: Key (elementname, ids)=(xdat:user, XXX) is duplicated.

Usually caused by concurrency gone wrong. Just delete the table:

./docker-bash.sh pg

run this in psql:

DELETE FROM xs_item_cache

Clone this wiki locally