<%@ page import="com.atlassian.config.util.BootstrapUtils, com.atlassian.confluence.cluster.ClusterInformation, com.atlassian.confluence.cluster.ClusterManager, com.atlassian.confluence.jmx.RequestMetrics, com.atlassian.confluence.plugin.persistence.PluginData, com.atlassian.confluence.plugin.persistence.PluginDataWithoutBinary, com.atlassian.confluence.plugin.persistence.PluginDataDao, com.atlassian.confluence.status.SystemErrorInformationLogger, com.atlassian.confluence.status.service.SystemInformationService, com.atlassian.confluence.status.service.systeminfo.ConfluenceInfo, com.atlassian.confluence.status.service.systeminfo.DatabaseInfo" %> <%@ page import="com.atlassian.confluence.status.service.systeminfo.MemoryInfo"%> <%@ page import="com.atlassian.confluence.util.GeneralUtil"%> <%@ page import="com.atlassian.confluence.util.HtmlUtil"%> <%@ page import="com.atlassian.confluence.util.I18NSupport"%> <%@ page import="com.atlassian.confluence.util.PatternLayoutWithStackTrace"%> <%@ page import="com.atlassian.core.logging.DatedLoggingEvent"%> <%@ page import="com.atlassian.core.logging.ThreadLocalErrorCollection"%> <%@ page import="com.atlassian.plugin.Plugin"%> <%@ page import="com.atlassian.plugin.PluginInformation"%> <%@ page import="com.atlassian.seraph.auth.DefaultAuthenticator"%> <%@ page import="com.atlassian.spring.container.ContainerManager"%> <%@ page import="org.apache.commons.lang3.StringUtils" %> <%@ page import="org.apache.log4j.spi.LoggingEvent" %> <%@ page import="org.apache.velocity.exception.MethodInvocationException" %> <%@ page import="java.io.BufferedReader" %> <%@ page import="java.io.PrintWriter"%> <%@ page import="java.io.StringReader" %> <%@ page import="java.lang.reflect.InvocationTargetException" %> <%@ page import="java.security.Principal" %> <%@ page import="java.text.DateFormat" %> <%@ page import="java.util.Date" %> <%@ page import="java.util.Enumeration" %> <%@ page import="java.util.Iterator" %> <%@ page import="java.util.List" %> <%@ page import="java.util.Locale" %> <%@ page import="java.util.Map" %> <%@ page import="java.util.UUID" %> <%@ page isErrorPage="true" %> <% String context = request.getContextPath(); %> <% try { %> Oops - an error has occurred

logo System Error

A system error has occurred — our apologies!

For immediate troubleshooting, consult our ">knowledge base for a solution.

If you would like to receive support from Atlassian's support team, ask your Confluence administrator to create a support issue on ">Atlassian's support system with the following information:

  1. a description of your problem and what you were doing at the time it occurred
  2. a copy of the error and system information found below
  3. a copy of the application logs (if possible).

Your Confluence administrator can use the support request form to create a support ticket which will include this information.

We will respond as promptly as possible.
Thank you!

Return to site homepage…

<% UUID uniqueID = UUID.randomUUID(); // enable an easy mapping between this page and the error log. SystemErrorInformationLogger logAction = new SystemErrorInformationLogger(uniqueID, pageContext.getServletContext(), request); logAction.writeToLog(false); RequestMetrics.incrementErrorCount(); SystemInformationService sysInfoService = null; PluginDataDao pluginDataDao = null; Throwable sysInfoRetrievalFailure = null; try { sysInfoService = ((SystemInformationService) ContainerManager.getInstance().getContainerContext().getComponent("systemInformationService")); pluginDataDao = (PluginDataDao) ContainerManager.getInstance().getContainerContext().getComponent("pluginDataDao"); } catch (Throwable t) { sysInfoRetrievalFailure = t; } // These variables are kept at a high scope to simplify the complexity of following scope in a // JSP like this one. // // sysInfoService being null will be used as a the check as to whether we should expect // non-null in any of these variables. Map sysinfo = null; MemoryInfo memoryInfo = null; DatabaseInfo dbInfo = null; ConfluenceInfo confluenceInfo = null; boolean isOrion = false; if (sysInfoService != null) { confluenceInfo = sysInfoService.getConfluenceInfo(); memoryInfo = sysInfoService.getMemoryInfo(); dbInfo = sysInfoService.getSafeDatabaseInfo(); sysinfo = GeneralUtil.convertBeanToMap(sysInfoService.getSystemProperties()); isOrion = "Orion".equals(sysinfo.get("appServer")); } else { out.println("The SystemInformationService could not be retrieved from the container."); out.println("Therefore very limited information is available in this error report.
"); if (sysInfoRetrievalFailure != null) {%>The SystemInformationService could not be retrieved due to the following error: <%= HtmlUtil.htmlEncode(String.valueOf(sysInfoRetrievalFailure)) %>
<% } } %> <% String uri = (String)request.getAttribute("javax.servlet.error.request_uri"); if(uri != null && uri.contains("editpage")) { String editDraft = context + "/pages/editpage.action?useDraft=true&pageId=" + HtmlUtil.htmlEncode(request.getParameter("pageId")); %>
You can resume editing the most recently saved draft of your page.
<% } %>

Cause

<% String ex = (String) request.getAttribute("javax.servlet.error.message"); if (isOrion) { //get the first line of the error message for the "cause:" String line = (ex == null) ? "No exception" : new BufferedReader(new StringReader(ex)).readLine(); %>

<%= HtmlUtil.htmlEncode(line) %>

<% } else { Throwable throwable = exception; String causedBy = ""; while (throwable != null) { String at = throwable.getStackTrace().length > 0 ? throwable.getStackTrace()[0].toString() : "Unknown location"; %>

<%= causedBy %><%= HtmlUtil.htmlEncode(String.valueOf(throwable)) %>
    at <%= HtmlUtil.htmlEncode(at) %>

<% causedBy = "caused by: "; if (throwable instanceof InvocationTargetException) { throwable = ((InvocationTargetException)throwable).getTargetException(); } else if (throwable instanceof MethodInvocationException) { throwable = ((MethodInvocationException)throwable).getWrappedThrowable(); } else if (throwable instanceof ServletException) { throwable = ((ServletException)throwable).getRootCause(); } else { throwable = throwable.getCause(); } } } %>

Stack Trace:[hide]

<% if (isOrion) { %>
<%= HtmlUtil.htmlEncode(ex) %>
<% } else { %>
<%
            StringBuffer sb = new StringBuffer();
            PatternLayoutWithStackTrace.appendStackTrace(sb, exception);
            out.print(HtmlUtil.htmlEncode(sb.toString()));
        %>
        
<% } %>

Referer URL

<%= request.getHeader("Referer") != null ? HtmlUtil.htmlEncode(request.getHeader("Referer")) : "Unknown" %>

<% if ((sysInfoService != null) && sysInfoService.isShowInfoOn500()) {%>

Confluence Application Information

Build Information

<% if (confluenceInfo != null) { Map buildstats = GeneralUtil.convertBeanToMap(confluenceInfo); // remove the properties that we don't want to display in the maps buildstats.remove("enabledPlugins"); buildstats.remove("startTime"); buildstats.remove("globalSettings"); for (Iterator it = buildstats.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry) it.next(); %> <%= entry.getKey() %>: <%= entry.getValue() %>
<% } } else { %> No build information available. <% } %> Unique ID: <%= uniqueID.toString()%>

Server information

Application Server: <%= application.getServerInfo() %>
Servlet Version: <%= application.getMajorVersion() %>.<%= application.getMinorVersion() %>
<% if (dbInfo != null) { %> Database Dialect: <%= dbInfo.getDialect() %>
Database Driver Name: <%= dbInfo.getDriverName() %>
<% } else { %> No database information available. <% } %>

Memory Information

<% if (memoryInfo != null) { %> Maximum Heap: <%= memoryInfo.getMaxHeap().megabytes() %> MB
Allocated Heap: <%= memoryInfo.getAllocatedHeap().megabytes() %> MB
Used Memory: <%= memoryInfo.getUsedHeap().megabytes() %> MB
Unused Allocated Memory: <%= memoryInfo.getFreeAllocatedHeap().megabytes() %> MB
Available Memory: <%= memoryInfo.getAvailableHeap().megabytes() %> MB
<% } else { %> No memory information available. <% } %>

System Information

<% if (sysinfo != null) { for (Iterator it = sysinfo.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry) it.next(); %> <%= entry.getKey() %>: <%= entry.getValue() %>
<% } } else { %> No system information available. <% } %>

<% if (BootstrapUtils.getBootstrapManager().getHibernateConfig().isHibernateSetup()) {%>

Cluster Information

<% try { %> <% ClusterManager clusterManager = (ClusterManager) ContainerManager.getComponent("clusterManager"); %> <% if (!clusterManager.isClustered()) { %>

Not clustered.

<% } else { %> <% ClusterInformation clusterInformation = clusterManager.getClusterInformation(); %>

Name: <%= HtmlUtil.htmlEncode(clusterInformation.getName())%>
Description: <%= HtmlUtil.htmlEncode(clusterInformation.getDescription())%>
Members:
<% for (Iterator it = clusterInformation.getMembers().iterator(); it.hasNext();) { %> - <%= HtmlUtil.htmlEncode(String.valueOf(it.next())) %>
<% } %>

<% } %> <% } catch (Throwable t) { %>

Error reporting cluster information: <%= HtmlUtil.htmlEncode(t.toString()) %>

<% } %> <% } %>

