Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-17787

NullPointerException in Artifatcs when running Export

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Low
    • None
    • 5.10.3
    • Import / Export

    Description

      Summary

      Bamboo throws the following error while attempting to export data out of Bamboo:

      2016-07-21 14:11:52,858 INFO [http-apr-8085-exec-5] [XmlMigrator] Writing xml to file: C:\bamboo-home\exports\export_bamboo_51020_20160721.zip\db-export\artifacts.xml
      2016-07-21 14:11:52,858 INFO [http-apr-8085-exec-5] [XmlMigrator] Exporting with: com.atlassian.bamboo.artifact.ArtifactMapper
      2016-07-21 14:11:52,954 INFO [http-apr-8085-exec-5] [XmlMigrator] Ensuring the the file has been unmounted
      2016-07-21 14:11:52,955 INFO [http-apr-8085-exec-5] [XmlMigrator] Unmounted C:\bamboo-home\exports\export_bamboo_51020_20160721.zip
      2016-07-21 14:11:52,963 INFO [http-apr-8085-exec-5] [ServerLifecycleManagerImpl] Server state changed to 'RUNNING' from 'PAUSED' by 'bamboouser'
      2016-07-21 14:11:52,964 ERROR [http-apr-8085-exec-5] [Export] java.lang.NullPointerException
      java.lang.NullPointerException
      	at com.atlassian.bamboo.artifact.ArtifactMapper.exportProperties(ArtifactMapper.java:102)
      	at com.atlassian.bamboo.artifact.ArtifactMapper.exportProperties(ArtifactMapper.java:21)
      
      

      Steps to Reproduce

      1. Go to Bamboo administration >> Overview >> System >> Export.
      2. Click on the Export button.
      3. Wait for the export process to finish.

        Expected Results

      The export process writes to the artifacts.xml file successfully:

      2016-07-28 17:29:42,625 INFO [http-nio-8085-exec-9] [XmlMigrator] Writing xml to file: /Users/brosa/Documents/Atlassian/restore/sqlserver/bamboo-5.10.3/home/exports/export_restore5103_51020_20160728.zip/db-export/artifacts.xml
      2016-07-28 17:29:42,625 INFO [http-nio-8085-exec-9] [XmlMigrator] Exporting with: com.atlassian.bamboo.artifact.ArtifactMapper
      2016-07-28 17:29:42,716 INFO [http-nio-8085-exec-9] [XmlMigrator] Finished writing to file: /Users/brosa/Documents/Atlassian/restore/sqlserver/bamboo-5.10.3/home/exports/export_restore5103_51020_20160728.zip/db-export/artifacts.xml
      ...
      
      

      And reports:

      ...
      2016-07-28 17:30:10,983 INFO [http-nio-8085-exec-9] [XmlMigrator] Finished updating zip
      2016-07-28 17:30:10,983 INFO [http-nio-8085-exec-9] [XmlMigrator] Ensuring the the file has been unmounted
      2016-07-28 17:30:10,984 INFO [http-nio-8085-exec-9] [XmlMigrator] Unmounted /Users/brosa/Documents/Atlassian/restore/sqlserver/bamboo-5.10.3/home/exports/export_restore5103_51020_20160728.zip
      2016-07-28 17:30:10,984 INFO [http-nio-8085-exec-9] [XmlMigrator] Export completed. 00:02:55.010
      
      

      No error messages in the logs.

      Actual Results

      The export process fails while trying to export and write the artifacts.xml file with:

      2016-07-21 14:11:52,858 INFO [http-apr-8085-exec-5] [XmlMigrator] Writing xml to file: C:\bamboo-home\exports\export_bamboo_51020_20160721.zip\db-export\artifacts.xml
      2016-07-21 14:11:52,858 INFO [http-apr-8085-exec-5] [XmlMigrator] Exporting with: com.atlassian.bamboo.artifact.ArtifactMapper
      2016-07-21 14:11:52,954 INFO [http-apr-8085-exec-5] [XmlMigrator] Ensuring the the file has been unmounted
      2016-07-21 14:11:52,955 INFO [http-apr-8085-exec-5] [XmlMigrator] Unmounted C:\bamboo-home\exports\export_bamboo_51020_20160721.zip
      2016-07-21 14:11:52,963 INFO [http-apr-8085-exec-5] [ServerLifecycleManagerImpl] Server state changed to 'RUNNING' from 'PAUSED' by 'bamboouser'
      2016-07-21 14:11:52,964 ERROR [http-apr-8085-exec-5] [Export] java.lang.NullPointerException
      java.lang.NullPointerException
      	at com.atlassian.bamboo.artifact.ArtifactMapper.exportProperties(ArtifactMapper.java:102)
      	at com.atlassian.bamboo.artifact.ArtifactMapper.exportProperties(ArtifactMapper.java:21)
      
      

      Workaround

      The problem is caused by the null value assigned to the ARCHIVER_TYPE column inside the ARTIFACT table. This column does not accept null values.

      It is possible to identify the problem with the following SELECT statement:

      Checking if you are affected by this bug
      select *
        from ARTIFACT
       where ARCHIVER_TYPE is null;
      
      

      If the above search return null values, you can change them to 0 using the following steps:

      1. Stop Bamboo.
      2. Take a backup of the Bamboo database before moving forward.
      3. Run the following SQL query:
        Updating null values to 0
        update ARTIFACT
           set ARCHIVER_TYPE = 0
         where ARCHIVER_TYPE is null;
        
        
      4. Start Bamboo.

      Attachments

        Activity

          People

            Unassigned Unassigned
            brosa Bruno Rosa
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: