JIRA Trusted Application Links throwing an IPAddressFormatException as the IP does not represent a valid IP address
Symptoms
Attempting to access Application Links or System Info displays an Error 330 (net::ERR_CONTENT_DECODING_FAILED)
in the browser.
The following appears in the atlassian-jira.log
:
2013-03-20 08:38:18,936 http-bio-8080-exec-10 ERROR [500ErrorPage.jsp] Exception caught in 500 page java.lang.IllegalStateException: com.atlassian.security.auth.trustedapps.IPAddressFormatException: "127.0.*.1" does not represent a valid IP address.
com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.IllegalStateException: com.atlassian.security.auth.trustedapps.IPAddressFormatException: "127.0.*.1" does not represent a valid IP address.
at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:152)
at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:115)
at com.atlassian.util.concurrent.ResettableLazyReference.get(ResettableLazyReference.java:89)
at com.atlassian.jira.security.auth.trustedapps.CachingTrustedApplicationManager.getAll(CachingTrustedApplicationManager.java:51)
at com.atlassian.jira.security.auth.trustedapps.DefaultTrustedApplicationService.getAll(DefaultTrustedApplicationService.java:60)
at com.atlassian.jira.util.system.ExtendedSystemInfoUtilsImpl.getTrustedApplications(ExtendedSystemInfoUtilsImpl.java:659)
at org.apache.jsp.secure.admin.jira.views.systeminfo_jsp._jspService(systeminfo_jsp.java:870)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.atlassian.jira.web.filters.XContentTypeOptionsNoSniffFilter.doFilter(XContentTypeOptionsNoSniffFilter.java:22)
at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:32)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)
Cause
JIRA has an invalid IP range in the IP Match on either outgoing or incoming Application Links. The browser is displaying an error 330 instead of the 500 Error Page.
Resolution
As this cannot be updated through the GUI (this error is displayed instead), the database will need changing to correct the IP Match.
- Stop JIRA.
Execute the following SQL to verify the IP Match is the same as in the above stack trace:
SELECT * FROM trustedapp;
This should return the same IP as in the exception, for example:
10000;"confluence:9821982";"http://confluence.atlassian.com/";"<redacted>;"127.0.*.1";"/";10000;"2010-03-18 01:09:41.866+11";"chuck.norris";"2010-03-18 01:25:03.381+11";"chuck.norris"
Update the IP address something valid. In this example, we'll need to use "127.0.*.*", as below:
UPDATE trustedapp SET ip_match = '127.0.*.*' WHERE id = 10000;
- Start JIRA.
- Browse to the Application Link screen and upgrade the links if necessary.
- Test!
If there any problems, roll back the database using the previous backup.