Plugins

Request

<% try { %>

Information

URL
<%= HtmlUtil.htmlEncode(request.getRequestURL().toString()) %>
URI
<%= HtmlUtil.htmlEncode(request.getRequestURI()) %>
Context Path
<%= request.getContextPath() %>
Servlet Path
<%= request.getServletPath() %>
<% if (StringUtils.isNotBlank(request.getPathInfo())) { %>
Path Info
<%= HtmlUtil.htmlEncode(request.getPathInfo()) %>
<% } %> <% if (StringUtils.isNotBlank(request.getQueryString())) { %>
Query String
<%= HtmlUtil.htmlEncode(request.getQueryString()) %>
<% } %>

Headers (Limited subset)

<% String[] headers = new String[]{"host", "x-forwarded-for", "user-agent", "keep-alive", "connection", "cache-control", "if-modified-since", "if-none-match"}; for (int i = 0; i < headers.length; i++) { String name = headers[i]; Enumeration headerValues = request.getHeaders(name); if (headerValues == null || !headerValues.hasMoreElements()) continue; %>
<%= HtmlUtil.htmlEncode(name) %>
<% while (headerValues.hasMoreElements()) { %>
<%= HtmlUtil.htmlEncode(String.valueOf(headerValues.nextElement()))%>
<% } } %>

Attributes

<% for (Enumeration attributeNames = request.getAttributeNames(); attributeNames.hasMoreElements();) { String name = String.valueOf(attributeNames.nextElement()); %>
<%= HtmlUtil.htmlEncode(name) %>
<%= HtmlUtil.htmlEncode(String.valueOf(request.getAttribute(name)))%>
<% } %>

Parameters (Limited subset)

<% for (Enumeration parameterNames = request.getParameterNames(); parameterNames.hasMoreElements();) { String name = String.valueOf(parameterNames.nextElement()); if (name.contains("pass")) continue; %>
<%= HtmlUtil.htmlEncode(name) %>
<% String[] parameterValues = request.getParameterValues(name); for (int i = 0; i < parameterValues.length; i++) { %>
<%= HtmlUtil.htmlEncode(parameterValues[i]) %>
<% } } %>

Confluence User

<% Object loggedInValue = session.getAttribute(DefaultAuthenticator.LOGGED_IN_KEY); String username = null; if ((loggedInValue != null) && (loggedInValue instanceof Principal)) { username = ((Principal)loggedInValue).getName(); } else { username = "unknown"; } %>

<%= username %>

<% } catch (Throwable t) { out.println("Error rendering logging information - uh oh."); t.printStackTrace(new PrintWriter(out)); } %> <% List events = ThreadLocalErrorCollection.getList(); if (events != null && !events.isEmpty()) { %>

Logging:

<% try { %>

<%= events.size() %> log statements generated by this request:

<% for (Iterator it = events.iterator(); it.hasNext();) { Object event = it.next(); if (event instanceof DatedLoggingEvent) { DatedLoggingEvent dle = (DatedLoggingEvent) event; LoggingEvent loggingEvent = dle.getEvent(); Date date = dle.getDate(); %>
[<%= HtmlUtil.htmlEncode(loggingEvent.getLevel().toString()) %>] <%= HtmlUtil.htmlEncode(date.toString()) %> [<%= HtmlUtil.htmlEncode(loggingEvent.getLoggerName()) %>] <%= HtmlUtil.htmlEncode(loggingEvent.getRenderedMessage()) %>
<% if (loggingEvent.getThrowableInformation() != null) { %>
Throwable:
<% for (int i = 0; i < loggingEvent.getThrowableStrRep().length && i < 20; i++) { String s = loggingEvent.getThrowableStrRep()[i]; out.println("" + HtmlUtil.htmlEncode(s) + "
"); } %>
<% } %>
<%} else { %> <%= HtmlUtil.htmlEncode(event.getClass().toString()) %>: <%= HtmlUtil.htmlEncode(event.toString()) %> <% } %> <% } %> <% } catch (Throwable t) { %>
Error rendering logging information - uh oh.
                        <% t.printStackTrace(new PrintWriter(out)); %>
                    
<% } %> <% } %> <% } %>
<% } finally { out.flush(); } %>