Bamboo scheduled backup fails - Null value was assigned to a property of primitive type
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
Bamboo scheduled backup fails with the following error in the logs:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
...
2015-11-29 21:09:04,249 INFO [scheduler_Worker-4] [XmlMigrator] Writing xml to file: /backup/bamboo/backups/bamboo_backup_2015_11_29.zip/db-export/comments.xml
2015-11-29 21:09:04,249 INFO [scheduler_Worker-4] [XmlMigrator] Exporting with: com.atlassian.bamboo.migration.stream.CommentRootMapper
2015-11-29 21:09:05,692 INFO [scheduler_Worker-4] [XmlMigrator] Ensuring the the file has been unmounted
2015-11-29 21:09:05,693 INFO [scheduler_Worker-4] [XmlMigrator] Unmounted /backup/bamboo/backups/bamboo_backup_2015_11_29.zip
2015-11-29 21:09:05,699 INFO [scheduler_Worker-4] [ServerLifecycleManagerImpl] Server state changed to 'RUNNING' from 'PAUSED'
2015-11-29 21:09:05,699 ERROR [scheduler_Worker-4] [ScheduledBackupJob] org.springframework.orm.hibernate3.HibernateSystemException: Null value was assigned to a property of primitive type setter of com.atlassian.bamboo.comment.CommentImpl.entityId; nested exception is org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.atlassian.bamboo.comment.CommentImpl.entityId
org.springframework.orm.hibernate3.HibernateSystemException: Null value was assigned to a property of primitive type setter of com.atlassian.bamboo.comment.CommentImpl.entityId; nested exception is org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.atlassian.bamboo.comment.CommentImpl.entityId
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:708)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:414)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:416)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:341)
at com.atlassian.bamboo.persistence3.BambooHibernateObjectDao.executeReturnLong(BambooHibernateObjectDao.java:139)
at com.atlassian.bamboo.comment.CommentHibernateDao.scrollCommentsForExport(CommentHibernateDao.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy28.scrollCommentsForExport(Unknown Source)
at com.atlassian.bamboo.migration.stream.CommentRootMapper.exportData(CommentRootMapper.java:50)
at com.atlassian.bamboo.migration.XmlMigrator.exportToStream(XmlMigrator.java:571)
at com.atlassian.bamboo.migration.XmlMigrator.exportXml(XmlMigrator.java:501)
at com.atlassian.bamboo.migration.XmlMigrator$$FastClassBySpringCGLIB$$b6578fc7.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644)
at com.atlassian.bamboo.migration.XmlMigrator$$EnhancerBySpringCGLIB$$97ef45cd.exportXml(<generated>)
at com.atlassian.bamboo.migration.ImportExportManagerImpl.bambooExport(ImportExportManagerImpl.java:94)
at com.atlassian.bamboo.configuration.ScheduledBackupJob.execute(ScheduledBackupJob.java:75)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.atlassian.bamboo.comment.CommentImpl.entityId
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:109)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:583)
at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:229)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3848)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:152)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:982)
at org.hibernate.loader.Loader.loadSingleRow(Loader.java:331)
at org.hibernate.impl.ScrollableResultsImpl.prepareCurrentRow(ScrollableResultsImpl.java:254)
at org.hibernate.impl.ScrollableResultsImpl.next(ScrollableResultsImpl.java:123)
at org.springframework.orm.hibernate.ScrollHibernateCallback.doInHibernate(ScrollHibernateCallback.java:54)
at org.springframework.orm.hibernate.ScrollHibernateCallback.doInHibernate(ScrollHibernateCallback.java:14)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
... 37 more
Caused by: java.lang.IllegalArgumentException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:66)
... 48 more
Cause
The problem is that we have null values inside the ENTITY_ID column under the USER_COMMENT table, and this column only accepts integer values. It is possible to verify this by running the following SQL query in Bamboo's database:
1
select * from USER_COMMENT where ENTITY_ID is null;
If this query returns any values, then this is probably the issue.
Workaround
Delete the entries returned by the query above.
Stop Bamboo.
Run the following SQL query:
(!) Always backup your database before applying any changes.
1
delete from USER_COMMENT where ENTITY_ID is null;
Start Bamboo.
Was this helpful?