Internal Server Error while importing Bamboo export zip: java.lang.IllegalStateException: getAttribute: Session already invalidated

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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:

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:

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

  1. Shutdown Bamboo
  2. 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
    1. See the following documentation on how to configure system properties of Bamboo on startup: Configuring bamboo on start-up
    2. For example, add the following arguments to your JVM_SUPPORT_RECOMMENDED_ARGS: -Xms1024m -Xmx1024m (please customize to your requirements)
  3. Start Bamboo
  4. You should be able to verify that the memory limits were increased under Bamboo Administration >> Overview >> System Information

Last modified on Nov 2, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.