Bamboo shows error: "Could not obtain issue details from JIRA" in builds
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
要約
Bamboo may display an error message: "Could not obtain issue details from JIRA". This could be caused by a broken application link from Bamboo to Jira, or invalid characters sent from Jira. This article provides insights on how to prevent this issue and offers solutions for handling such reasons.
Below is a screenshot of the sample issue:
環境
- Bamboo server version: 9.0.1
- JIRA version: 8.20.15
Note: While this issue has been observed specifically on these versions, it may also occur in other versions of Bamboo and JIRA.
診断
Broken application link symptoms:
Error logs from Bamboo:
2023-07-19 02:02:35,591 INFO [NavLink RestCapabilitiesClient:thread-1] [RestCapabilitiesClient] Failed to request capabilities from '<jira-instance>/rest/capabilities': status code: 503
2023-07-19 02:03:15,608 INFO [NavLink RestCapabilitiesClient:thread-1] [RestCapabilitiesClient] Failed to request capabilities from '<jira-instance>/rest/capabilities': status code: 503
2023-07-19 02:04:28,559 INFO [NavLink RestCapabilitiesClient:thread-1] [RestCapabilitiesClient] Failed to request capabilities from '<jira-instance>/rest/capabilities': Read timed out
Error logs from Jira:
2023-07-10 22:25:59,002 INFO [NavLink RestCapabilitiesClient:thread-1] [RestCapabilitiesClient] Failed to request capabilities from '<Bamboo-instance>/rest/capabilities': Connect to <Bamboo-instance> [/<Bamboo-instance>] failed: connect timed out
Invalid characters link symptoms:
- The Bamboo interface shows "Could not obtain issue details from JIRA" in Jira issues section of the Build summary.
Error found inside
<bamboo-install>/logs/catalina.out
:07-Jun-2023 15:46:20.172 WARNING [Catalina-utility-1] org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadCompleted Thread [http-nio-9085-exec-8] (id=[541]) was previously reported to be stuck but has completed. It was active for approximately [98,786] milliseconds. 07-Jun-2023 15:46:41.860 INFO [http-nio-8085-exec-50959] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character found in the request target [/rest/api/latest/result/DEVOPS-BATCHAPP0/12?expand=JiraIssues\ ]. The valid characters are defined in RFC 7230 and RFC 3986 at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:494) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:271) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)
Error found in
<bamboo-home>/logs/atlassian-bamboo.log
Caused by: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x8) was found in the value of attribute "name" and element is "entity". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ~[xercesImpl-2.12.2.jar:?] at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) ~[xercesImpl-2.12.2.jar:?] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[xercesImpl-2.12.2.jar:2.12.2] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[xercesImpl-2.12.2.jar:2.12.2] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[xercesImpl-2.12.2.jar:2.12.2] at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) ~[xercesImpl-2.12.2.jar:2.12.2] at org.apache.xerces.impl.XMLScanner.scanAttributeValue(Unknown Source) ~[xercesImpl-2.12.2.jar:2.12.2] at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown Source) ~[xercesImpl-2.12.2.jar:2.12.2] at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) ~[xercesImpl-2.12.2.jar:2.12.2] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) ~[xercesImpl-2.12.2.jar:2.12.2] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) ~[xercesImpl-2.12.2.jar:2.12.2] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl-2.12.2.jar:?] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl-2.12.2.jar:?] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) ~[xercesImpl-2.12.2.jar:?] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) ~[xercesImpl-2.12.2.jar:?] at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) ~[xercesImpl-2.12.2.jar:?] at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:258) ~[jaxb-runtime-2.3.1.jar:2.3.1] at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:229) ~[jaxb-runtime-2.3.1.jar:2.3.1] at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:140) ~[?:1.8.0_252] at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:123) ~[?:1.8.0_252] at com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider.readFrom(XMLRootElementProvider.java:115) ~[?:?] at com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider.readFrom(AbstractRootElementProvider.java:111) ~[?:?] ... 235 more
原因
Broken application link
The "Application Link" error could be caused when the application link between JIRA and Bamboo is broken or incorrectly configured. This could be due to changes in the configuration or incorrect login credentials. As a result, Bamboo cannot fetch data from JIRA or link to the appropriate issues.
Invalid character(s)
The error happens because of certain invalid characters in the Jira ticket name. When Bamboo retrieves and processes issue data from Jira through the Application Link, it fails if the data contains any invalid characters. The issue is not limited to the '\b' or '0x8' character; any character that is not a valid XML character can cause this error. Consequently, Bamboo cannot display the associated issue details. For instance, a Jira issue key or title such as "\bTEST-345" will trigger the problem as it includes a non-parseable backspace character ('\b'). Please refer to this link for more information on valid XML characters: https://en.wikipedia.org/wiki/Valid_characters_in_XML.
ソリューション
Broken application link solution:
If the cause is a broken link between Bamboo and Jira:
- Double-check and reconfigure the application links, you could refer to the documents below for information:
Invalid character solution:
If the cause is from the invalid XML character, follow these steps:
Check
<bamboo-home>/logs/atlassian-bamboo.log
file for errors like the below:Caused by: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x8) was found in the value of attribute "name" and element is "entity".
Query Jira's API endpoints that have the information found in the previous step. For example, in the previous message, we found that the invalid character was found in the value of attribute "name" and element is "entity". So we could use the command below:
curl -is --raw -k -vvv -H 'Accept: application/json' -u 'admin_user:admin_password' 'https://<your-jira-domain>/rest/applinks/1.0/entities?xoauth_requestor_id=admin_user'
This command returns a list of all application links that are currently set up in your Jira instance. Each application link represents a connection to another application. Look for a faulty name containing the character "\b":
{"entity":[{"key":"ABC","name":"\bXYZ","typeId":"jira.project"}]}
The invalid character might not be in the exact Plan that Bamboo shows as failed. You need to search through the whole output looking for the broken character.
Go to your Jira instance and locate the attributes with the invalid characters and replace them with valid ones.