NullPointerException on calculateLastModifiedDate Due to Null Value in Attachments Table

Platform Notice: Data Center Only - This article only applies to Atlassian apps on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

This only applies to versions of Confluence 5.5 and below unless the attachments were never migrated to disk which is now default and automatically migrated in any subsequent upgrade with a specific task.

Symptoms

The following appears in the atlassian-confluence.log:

2008-11-03 12:41:27,120 ERROR [http-9080-Processor2] [[Standalone].\[localhost].[].[file-server]] invoke Servlet.service() for servlet file-server threw exception java.lang.NullPointerException at com.atlassian.plugin.servlet.util.LastModifiedHandler.calculateLastModifiedDate(LastModifiedHandler.java:54) at com.atlassian.plugin.servlet.util.LastModifiedHandler.checkRequest(LastModifiedHandler.java:71) at com.atlassian.confluence.servlet.download.AttachmentDownload.getStreamForDownload(AttachmentDownload.java:89) at com.atlassian.confluence.servlet.download.ServeAfterTransactionDownload$StreamResultCallback.doInTransaction(ServeAfterTransactionDownload.java:129) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127) at com.atlassian.confluence.servlet.download.ServeAfterTransactionDownload.getStreamInTransaction(ServeAfterTransactionDownload.java:41) at com.atlassian.confluence.servlet.download.ServeAfterTransactionDownload.serveFile(ServeAfterTransactionDownload.java:47) at com.atlassian.plugin.servlet.BaseFileServerServlet.doGet(BaseFileServerServlet.java:77) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

Cause

This error can occur if your attachments.lastmoddate database table row contains invalid or null records.

Resolution

Warning: Backup your database before proceeding.

Before running any SQL in this article, create a full backup of your Jira database. This is a database-level operation with no undo other than restoring from backup. Only proceed if you're comfortable running SQL directly against the Jira database, and test on a staging or cloned environment first, wherever possible.

Populating the rows in attachments.lastmoddate with some valid dates.

Updated on September 25, 2025

Still need help?

The Atlassian Community is here for you.