"An unexpected error has occurred" pop-up while accessing certain Bamboo pages
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
Summary
"An unexpected error has occurred" pop-up message appears on different Bamboo pages, such as the User Groups page and the Deployments tab.
Other symptoms:
- Unable to generate a Support Zip
- A "Background page refresh cannot contact server. Please ensure Bamboo server is available." error message pops-up
- Unable to dedicate agents with no error message in the User Interface.
- The Instance health page is blank.
Environment
All supported versions of Bamboo with HTTPS configured in Tomcat.
Diagnosis
The following message pops up in Bamboo:
When checking the <bamboo-home>/logs/atlassian-bamboo.log, there are occurrences of the following XSRF check failure:
2021-06-03 10:54:56,075 WARN [http-nio-8085-exec-21] [XsrfResourceFilter] Additional XSRF checks failed for request: http://BAMBOO_URL/rest/troubleshooting/1.0/check/process/ , origin: https://BAMBOO_URL , referrer: https://BAMBOO_URL/plugins/servlet/troubleshooting/view/ , credentials in request: true , allowed via CORS: false
Cause
The most common cause for this is a misconfigured server.xml file inside the Bamboo installation folder, with missing proxy properties. You can find more information about the XSRF checks in the following documentation:
Solution
Check the <bamboo-installation>/conf/server.xml and verify if the connector is properly configured, like in the example below. Usually, one of (or all) the following properties are missing: secure, scheme, proxyName, and proxyPort.
<Connector
port="8085"
protocol="HTTP/1.1"
maxThreads="150" minSpareThreads="25"
connectionTimeout="20000"
disableUploadTimeout="true"
acceptCount="100"
enableLookups="false"
maxHttpHeaderSize="8192"
useBodyEncodingForURI="true"
URIEncoding="UTF-8"
redirectPort="443"
compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript"
secure="true"
scheme="https"
proxyName="proxy-bamboo.com"
proxyPort="443">
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
</Connector>