Bamboo fails to start with an error 'Content is not allowed in prolog'
Summary
The core configurations for the Bamboo server application and Bamboo Agent are loaded from the files bamboo.cfg.xml and bamboo-agent.cfg.xml, respectively.
Diagnosis
The below error is thrown when Bamboo server starts and it fails to start:
2012-11-30 18:24:51,447 FATAL [main] [BootstrapLoaderListener] An error was encountered while bootstrapping Bamboo (see below):
Unable to bootstrap Bamboo: Failed to parse config file: Error on line 1of document : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
java.lang.IllegalStateException: Unable to bootstrap Bamboo: Failed to parse config file: Error on line 1 of document : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
at com.atlassian.bamboo.setup.BootstrapLoaderListener.contextInitialized(BootstrapLoaderListener.java:63)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:733)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:233)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1222)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:676)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:455)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90)
at org.eclipse.jetty.server.Server.doStart(Server.java:261)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at com.atlassian.bamboo.server.Server.main(Server.java:75)
2012-11-30 18:24:51,453 INFO [main] [UpgradeLauncher] UpgradeLauncher not performed since the application has not been setup yet.
2012-11-30 18:24:51,537 INFO [main] [DefaultConfiguration] Loading global messages from com.atlassian.bamboo.ww2.BambooActionSupport
2012-11-30 18:24:51,537 INFO [main] [DefaultConfiguration] Loading global messages from help-paths
Bamboo Agent startup fails with an error below;
INFO | jvm 20 | 2023/08/01 13:10:40 | [Fatal Error] bamboo-agent.cfg.xml:1:1: Content is not allowed in prolog.
Cause
Some random char codes are saved in one of the config files or a corrupted configuration file can cause this error.
Solution
Bamboo server
Check <BAMBOO-HOME>/bamboo.cfg.xml
config file and remove all random char codes that appear there. If not sure what should be in that file, install a fresh empty Bamboo instance and compare the config files.
Bamboo Remote agent
Rename or move the existing <BAMBOO-AGENT-HOME>/
bamboo-agent.cfg.xml
and then start the remote agent.
If you require assistance or facing further issues please contact our friendly support.