Uploaded image for project: 'Spring Data for Apache Solr'
  1. Spring Data for Apache Solr
  2. DATASOLR-370

SDS constructing query requests with text/html Content Type

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.1 (Ingalls SR1)
    • Fix Version/s: None
    • Component/s: Repository
    • Labels:
      None
    • Environment:
      Windows, Unix

      Description

      When upgrading from Spring Boot 1.4.0 (SDS 2.0.0) to 1.5.2 (SDS 2.1.1) all of our SDS queries started failing. It appears that SDS 2.1.1 is constructing it's queries with a Content Type of 'text/html' instead of 'application/octet-stream' as it had in 2.0.x and Solr does not like that.

      Here's a snippet of a query debug log using SDS 2.0.0 (followed by a 2.1.1 snippet below):

      16:05:30.342 [http-nio-8080-exec-8] DEBUG o.s.web.servlet.DispatcherServlet - DispatcherServlet with name 'dispatcherServlet' processing GET request for [/tracs/lookup/organizations]
      16:05:30.344 [http-nio-8080-exec-8] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /lookup/organizations
      16:05:30.349 [http-nio-8080-exec-8] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Returning handler method [public org.springframework.hateoas.PagedResources<org.springframework.hateoas.Resource<gov.doi.tracs.domain.solr.LookupData>> gov.doi.tracs.lookups.LookupController.findOrganizations(java.lang.String,org.springframework.data.domain.Pageable,org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler)]
      16:05:30.349 [http-nio-8080-exec-8] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'lookupController'
      16:05:30.352 [http-nio-8080-exec-8] DEBUG o.s.web.servlet.DispatcherServlet - Last-Modified value for [/tracs/lookup/organizations] is: -1
      16:05:30.352 [http-nio-8080-exec-8] DEBUG o.s.o.j.s.OpenEntityManagerInViewInterceptor - Opening JPA EntityManager in OpenEntityManagerInViewInterceptor
      16:05:30.419 [http-nio-8080-exec-8] DEBUG o.s.data.solr.core.SolrTemplate - Executing query 'q=discriminator:org+AND+searchableName:colo&start=0&rows=20' against solr.
      16:05:30.539 [http-nio-8080-exec-8] DEBUG o.a.h.i.c.PoolingClientConnectionManager - Connection request: [route: {}->http://localhost:8983][total kept alive: 0; route allocated: 0 of 5; total allocated: 0 of 10]
      16:05:30.550 [http-nio-8080-exec-8] DEBUG o.a.h.i.c.PoolingClientConnectionManager - Connection leased: [id: 0][route: {}->http://localhost:8983][total kept alive: 0; route allocated: 1 of 5; total allocated: 1 of 10]
      16:05:30.552 [http-nio-8080-exec-8] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - Connecting to localhost:8983
      16:05:30.572 [http-nio-8080-exec-8] DEBUG o.a.h.c.protocol.RequestAddCookies - CookieSpec selected: default
      16:05:30.574 [http-nio-8080-exec-8] DEBUG o.a.h.c.protocol.RequestAuthCache - Auth cache not set in the context
      16:05:30.574 [http-nio-8080-exec-8] DEBUG o.a.h.c.p.RequestTargetAuthentication - Target auth state: UNCHALLENGED
      16:05:30.574 [http-nio-8080-exec-8] DEBUG o.a.h.c.p.RequestProxyAuthentication - Proxy auth state: UNCHALLENGED
      16:05:30.574 [http-nio-8080-exec-8] DEBUG o.a.h.i.c.SystemDefaultHttpClient - Attempt 1 to execute request
      16:05:30.574 [http-nio-8080-exec-8] DEBUG o.a.h.i.conn.DefaultClientConnection - Sending request: GET /solr/solr_lookups_v2/select?q=discriminator%3Aorg+AND+searchableName%3Acolo&start=0&rows=20&wt=javabin&version=2 HTTP/1.1
      16:05:30.574 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - >> "GET /solr/solr_lookups_v2/select?q=discriminator%3Aorg+AND+searchableName%3Acolo&start=0&rows=20&wt=javabin&version=2 HTTP/1.1[\r][\n]"
      16:05:30.574 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - >> "User-Agent: Solr[org.apache.solr.client.solrj.impl.HttpSolrClient] 1.0[\r][\n]"
      16:05:30.574 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - >> "Host: localhost:8983[\r][\n]"
      16:05:30.574 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - >> "Connection: Keep-Alive[\r][\n]"
      16:05:30.574 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - >> "[\r][\n]"
      16:05:30.574 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - >> GET /solr/solr_lookups_v2/select?q=discriminator%3Aorg+AND+searchableName%3Acolo&start=0&rows=20&wt=javabin&version=2 HTTP/1.1
      16:05:30.574 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - >> User-Agent: Solr[org.apache.solr.client.solrj.impl.HttpSolrClient] 1.0
      16:05:30.574 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - >> Host: localhost:8983
      16:05:30.574 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - >> Connection: Keep-Alive
      16:05:30.579 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "HTTP/1.1 200 OK[\r][\n]"
      16:05:30.582 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "Content-Type: application/octet-stream[\r][\n]"
      16:05:30.582 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "Content-Length: 611[\r][\n]"
      16:05:30.582 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "[\r][\n]"
      16:05:30.582 [http-nio-8080-exec-8] DEBUG o.a.h.i.conn.DefaultClientConnection - Receiving response: HTTP/1.1 200 OK
      16:05:30.582 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - << HTTP/1.1 200 OK
      16:05:30.582 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - << Content-Type: application/octet-stream
      16:05:30.582 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - << Content-Length: 611
      16:05:30.584 [http-nio-8080-exec-8] DEBUG o.a.h.i.c.SystemDefaultHttpClient - Connection can be kept alive indefinitely
      16:05:30.597 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "[0x2][0xa2][0xe0].responseHeader[0xa3][0xe0]&status[0x6][0x0][0x0][0x0][0x0][0xe0]%QTimeA[0xe0]&params[0xa5][0xe0]!q?[\n]"
      16:05:30.597 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "discriminator:org AND searchableName:colo[0xe0]%start!0[0xe0]$rows"20[0xe0]"wt'javabin[0xe0]'version!2[0xe0](response[0xc][0x83]c`[0x0][0x83][0xb][0xaa][0xe0],officialName;Colorado Parks and Wildlife[0xe0])stateName(Colorado[0xe0](entityId"17[0xe0]-discriminator#org[0xe0]$name;Colorado Parks and Wildlife[0xe0])hasAdmins!Y[0xe0]1stateAbbreviation"CO[0xe0]"id%17org[0xe0]$type%State[0xe0])version[0x7][0x15][0xaf][0xce][0x13]p[0x0][0xf][0xb][0xa8][0xeb]>Lower Colorado River Authority[0xed](60264167[0xee]#org[0xef]>Lower Colorado River Authority[0xf0]!N[0xf2]+60264167org[0xf3]%Other[0xf4][0x7][0x15][0xaf][0xce][0x15][0xf0][0x0][0x16][0xb][0xaa][0xeb]?[0x9]Colorado Department of Natural Resources[0xec](Colorado[0xed]"16[0xee]#org[0xef]?[0x9]Colorado Department of Natural Resources[0xf0]!N[0xf1]"CO[0xf2]%16org[0xf3]%State[0xf4][0x7][0x15][0xaf][0xce][0x13]p[0x0][0xe]"
      16:05:30.599 [http-nio-8080-exec-8] DEBUG o.a.h.i.c.PoolingClientConnectionManager - Connection [id: 0][route: {}->http://localhost:8983] can be kept alive indefinitely
      16:05:30.599 [http-nio-8080-exec-8] DEBUG o.a.h.i.c.PoolingClientConnectionManager - Connection released: [id: 0][route: {}->http://localhost:8983][total kept alive: 1; route allocated: 1 of 5; total allocated: 1 of 10]
      16:05:30.704 [http-nio-8080-exec-8] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'repositoryRelProvider'

      Here's a snippet of the same query debug log using SDS 2.1.1:

      16:27:11.752 [http-nio-8080-exec-8] DEBUG o.s.web.servlet.DispatcherServlet - DispatcherServlet with name 'dispatcherServlet' processing GET request for [/tracs/lookup/organizations]
      16:27:11.753 [http-nio-8080-exec-8] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /lookup/organizations
      16:27:11.756 [http-nio-8080-exec-8] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Returning handler method [public org.springframework.hateoas.PagedResources<org.springframework.hateoas.Resource<gov.doi.tracs.domain.solr.LookupData>> gov.doi.tracs.lookups.LookupController.findOrganizations(java.lang.String,org.springframework.data.domain.Pageable,org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler)]
      16:27:11.756 [http-nio-8080-exec-8] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'lookupController'
      16:27:11.756 [http-nio-8080-exec-8] DEBUG o.s.web.servlet.DispatcherServlet - Last-Modified value for [/tracs/lookup/organizations] is: -1
      16:27:11.756 [http-nio-8080-exec-8] DEBUG o.s.o.j.s.OpenEntityManagerInViewInterceptor - Opening JPA EntityManager in OpenEntityManagerInViewInterceptor
      16:27:11.789 [http-nio-8080-exec-8] DEBUG o.s.d.solr.core.DefaultQueryParser - Constructed SolrQuery:
      %s
      16:27:11.789 [http-nio-8080-exec-8] DEBUG o.s.data.solr.core.SolrTemplate - Executing query 'q=discriminator:org+AND+searchableName:colo&start=0&rows=20' against solr.
      16:27:11.895 [http-nio-8080-exec-8] DEBUG o.a.h.i.c.PoolingClientConnectionManager - Connection request: [route: {}->http://localhost:8983][total kept alive: 0; route allocated: 0 of 5; total allocated: 0 of 10]
      16:27:11.911 [http-nio-8080-exec-8] DEBUG o.a.h.i.c.PoolingClientConnectionManager - Connection leased: [id: 0][route: {}->http://localhost:8983][total kept alive: 0; route allocated: 1 of 5; total allocated: 1 of 10]
      16:27:11.916 [http-nio-8080-exec-8] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - Connecting to localhost:8983
      16:27:11.949 [http-nio-8080-exec-8] DEBUG o.a.h.c.protocol.RequestAddCookies - CookieSpec selected: default
      16:27:11.951 [http-nio-8080-exec-8] DEBUG o.a.h.c.protocol.RequestAuthCache - Auth cache not set in the context
      16:27:11.951 [http-nio-8080-exec-8] DEBUG o.a.h.c.p.RequestTargetAuthentication - Target auth state: UNCHALLENGED
      16:27:11.951 [http-nio-8080-exec-8] DEBUG o.a.h.c.p.RequestProxyAuthentication - Proxy auth state: UNCHALLENGED
      16:27:11.951 [http-nio-8080-exec-8] DEBUG o.a.h.i.c.SystemDefaultHttpClient - Attempt 1 to execute request
      16:27:11.952 [http-nio-8080-exec-8] DEBUG o.a.h.i.conn.DefaultClientConnection - Sending request: GET /solr/solr_lookups_v2/solr_lookups_v2/select?q=discriminator%3Aorg+AND+searchableName%3Acolo&start=0&rows=20&wt=javabin&version=2 HTTP/1.1
      16:27:11.952 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - >> "GET /solr/solr_lookups_v2/solr_lookups_v2/select?q=discriminator%3Aorg+AND+searchableName%3Acolo&start=0&rows=20&wt=javabin&version=2 HTTP/1.1[\r][\n]"
      16:27:11.954 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - >> "User-Agent: Solr[org.apache.solr.client.solrj.impl.HttpSolrClient] 1.0[\r][\n]"
      16:27:11.954 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - >> "Host: localhost:8983[\r][\n]"
      16:27:11.954 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - >> "Connection: Keep-Alive[\r][\n]"
      16:27:11.954 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - >> "[\r][\n]"
      16:27:11.954 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - >> GET /solr/solr_lookups_v2/solr_lookups_v2/select?q=discriminator%3Aorg+AND+searchableName%3Acolo&start=0&rows=20&wt=javabin&version=2 HTTP/1.1
      16:27:11.954 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - >> User-Agent: Solr[org.apache.solr.client.solrj.impl.HttpSolrClient] 1.0
      16:27:11.954 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - >> Host: localhost:8983
      16:27:11.954 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - >> Connection: Keep-Alive
      16:27:11.958 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "HTTP/1.1 404 Not Found[\r][\n]"
      16:27:11.960 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "Content-Type: text/html; charset=ISO-8859-1[\r][\n]"
      16:27:11.960 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "Cache-Control: must-revalidate,no-cache,no-store[\r][\n]"
      16:27:11.960 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "Content-Length: 327[\r][\n]"
      16:27:11.960 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "[\r][\n]"
      16:27:11.961 [http-nio-8080-exec-8] DEBUG o.a.h.i.conn.DefaultClientConnection - Receiving response: HTTP/1.1 404 Not Found
      16:27:11.961 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - << HTTP/1.1 404 Not Found
      16:27:11.961 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - << Content-Type: text/html; charset=ISO-8859-1
      16:27:11.961 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - << Cache-Control: must-revalidate,no-cache,no-store
      16:27:11.961 [http-nio-8080-exec-8] DEBUG org.apache.http.headers - << Content-Length: 327
      16:27:11.966 [http-nio-8080-exec-8] DEBUG o.a.h.i.c.SystemDefaultHttpClient - Connection can be kept alive indefinitely
      16:27:11.980 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "<html>[\n]"
      16:27:11.980 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "<head>[\n]"
      16:27:11.980 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>[\n]"
      16:27:11.980 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "<title>Error 404 Not Found</title>[\n]"
      16:27:11.980 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "</head>[\n]"
      16:27:11.980 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "<body><h2>HTTP ERROR 404</h2>[\n]"
      16:27:11.980 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "<p>Problem accessing /solr/solr_lookups_v2/solr_lookups_v2/select. Reason:[\n]"
      16:27:11.980 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "<pre> Not Found</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>[\n]"
      16:27:11.980 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "[\n]"
      16:27:11.980 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "</body>[\n]"
      16:27:11.980 [http-nio-8080-exec-8] DEBUG org.apache.http.wire - << "</html>[\n]"
      16:27:11.980 [http-nio-8080-exec-8] DEBUG o.a.h.i.c.PoolingClientConnectionManager - Connection [id: 0][route: {}->http://localhost:8983] can be kept alive indefinitely
      16:27:11.980 [http-nio-8080-exec-8] DEBUG o.a.h.i.c.PoolingClientConnectionManager - Connection released: [id: 0][route: {}->http://localhost:8983][total kept alive: 1; route allocated: 1 of 5; total allocated: 1 of 10]
      16:27:11.984 [http-nio-8080-exec-8] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'solrExceptionTranslator'

        Attachments

          Activity

            People

            • Assignee:
              cstrobl Christoph Strobl
              Reporter:
              ojhsolutions John Hall
              Last updater:
              John Hall
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: