java.lang.StackOverflowError

Atlassian JIRA | Brian Boyle [Atlassian] | 4 months ago
  1. 0

    We recently upgraded our Confluence Server to 5.10.2. Our JIRA install is still at 6.4.13 and we can't upgrade to 7.x due to plugin requirements. This forced us to change from TrustedApps to OAUTH authentication for app links. This seems to have broken some integrations between the two. REST calls seem to work both ways but XML RPC calls from JIRA to Confluence seem to be broken. I've tracked it down so far to a StackOverflowException on Confluence's side. I remember seeing something about Date parsing on the OAuth filter if that helps. Here's a sample call/response I've collected: {code} java POST /rpc/xmlrpc HTTP/1.1 Authorization: OAuth oauth_token="", oauth_consumer_key="", oauth_signature_method="RSA-SHA1", oauth_timestamp="", oauth_nonce="", oauth_version="1.0", oauth_signature="" Connection: close User-Agent: Host: Content-Length: 153 Content-Type: application/xml; charset=UTF-8 <?xml version="1.0"?><method><methodName>confluence2.getPage</methodName><params><param><value></value><value>19795241</value></param> </params></method > HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-ASEN: SEN Set-Cookie: JSESSIONID=; Path=/; HttpOnly X-AUSERNAME: admin Content-Type: text/xml Content-Length: 272 Date: Fri, 29 Jul 2016 22:37:59 GMT Connection: close <?xml version="1.0"?><methodResponse><fault><value><struct><member><name>faultString</name><value>java.lang.Exception: java.lang.StackOverflowError</value></member><member><name>faultCode</name><value><int>0</int></value></member></struct></value></fault></methodResponse>{code} Here's the stack traces of the exceptions I see in the logs: {code}Caused by: java.lang.StackOverflowError at java.lang.StringBuffer.append(StringBuffer.java:388) at org.apache.log4j.helpers.ISO8601DateFormat.format(ISO8601DateFormat.java:143) at java.text.DateFormat.format(DateFormat.java:345) at org.apache.log4j.helpers.PatternParser$DatePatternConverter.convert(PatternParser.java:443) at org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:65) at org.apache.log4j.PatternLayout.format(PatternLayout.java:506) at com.atlassian.confluence.util.PatternLayoutWithStackTrace.format(PatternLayoutWithStackTrace.java:26) at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:310) at org.apache.log4j.RollingFileAppender.subAppend(RollingFileAppender.java:276) at org.apache.log4j.WriterAppender.append(WriterAppender.java:162) Caused by: java.lang.StackOverflowError at java.lang.Exception.<init>(Exception.java:102) at java.lang.ReflectiveOperationException.<init>(ReflectiveOperationException.java:89) at java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:72) at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.log4j.spi.LocationInfo.<init>(LocationInfo.java:139) at org.apache.log4j.spi.LoggingEvent.getLocationInformation(LoggingEvent.java:253) at org.apache.log4j.helpers.PatternParser$LocationPatternConverter.convert(PatternParser.java:500) at org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:65) at org.apache.log4j.PatternLayout.format(PatternLayout.java:506) at com.atlassian.confluence.util.PatternLayoutWithStackTrace.format(PatternLayoutWithStackTrace.java:26){code} {code}2016-08-02 17:00:26,415 DEBUG [http-nio-8090-exec-9] [oauth.serviceprovider.internal.AuthenticatorImpl] printMessageToDebug Validating incoming OAuth request: url: http://rpc/xmlrpc method: POST oauth_token: oauth_consumer_key: oauth_signature_method: oauth_timestamp: oauth_nonce: oauth_version: 1.0 oauth_signature: {code} We can then see the session being invalidated: {code}2016-08-02 17:00:46,796 DEBUG [http-nio-8090-exec-10] [serviceprovider.internal.servlet.OAuthFilter] doFilter OAuth invalidated the session for an OAuth request [http://192./rpc/xmlrpc] 2016-08-02 17:00:46,796 DEBUG [analyticsEventProcessor:thread-1] [analytics.client.listener.ProductEventListener] run Sending event message logout took 402 ┬Ás 2016-08-02 17:00:46,796 INFO [http-nio-8090-exec-10] [util.zipkin.impl.ConfluenceSpanCollector] lambda$onCollect$1 Zipkin span 2016-08-02 17:00:46,796 DEBUG [http-nio-8090-exec-10] [confluence.web.filter.DebugFilter] doFilter REQUEST before ServletException javax.servlet.ServletException: Filter execution threw an exception{code} Yes we saw that deprecation notice: https://developer.atlassian.com/confdev/deprecated-apis/confluence-xml-rpc-and-soap-apis. Our previous version of confluence was 5.6 (with as supposed deprecated xmlrpc endpoint) and the IssueLinks was working with with that with the TrustedApps auth mode. Confluence Remote API plugin is still present and enabled and is still trying to respond (throwing that exception) instead throwing a 404 on that URI. That's why I assumed OAuth was the issue. Was this not the case? Some more follow up questions: * Am I understanding correctly that there's no way to set the current version we have of JIRA to use REST instead of XMLRPC for this functionality? * Does this mean that the change to REST calls from XMLRPC are already on the newer JIRA versions (7.x) or are you saying Issue Links itself is deprecated? h3. Update We got 5.9.12 running and OAuth seems to be working there with XML RPC with the same settings on the JIRA side. The settings on the confluence side have different options but I think it's comparable. The request/response tcpdump for reference: {code}6:25:44.850412 IP pm-internal.46789 > team-internal.8090: Flags [P.], seq 3879219930:3879220700, ack 2504221957, win 229, options [nop,nop,TS val 1205973718 ecr 1206062209], length 770 E..6..@.@."(.. ... ......82..Ce............ G...G...POST /rpc/xmlrpc HTTP/1.1 Authorization: OAuth oauth_token="", oauth_consumer_key="", oauth_signature_method="RSA-SHA1", oauth_timestamp="", oauth_nonce="", oauth_version="1.0", oauth_signature="Rpx47ZrmNZN40ax6LDadmCXAk8E4NxP648I7CV3VWp8wADQ3FNm008C70HQcRFFUoh3UBuwgagmRALadxnEhoGx9vmZ%2FIkbbw7%2F4jJ0rtJziH%2FdAAoylghe%2FlO4hGt1bfcv6nu%2FUq2ykWu4s1aPMi0K3UT1M49sUO%2FgFm5094%2BY%3D" Connection: close User-Agent: HttpClient/3.1 Host: Content-Length: Content-Type: application/xml; charset=UTF-8 <?xml version="1.0"?><method><methodName>confluence2.getPage</methodName><params><param><value></value><value>15044489</value></param></params></method > IP pm-internal.35725 > team-internal.8090: Flags [P.], seq 1479520726:1479521494, ack 4092687723, win 229, options [nop,nop,TS val 1205973719 ecr 1206062211], length 768 E..4..@.@..3.. ... .....X/....uk........... G...G...POST /rpc/xmlrpc HTTP/1.1 Authorization: OAuth oauth_token="", oauth_consumer_key="", oauth_signature_method="RSA-SHA1", oauth_timestamp="", oauth_nonce="", oauth_version="1.0", oauth_signature="" Connection: close User-Agent: Jakarta Commons-HttpClient/3.1 Host: Content-Length: 153 Content-Type: application/xml; charset=UTF-8 <?xml version="1.0"?><method><methodName>confluence2.getPage</methodName><params><param><value></value><value>16908430</value></param></params></method > 16:25:44.894748 IP team-internal.8090 > pm-internal.46789: Flags [P.], seq 1:265, ack 770, win 251, options [nop,nop,TS val 1206062255 ecr 1205973718], length 264 E..<i.@.@.:... ... ......Ce..85............ G...G...HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-ASEN: SEN Set-Cookie: ; Path=/; HttpOnly X-AUSERNAME: admin Content-Type: text/xml Content-Length: 5255 Date: Fri, 12 Aug 2016 16:25:44 GMT Connection: close IP team-internal.8090 > pm-internal.46789: Flags [.], seq 265:3161, ack 770, win 251, options [nop,nop,TS val 1206062255 ecr 1205973718], length 2896 E...i.@.@.0b.. ... .85............ G...G...<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>id</name><value>15044489</value></member><member><name>current</name><value>true</value></member><member><name>content</name><value><h3>Dec 10</h3><ul style="list-style-type: square;"><li><ac:link><ri:user ri:userkey="" /></ac:link> <ac:structured-macro ac:name="jira"><ac:parameter ac:name="server">JIRA</ac:parameter><ac:parameter ac:name="serverId"></ac:parameter><ac:parameter ac:name="key"></ac:parameter></ac:structured-macro> TODO</li></ul><h3>Oct 1</h3><ul style="list-style-type: square;"><li><p><ac:link><ri:user ri:userkey="" /></ac:link> <ac:structured-macro ac:name="jira"><ac:parameter ac:name="server"> JIRA</ac:parameter><ac:parameter ac:name="serverId">4f722742-c02c-3879-a5eb-7ccde8f4e21e</ac:parameter><ac:parameter ac:name="key">OPS-2476</ac:parameter></ac:structured-macro> TODO</p></li></ul><p>&nbsp;</p><h3>Sept 20</h3><ul style="list-style-type: square;"><li><span>&nbsp;</span><ac:link><ri:user ri:userkey="" /></ac:link><span> yum updated to RHEL 6.7 per JJ release /&nbsp;</span><ac:structured-macro ac:name="jira"><ac:parameter ac:name="columns">key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution</ac:parameter><ac:parameter ac:name="server"> JIRA</ac:parameter><ac:parameter ac:name="serverId"></ac:parameter><ac:parameter ac:name="key">OPS-2346</ac:parameter></ac:structured-macro></li></ul><h3>July 23</h3><ul style="list-style-type: square;"><li><ac:link><ri:user ri:userkey="" /></ac:link> CAB <ac:structured-macro ac:name="jira"><ac:parameter ac:name="server"></ac:parameter><ac:parameter ac:name="serverId"></ac:parameter><ac:parameter ac:name="key">OPS-2076</ac:parameter></ac:structured-macro> done</li></ul><h3>July 9</h3><ul style="list-style-type: square;"><li><ac:link><ri:user ri:userkey="" /></ac:link> CAB <ac:structured-macro ac:name="jira"><ac:parameter ac:name="server"></ac:parameter><ac:parameter ac:name="serverId"></ac:pa IP team-internal.8090 > pm-internal.46789: Flags [.], seq 3161:4609, ack 770, win 251, options [nop,nop,TS val 1206062255 ecr 1205973718], length 1448 E...i.@.@.6... ... ......Cq].85......Z..... G...G...rameter><ac:parameter ac:name="key"></ac:parameter></ac:structured-macro> done</li></ul><h3>June 14</h3><ul><li><ac:link><ri:user ri:userkey="" /></ac:link>&nbsp;yum updated server&nbsp;per&nbsp;<ac:structured-macro ac:name="jira"><ac:parameter ac:name="columns">key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution</ac:parameter><ac:parameter ac:name="server"> JIRA</ac:parameter><ac:parameter ac:name="serverId"></ac:parameter><ac:parameter ac:name="key"></ac:parameter></ac:structured-macro></li></ul><h3><strong><br /></strong></h3><h3><strong>February 12</strong></h3><ul style="list-style-type: square;"><li><ac:link><ri:user ri:userkey="" /></ac:link>&nbsp;<ac:structured-macro ac:name="jira"><ac:parameter ac:name="server"> JIRA</ac:parameter><ac:parameter ac:name="serverId"></ac:parameter><ac:parameter ac:name="key"></ac:parameter></ac:structured-macro>&nbsp;done</li></ul><p>&nbsp;</p></value></member><m IP team-internal.8090 > pm-internal.46789: Flags [P.], seq 4609:5520, ack 770, win 251, options [nop,nop,TS val 1206062255 ecr 1205973718], length 911 E...i.@.@.8 .. ... ......Cw..85......A..... G...G...ember><name>version</name><value>10</value></member><member><name>title</name><value>bl-gw1 Changelog 2015</value></member><member><name>modifier</name><value>dechevarria</value></member><member><name>url</name><value></value></member><member><name>homePage</name><value>false</value></member><member><name>creator</name><value></value></member><member><name>contentStatus</name><value>current</value></member><member><name>modified</name><value><dateTime.iso8601>20151210T15:57:38</dateTime.iso8601></value></member><member><name>created</name><value><dateTime.iso8601>20141230T12:53:14</dateTime.iso8601></value></member><member><name>space</name><value>OPS</value></member><member><name>parentId</name><value>15044473</value></member><member><name>permissions</name><value>0</value></member></struct></value></param></params></methodResponse>{code} This is a new issue with Confluence 5.10, as the process works with Confluence 5.9.x. Please check to see what may have changed why as we use this fucntionality.

    Atlassian JIRA | 4 months ago | Brian Boyle [Atlassian]
    java.lang.StackOverflowError
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  1. kid 2 times, last 3 months ago
1 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.StackOverflowError

    No message provided

    at java.lang.Exception.<init>()
  2. Java RT
    Method.invoke
    1. java.lang.Exception.<init>(Exception.java:102)
    2. java.lang.ReflectiveOperationException.<init>(ReflectiveOperationException.java:89)
    3. java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:72)
    4. sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
    5. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    6. java.lang.reflect.Method.invoke(Method.java:498)
    6 frames
  3. Apache Log4j
    PatternLayout.format
    1. org.apache.log4j.spi.LocationInfo.<init>(LocationInfo.java:139)
    2. org.apache.log4j.spi.LoggingEvent.getLocationInformation(LoggingEvent.java:253)
    3. org.apache.log4j.helpers.PatternParser$LocationPatternConverter.convert(PatternParser.java:500)
    4. org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:65)
    5. org.apache.log4j.PatternLayout.format(PatternLayout.java:506)
    5 frames