Internal Server Error while importing Bamboo export zip: java.lang.IllegalStateException: getAttribute: Session already invalidated
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
While importing a Bamboo export zip you get a HTTP 500 Internal Server error after a short time and the following exception is reported to the browser:
1
2
3
4
java.lang.IllegalStateException: getAttribute: Session already invalidated
at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1165)
at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:122)
at com.atlassian.plugin.servlet.PluginHttpSessionWrapper.getAttribute(PluginHttpSessionWrapper.java:39)
While not initially apparent from the error displayed to the browser, after reviewing the <bamboo-installation-directory>/logs/catalina.out
you might also see entries such as:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2016-07-13 11:29:00,250 ERROR [http-bio-8085-exec-6] [ExceptionMappingInterceptor] null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
.....
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.addEntry(HashMap.java:753)
at java.util.HashMap.put(HashMap.java:385)
at net.sf.hibernate.collection.Map.snapshot(Map.java:37)
at net.sf.hibernate.collection.PersistentCollection.getSnapshot(PersistentCollection.java:325)
at net.sf.hibernate.impl.SessionImpl$CollectionEntry.initSnapshot(SessionImpl.java:385)
at net.sf.hibernate.impl.SessionImpl$CollectionEntry.postFlush(SessionImpl.java:375)
at net.sf.hibernate.impl.SessionImpl.postFlush(SessionImpl.java:2863)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2264)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at com.atlassian.bamboo.migration.BambooStAXListImportStrategy$5.importListItems(BambooStAXListImportStrategy.java:185)
Cause
Bamboo has run out of heap memory space while importing your export.
Resolution
Shutdown Bamboo
Increase min and max heap allocation to the JVM on your Bamboo. It should be increased to 1024m at the least but you may need to go higher
See the following documentation on how to configure system properties of Bamboo on startup: Configuring bamboo on start-up
For example, add the following arguments to your JVM_SUPPORT_RECOMMENDED_ARGS:
-Xms1024m -Xmx1024m
(please customize to your requirements)
Start Bamboo
You should be able to verify that the memory limits were increased under Bamboo Administration >> Overview >> System Information.
Was this helpful?