On 2/9/2015 8:29 AM, yriveiro wrote:
> I'm trying to retrieve from Solr a query in CSV format with around 500K
> registers and I always get this error:
>
> "Expected mime type application/octet-stream but got application/xml. <?xml
> version=\"1.0\" encoding=\"UTF-8\"?>\n<response>\n<lst name=\"error\"><str
> name=\"msg\">application/x-www-form-urlencoded content length (6040427
> bytes) exceeds upload limit of 2048 KB</str><int
> name=\"code\">400</int></lst>\n</response>\n"
>
> If the rows value is lower, like 50000 the query doesn't fail.
>
> What I'm doing wrong?

This looks like your request POST is 6 megabytes in size, which is
larger than the default 2MB limit.

Toke has mentioned maxPostSize in the Tomcat configuration, but I don't
think that will do it.  SOLR-4265 (available as of Solr 4.1), in
addition to letting Solr enforce UTF-8 encoding regardless of the
container config, also programmatically sets the maximum POST size from
solrconfig.xml, defaulting to 2MB, and probably overriding any
container-level config like maxPostSize.

You can change this value in solrconfig.xml by adding/modifying the
formdataUploadLimitInKB attribute on the requestParsers tag.

The HTTP error code also supports my conclusion -- 4xx response codes
usually indicate a problem with the request, whereas 5xx response codes
indicate a problem with the server.  I suppose it's possible that the
size limitation might also apply to the response, but that doesn't feel
right to me.

Thanks,
Shawn

Reply via email to