Errno::ECONNRESET (Connection reset by peer):

1,171 views
Skip to first unread message

dlamotte

unread,
Apr 27, 2011, 12:01:14 PM4/27/11
to Sunspot
hi,
i'm using sunspot (1.2.1) and rsolr 0.12.1 and i have the
following error depending on the selected data in the facets with
jetty on production mode.

i'm running the app on ubuntu with the lastest ruby enterprise/
passenger/apache with rvm.

i never have the problem in production mode on my dev machine running
os x with the same db and the same solr indexes.

i can't figure out how to solve that problem, any idea would be
nice :-)

thanks

for the details, i saw the following info:

4 second before i see that solr receive a the right but complex
following query

---- solr log ----
27 avr. 2011 17:42:48 org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/select params={[shortened params list with
25 facets]} hits=727 status=0 QTime=21
-----
---- rails log ----
Processing Admin::FakeController#search (for xx.xx.xx.xx at 2011-04-27
17:42:52) [POST]
---------------------------------------------------------------------------------------------------------------------------
Errno::ECONNRESET (Connection reset by peer):
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/protocol.rb:
135:in `sysread'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/protocol.rb:
135:in `rbuf_fill'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/timeout.rb:
67:in `timeout'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/timeout.rb:
101:in `timeout'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/protocol.rb:
134:in `rbuf_fill'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/protocol.rb:
116:in `readuntil'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/protocol.rb:
126:in `readline'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:
2028:in `read_status_line'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:
2017:in `read_new'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:
1051:in `request'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:
1037:in `request'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:
543:in `start'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:
1035:in `request'
/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:
772:in `get'
rsolr (0.12.1) lib/rsolr/connection/net_http.rb:16:in `get'
rsolr (0.12.1) lib/rsolr/connection/requestable.rb:36:in `request'
rsolr (0.12.1) lib/rsolr/client.rb:34:in `request'
sunspot (1.2.1) lib/sunspot/search/abstract_search.rb:35:in
`execute'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/sunspot_rails-1.2.1/lib/
sunspot/rails/searchable.rb:306:in `solr_execute_search'
/usr/local/rvm/gems/ree-1.8.7-2011.03/gems/sunspot_rails-1.2.1/lib/
sunspot/rails/searchable.rb:139:in `search'
app/controllers/admin/base_controller.rb:59:in `search_page_facet'
app/controllers/admin/links_controller.rb:17:in `search'
haml (3.0.25) rails/./lib/sass/plugin/rack.rb:41:in `call'
haml (3.0.25) rails/./lib/sass/plugin/rack.rb:41:in `call'
----

elmatou

unread,
Apr 28, 2011, 4:04:26 AM4/28/11
to Sunspot

elmatou

unread,
Apr 28, 2011, 4:11:42 AM4/28/11
to Sunspot
Hi,
It seems we have a similar error :
My post : http://groups.google.com/group/ruby-sunspot/browse_thread/thread/45a524e092a9626

My first guess is the nature of connection between the app and the
Solr server.
it is an http request, and maybe the request does'nt reach Solr
tottaly. If there is too many or too length arguments the request will
faill (or just be truncated).
here is a patch (not mine, and did'nt tried it yet.) to solve this
issue.
https://github.com/outoftime/sunspot/pull/47

I'll be glad if this is committed some day.

bye,

On Apr 27, 6:01 pm, dlamotte <denis.lamo...@gmail.com> wrote:

dlamotte

unread,
Apr 28, 2011, 8:10:10 AM4/28/11
to Sunspot
Thank you, at least i understand the problem now :-)

Now, i'll try to understand how to use it after having patching
unpacked version of sunspot in vendor/gems but no luck so far :(

still digging :-)

On 28 avr, 10:11, elmatou <ma...@grisbi.net> wrote:
> Hi,
> It seems we have a similar error :
> My post :http://groups.google.com/group/ruby-sunspot/browse_thread/thread/45a5...
>
> My first guess is the nature of connection between the app and the
> Solr server.
> it is an http request, and maybe the request does'nt reach Solr
> tottaly. If there is too many or too length arguments the request will
> faill (or just be truncated).
> here is a patch (not mine, and did'nt tried it yet.) to solve this
> issue.https://github.com/outoftime/sunspot/pull/47

dlamotte

unread,
Apr 28, 2011, 10:47:40 AM4/28/11
to Sunspot
i find the solution for big queries

update jetty.xml and add <Set name="headerBufferSize">65536</Set> on
the connector part.

Check with rake sunspot:solr:run that youre using the right jetty.xml
file. I unpacked the gems in the vendor/gems repos (2.3.11 app)
but the rake task was still using the config file from the gem.

A patch proposal has already been made for that change!!

<Call name="addConnector">
<Arg>
<New class="org.mortbay.jetty.bio.SocketConnector">
<Set name="port"><SystemProperty name="jetty.port"
default="8983"/></Set>
<Set name="maxIdleTime">50000</Set>
<Set name="lowResourceMaxIdleTime">1500</Set>
<!-- Increase the headerBufferSize -->
<Set name="headerBufferSize">65536</Set>
</New>
</Arg>
</Call>

Joey Hanzel

unread,
May 3, 2011, 9:49:02 AM5/3/11
to Sunspot
Hi,

I am seeing a similar problem when using Sunspot 1.2 with Solr CELL
rich content patch. During indexing, it appears rsolr sends all the
field data as params when an attachment value is provided. Some
records have more field data than supported by the httpHeader size in
Tomcat (default is 4kb). The result is a Rsolr::RequestError: Solr
Response: Bad Request (when using Tomcat) when trying to post these
larger records to a Solr Server.

You can bump up the maxHttpHeaderSize on your tomcat connector or in
jetty to workaround the issue. But I have found that by increasing the
header size I begin to run into out of memory exception that cause my
tomcat instance to go down.
Has anyone run into this one before?

elmatou

unread,
May 4, 2011, 4:19:35 AM5/4/11
to Sunspot
The patch has been applied and the parameters are now Posted to solr
server.
https://github.com/outoftime/sunspot/pull/47#issuecomment-1092651
POST method accept longer parameters than GET, maybe it is now enough
to you.
If it is still not enough, you'll have to increase the header size
(with all the risks it brings) as proposed by Joey.

On Apr 28, 10:11 am, elmatou <ma...@grisbi.net> wrote:
> Hi,
> It seems we have a similar error :
> My post :http://groups.google.com/group/ruby-sunspot/browse_thread/thread/45a5...
>
> My first guess is the nature of connection between the app and the
> Solr server.
> it is an http request, and maybe the request does'nt reach Solr
> tottaly. If there is too many or too length arguments the request will
> faill (or just be truncated).
> here is a patch (not mine, and did'nt tried it yet.) to solve this
> issue.https://github.com/outoftime/sunspot/pull/47
Reply all
Reply to author
Forward
0 new messages