Bamboo Installation - ctx.getSystemEncoding() Failed
Asked by Harry Cai:

Hello,

During the Bamboo installation, after the step of submitting the Bamboo database configuration, I met the error "Failed at: ${ctx.getSystemEncoding()} \[in template "fragments/decorator/decorators.ftl" in macro "displayHtmlHeader" at line 8, column 20\]".

The content of line 8 of "fragments/decorator/decorators.ftl" is: \<meta charset="${ctx.getSystemEncoding()}" /\>

Software version:

* operation system: Windows
* Bamboo Data Center: 8.1.2
* openjdk: 11
* mysql: 8.0.28

![image-20220401115935886.png](/t5/image/serverpage/image-id/191060iF97C72A41DBF76A7/image-size/large?v=v2&px=999 "image-20220401115935886.png")![image-20220401121001230.png](/t5/image/serverpage/image-id/191061i9FE9D9A778146C08/image-size/large?v=v2&px=999 "image-20220401121001230.png")

errors in "atlassian-bamboo.log"

2022-04-01 14:07:45,475 INFO \[performSetupDatabaseConnectionBackgroundThread\] \[SetupDatabaseConnectionAction\] Validating database configuration...  
2022-04-01 14:07:45,476 INFO \[performSetupDatabaseConnectionBackgroundThread\] \[SetupDatabaseConnectionAction\] Validating connection to url: \[jdbc:mysql://localhost/bamboo\]  
2022-04-01 14:07:45,618 INFO \[performSetupDatabaseConnectionBackgroundThread\] \[SetupDatabaseConnectionAction\] Database configuration is valid.  
2022-04-01 14:07:45,664 ERROR \[http-nio-8085-exec-16\] \[FiveOhOh\] 500 Exception was thrown.  
java.lang.IllegalStateException  
at com.google.common.base.Preconditions.checkState(Preconditions.java:486)  
at com.atlassian.bamboo.ww2.actions.setup.SetupUtilityBean.setupStandardDatabase(SetupUtilityBean.java:163)  
at com.atlassian.bamboo.ww2.actions.setup.SetupDatabaseConnectionAction.lambda$execute$0(SetupDatabaseConnectionAction.java:92)  
at com.atlassian.bamboo.setup.DefaultSetupPersister.executeSetupStep(DefaultSetupPersister.java:76)  
at com.atlassian.bamboo.ww2.actions.setup.SetupDatabaseConnectionAction.execute(SetupDatabaseConnectionAction.java:90)  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.base/java.lang.reflect.Method.invoke(Method.java:566)  
at ognl.OgnlRuntime.invokeMethodInsideSandbox(OgnlRuntime.java:1266)  
at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:1251)  
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1969)  
at ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68)  
at com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:98)  
at com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:90)  
at ognl.OgnlRuntime.callMethod(OgnlRuntime.java:2045)  
at ognl.ASTMethod.getValueBody(ASTMethod.java:97)  
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)  
at ognl.SimpleNode.getValue(SimpleNode.java:258)  
at ognl.Ognl.getValue(Ognl.java:537)  
at ognl.Ognl.getValue(Ognl.java:501)  
at com.opensymphony.xwork2.ognl.OgnlUtil$3.execute(OgnlUtil.java:492)  
at com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecuteMethod(OgnlUtil.java:544)  
at com.opensymphony.xwork2.ognl.OgnlUtil.callMethod(OgnlUtil.java:490)  
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:438)  
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:293)  
at org.apache.struts2.interceptor.BackgroundProcess$1.run(BackgroundProcess.java:55)  
at java.base/java.lang.Thread.run(Thread.java:834)  
2022-04-01 14:07:45,735 ERROR \[http-nio-8085-exec-16\] \[runtime\] Error executing FreeMarker template  
**FreeMarker template error:**   
**The following has evaluated to null or missing:**   
**==\> ctx.getSystemEncoding \[in template "fragments/decorator/decorators.ftl" at line 8, column 22\]**

----  
Tip: It's the step after the last dot that caused this error, not those before it.  
----  
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use \[#if myOptionalVar??\]when-present\[#else\]when-missing\[/#if\]. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??  
----

----  
FTL stack trace ("\~" means nesting-related):  
- **Failed at: ${ctx.getSystemEncoding()} \[in template "fragments/decorator/decorators.ftl" in macro "displayHtmlHeader" at line 8, column 20\]**   
- Reached through: @decorators.displayHtmlHeader require... \[in template "decorators/focusTask.ftl" at line 3, column 1\]  
----

Other failed information in "atlassian-bamboo.log"

-----------------------

Failed at: ${ctx.getSystemEncoding()} \[in template "fragments/decorator/decorators.ftl" in macro "displayHtmlHeader" at line 8, column 20\]  
Failed at: #if ctx?? \&\& ctx.getUser(request)?? \[in template "fragments/decorator/decorators.ftl" in macro "displayHtmlHeader" at line 15, column 5\]  
Failed at: ${webResourceManager.requireResources... \[in template "fragments/decorator/decorators.ftl" in macro "displayHtmlHeader" at line 33, column 5\]  
Failed at: ${webResourceManager.requireResources... \[in template "fragments/decorator/decorators.ftl" in macro "displayHtmlHeader" at line 36, column 9\]  
Failed at: ${webResourceManager.requireResources... \[in template "fragments/decorator/decorators.ftl" in macro "displayHtmlHeader" at line 36, column 9\]  
Failed at: ${webResourceManager.getRequiredResou... \[in template "fragments/decorator/decorators.ftl" in macro "displayHtmlHeader" at line 43, column 5\]  
Failed at: #list ctx.getWebPanels(location, para... \[in template "freemarker-lib/ui.ftl" in macro "renderWebPanels" at line 776, column 5\]  
Failed at: #assign serverStatusInfo = ctx.server... \[in template "fragments/decorator/systemstatebanner.ftl" at line 2, column 5\]  
Failed at: #assign serverPausedOrPausing = serve... \[in template "fragments/decorator/systemstatebanner.ftl" at line 3, column 5\]  
Failed at: #assign showSystemState = serverPause... \[in template "fragments/decorator/systemstatebanner.ftl" at line 4, column 5\]  
Failed at: #macro messageBox id="" type="info" t... \[in template "freemarker-lib/ui.ftl" in macro "messageBox" at line 670, column 1\]  
Failed at: #return ctx.hasGlobalPermission(permi... \[in template "freemarker-lib/functions.ftl" in function "hasGlobalPermission" at line 38, column 9\]  
Failed at: #if fn.hasGlobalPermission("READ") \[in template "fragments/decorator/systemstatebanner.ftl" at line 12, column 5\]  
Failed at: #assign adminErrors = adminErrorsBean... \[in template "fragments/showAdminErrors.ftl" at line 3, column 1\]  
Failed at: #if !adminErrors.empty \[in template "fragments/showAdminErrors.ftl" at line 5, column 1\]  
Failed at: #list ctx.getWebPanels(location, para... \[in template "freemarker-lib/ui.ftl" in macro "renderWebPanels" at line 776, column 5\]  
Failed at: #if ctx.featureManager.artifactStorag... \[in template "fragments/storage/storageCappingBanner.ftl" at line 2, column 1\]  
Failed at: #if ctx.featureManager.rotpEnabled \[in template "fragments/decorator/header.ftl" at line 8, column 1\]  
Failed at: #if ctx.featureManager.artifactStorag... \[in template "fragments/storage/storageCappingDialogs.ftl" at line 2, column 1\]  
Failed at: #if !ctx.functionalTest \[in template "fragments/decorator/header.ftl" in macro "defineConvertMutativeLinksFunction" at line 228, column 5\]  
Failed at: #assign adminErrors = adminErrorsBean... \[in template "fragments/showAdminErrors.ftl" at line 3, column 1\]  
Failed at: #if !adminErrors.empty \[in template "fragments/showAdminErrors.ftl" at line 5, column 1\]  
Failed at: #assign bambooLicenseManager = ctx.ba... \[in template "fragments/decorator/footer.ftl" at line 4, column 9\]  
Failed at: #if !ctx.functionalTest \[in template "fragments/decorator/footer.ftl" at line 5, column 9\]  
Failed at: #if ctx?? \&\& (ctx.getUser(req)?? \|\| c... \[in template "fragments/decorator/footer.ftl" at line 80, column 21\]

-----------------------


Answers:
author: Harry Cai
body: The issue has been resolved by the suggestion of Atlassian Support:

We usually see this error happens when there are permission issues. Please **remove** or **rename** \<Bamboo-home\>/ bamboo.cfg.xml and start the Bamboo and start configuring again.