Null date value in the commits table causes incomplete export

Platform Notice: Data Center Only - This article only applies to Atlassian products 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

Problem

Taking backup of your instance fails or ends prematurely, and the resulting backup has a poorly formed commits.xml file. The following NPE error message appears in the atlassian-bamboo.log file:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 2013-04-05 11:23:12,135 ERROR [ajp-8009-8] [XmlMigrator] Problems occurred while exporting com.atlassian.bamboo.migration.stream.MapperExportException: java.lang.NullPointerException at com.atlassian.bamboo.migration.stream.CommitRootMapper$1.apply(CommitRootMapper.java:104) at com.atlassian.bamboo.migration.stream.CommitRootMapper$1.apply(CommitRootMapper.java:84) at com.atlassian.bamboo.commit.CommitHibernateDao$1.nextScrollableResult(CommitHibernateDao.java:45) at org.springframework.orm.hibernate.ScrollHibernateCallback.doInHibernate(ScrollHibernateCallback.java:54) at org.springframework.orm.hibernate.ScrollHibernateCallback.doInHibernate(ScrollHibernateCallback.java:13) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337) at com.atlassian.bamboo.persistence.BambooHibernateObjectDao.executeReturnLong(BambooHibernateObjectDao.java:36) at com.atlassian.bamboo.commit.CommitHibernateDao.scrollCommitsForExport(CommitHibernateDao.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Cause

This is caused by the fact that some commit messages have null values for the commit dates. You can view them by running this command:

1  SELECT * FROM user_commit where COMMIT_DATE is null;

Resolution

  1. Stop Bamboo server

  2. Run the SQL query below against your Bamboo database to give arbitrary commit dates to the affected rows (discovered above):

    1 2  UPDATE user_commit set COMMIT_DATE='2013-04-08 17:16:41' where COMMIT_ID IN (SELECT COMMIT_ID FROM (select COMMIT_ID from user_commit where COMMIT_DATE is null) as temp);
  3. Restart Bamboo

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.