Unable to edit Build Plan or View Mail Server due to Corrupt Bamboo Mail Configuration

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

Symptoms

When editing a build plan or viewing a configured mail server, Bamboo loads an empty page and the following error(s) are logged:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2010-06-10 11:02:15,836 ERROR [660420915@qtp-124427164-3] [runtime] Expression mailServerConfigured is undefined on line 295, column 44 in lib/build.ftl. Expression mailServerConfigured is undefined on line 295, column 44 in lib/build.ftl. The problematic instruction: ---------- ==> ${mailServerConfigured?string} [on line 295, column 42 in lib/build.ftl] in user-directive bd.notificationWarnings [on line 18, column 5 in build/edit/editBuildNotification.ftl] in user-directive ww.form [on line 4, column 1 in build/edit/editBuildNotification.ftl] ---------- Java backtrace for programmers: ---------- freemarker.core.InvalidReferenceException: Expression mailServerConfigured is undefined on line 295, column 44 in lib/build.ftl. at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124) at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134) at freemarker.core.BuiltIn$stringBI._getAsTemplateModel(BuiltIn.java:362) at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at freemarker.core.Expression.getStringValue(Expression.java:93)

And:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2010-06-10 11:02:15,899 ERROR [660420915@qtp-124427164-3] [CompoundRootAccessor] Caught an Ognl exception while getting property mailServerConfigured ognl.OgnlException: mailServerConfigured [java.lang.RuntimeException: Error in mail config: Error in mail config: Premature end of file.] at ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:1299) at ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor.java:60) ..... ..... Caused by: org.xml.sax.SAXParseException: Premature end of file. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1765) at com.atlassian.mail.server.managers.XMLMailServerManager.configure(XMLMailServerManager.java:65) ... 276 more /-- Encapsulated exception ------------\ java.lang.RuntimeException: Error in mail config: Error in mail config: Premature end of file. at com.atlassian.mail.config.ConfigLoader.<init>(ConfigLoader.java:61)

Cause

Bamboo persists mail server configuration in bamboo-mail.cfg.xml file, located in <BAMBOO_HOME> directory.

The file has become corrupt, and the error happens when you attempt to add/edit a plans build notifications or view the mail server configuration.

Resolution

Reconfiguring your Bamboo mail server will fix the problem. To do this:

  1. Shutdown Bamboo;

  2. Delete the <BAMBOO_HOME>/bamboo-mail.cfg.xml file;

  3. Restart Bamboo and reconfigure your mail server.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.