org.hibernate.LazyInitializationException error after update Bamboo
Hello
After updating Bamboo (from version 6.3.2 to 6.8.1) and installing the latest version of the plugin (3.6.141).
We have a problem attempting to save a job with "Template Tasks Definition".
Еrror message in catalina.out:
2019-04-23 14:53:52,809 INFO [http-nio-127.0.0.1-8085-exec-40] [ImmutablePlanCacheServiceImpl] Invalidating SOA-TESC
2019-04-23 14:53:52,809 INFO [http-nio-127.0.0.1-8085-exec-40] [BuildConfigurationSupport] Build configuration for 'SOA-TESC-JOB1' saved.
2019-04-23 14:53:52,809 WARN [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-1] [LoggingServlet] BuildConfigurationUpdatedEvent com.atlassian.bamboo.event.BuildConfigurationUpdatedEvent[source=com.atlassian.bamboo.ww2.actions.build.admin.config.ConfigureBuildMiscellaneousOptions@3e9aaa6c] job=SOA-TESC-JOB1
2019-04-23 14:53:52,809 INFO [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-5] [PlanCacheListener] repopulateCache cache
2019-04-23 14:53:52,809 WARN [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-5] [LoggingServlet] repopulateCache
2019-04-23 14:53:52,815 ERROR [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-1] [AsynchronousAbleEventDispatcher] There was an exception thrown trying to dispatch event [com.atlassian.bamboo.event.BuildConfigurationUpdatedEvent[source=com.atlassian.bamboo.ww2.actions.build.admin.config.ConfigureBuildMiscellaneousOptions@3e9aaa6c] job=SOA-TESC-JOB1] from the invoker [SingleParameterMethodListenerInvoker{method=public void org.valens.bamboo.listeners.BuildConfigurationListener.handleEvent(com.atlassian.bamboo.event.BuildConfigurationUpdatedEvent), listener=org.valens.bamboo.listeners.BuildConfigurationListener@2b15e7b7}]
java.lang.RuntimeException: could not initialize proxy [com.atlassian.bamboo.plan.AbstractChain#154894741] - no Session
at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54)
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)
at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.hibernate.LazyInitializationException: could not initialize proxy [com.atlassian.bamboo.plan.AbstractChain#154894741] - no Session
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:169)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:309)
at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor.intercept(ByteBuddyInterceptor.java:45)
at org.hibernate.proxy.ProxyConfiguration$InterceptorDispatcher.intercept(ProxyConfiguration.java:95)
at com.atlassian.bamboo.plan.AbstractChain$HibernateProxy$v2chRtej.getBuildDefinition(Unknown Source)
at com.atlassian.bamboo.plan.PlanHelper.getConfigObject(PlanHelper.java:215)
at com.atlassian.bamboo.plugins.maven.dependencies.AutomaticDependencyManagementPlugin.getConfig(AutomaticDependencyManagementPlugin.java:107)
at com.atlassian.bamboo.plugins.maven.dependencies.AutomaticDependencyManagementPlugin.populateBuildDefinition(AutomaticDependencyManagementPlugin.java:92)
at com.atlassian.bamboo.build.DefaultBuildDefinitionManagerTx.fillBuildDefinition(DefaultBuildDefinitionManagerTx.java:87)
at com.atlassian.bamboo.build.DefaultBuildDefinitionManagerTx.getBuildDefinition(DefaultBuildDefinitionManagerTx.java:69)
at sun.reflect.GeneratedMethodAccessor415.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy262.getBuildDefinition(Unknown Source)
at com.atlassian.bamboo.build.DefaultBuildDefinitionManager.getBuildDefinition(DefaultBuildDefinitionManager.java:48)
at com.atlassian.bamboo.plan.AbstractPlan.getBuildDefinition(AbstractPlan.java:257)
at org.valens.bamboo.listeners.BuildConfigurationListener.handleEvent(BuildConfigurationListener.java:790)
at sun.reflect.GeneratedMethodAccessor4692.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36)
... 8 more
Could you please take a look at this? Thanks
Comments (6)
-
repo owner -
reporter Hi Julius, thank you for your fast reply!
Hmm, I have a perfectly easy to reproduce issue.
I tried fresh 6.8.1 install in isolated environment, fresh 6.3.2 to 6.8.1 update, with internal DB and external PostgreSQL.
I get this error every time than create Plan or save Job with template definition. My environment is CentOS 7, JRE 1.8.0-121.
Currently as workaround I downgrade version of the plugin to previously version (3.6.138) and it works! The problem appears only on 3.6.141.
So please let me know if I can get more info to debug.
-
repo owner Added a small fix, trying to force a hibernate transaction in the code. Can you check if this solves your issue.
Julius
-
repo owner - changed status to resolved
-
reporter Hi,
thank you for fixing it!
When I was verifying the new version I found one more issue.
At the previous version (<= 3.6.138), "Replicate Builds" started automatically after saving templated plan. Actions to reproduce:
- open plan (which "Is Template" == true)
- change something in Tasks
-
Miscellaneous → Save
replication starts
Now it is not. We have to use "Replicate Builds" button in admin panel. It's not a significant problem but maybe it will be interesting.
Thanks again!
-
repo owner Please try the same save on a template build not the template. I will look also on the template save.
- Log in to comment
Hi Yakov,
I just did a full install of 6.8.1 and checked the plugin, no issues in my testing/prod system. Can you tell me what are the specs of your server and memory usage, this is a common error in cases machine is overloaded, try also to restart the server and see if on a clean state everything works.
Julius