Uploaded image for project: 'GeoServer'
  1. GEOS-8933

Requesting workspaces triggers an NPE when proxy headers are used for the proxy URL

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2.14-RC
    • Fix Version/s: 2.14.1
    • Component/s: REST
    • Labels:
      None

      Description

      When proxy headers are set and a requests such as /rest/workspaces.json is requested, the following exception is raised:

      <!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}.line {height: 1px; background-color: #525D76; border: none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> Request processing failed; nested exception is java.lang.NullPointerException</p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><p><b>Exception</b></p><pre>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
              org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
              org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
              javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
              org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
              javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
              org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
              org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:26)
              org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:69)
              org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:73)
              org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:66)
              org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:41)
              org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:37)
              org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
              org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
              org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
              org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
              org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
              org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
              org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
              org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
              org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:51)
              org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
              org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:215)
              org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
              org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
              org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:81)
              org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
              org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
              org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:52)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
              org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
              org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
              org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
              org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
              org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:141)
              org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
              org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
              org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:90)
              org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:79)
              org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:48)
              org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:46)
              org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:42)
              org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:455)
              org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:177)
              org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
              org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      </pre><p><b>Root Cause</b></p><pre>java.lang.NullPointerException
              org.geoserver.ows.ProxifyingURLMangler.compileHeadersMap(ProxifyingURLMangler.java:155)
              org.geoserver.ows.ProxifyingURLMangler.mangleURLHeaders(ProxifyingURLMangler.java:133)
              org.geoserver.ows.ProxifyingURLMangler.mangleURL(ProxifyingURLMangler.java:94)
              org.geoserver.ows.util.ResponseUtils.buildURL(ResponseUtils.java:372)
              org.geoserver.rest.RequestInfo.buildURI(RequestInfo.java:126)
              org.geoserver.rest.RequestInfo.pageURI(RequestInfo.java:109)
              org.geoserver.rest.converters.XStreamMessageConverter.href(XStreamMessageConverter.java:70)
              org.geoserver.rest.converters.XStreamCatalogListConverter$JSONXStreamListConverter.encodeLink(XStreamCatalogListConverter.java:206)
              org.geoserver.rest.converters.XStreamCatalogListConverter$2.marshal(XStreamCatalogListConverter.java:137)
              com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
              com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
              com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
              com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
              org.geoserver.rest.converters.XStreamCatalogListConverter$1.writeItem(XStreamCatalogListConverter.java:96)
              com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
              com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
              com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
              com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
              com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
              com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
              com.thoughtworks.xstream.XStream.marshal(XStream.java:1319)
              com.thoughtworks.xstream.XStream.marshal(XStream.java:1308)
              com.thoughtworks.xstream.XStream.toXML(XStream.java:1296)
              org.geoserver.rest.converters.XStreamCatalogListConverter.writeInternal(XStreamCatalogListConverter.java:72)
              org.geoserver.rest.converters.XStreamCatalogListConverter$JSONXStreamListConverter.writeInternal(XStreamCatalogListConverter.java:197)
              org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:226)
              org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:247)
              org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:174)
              org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:81)
              org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:113)
              org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
              org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
              org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
              org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
              org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
              org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
              org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
              javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
              org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
              javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
              org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
              org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:26)
              org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:69)
              org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:73)
              org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:66)
              org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:41)
              org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:37)
              org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
              org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
              org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
              org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
              org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
              org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
              org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
              org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
              org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:51)
              org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
              org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:215)
              org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
              org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
              org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:81)
              org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:70)
              org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
              org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:52)
              org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:74)
              org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
              org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
              org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
              org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
              org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:141)
              org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
              org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
              org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:90)
              org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:79)
              org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:48)
              org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:46)
              org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:42)
              org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:455)
              org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:177)
              org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
              org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      * Closing connection 0
      </pre><p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p><hr class="line" /><h3>Apache Tomcat/8.0.53</h3></body></html>
      

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                luca.morandini1 Luca Morandini
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: