Odd (and infrequent) error message

10 views
Skip to first unread message

mhodgson

unread,
Aug 22, 2008, 10:02:01 AM8/22/08
to Thinking Sphinx
Hey guys, I receiving an error intermittently on my production site
when using TS search. From looking at the source, it would appear that
it is due to Sphinx returning a malformed header causing the length of
the resulting search set to be set to null. Has anyone else seen
something similar or know what's going on here? I don't receive many
errors relative to the total number of search calls, and the failures
seem to be randomly generated from any and all of the places where I
use search in my code (meaning it can't be one syntax error or search
string causing the problem). Here is the error:

"comparison of Fixnum with nil failed"

vendor/rails/activesupport/lib/active_support/whiny_nil.rb:55:in `<'
vendor/plugins/thinking-sphinx/lib/riddle/client.rb:433:in `request'
vendor/plugins/thinking-sphinx/lib/riddle/client.rb:400:in `connect'
vendor/plugins/thinking-sphinx/lib/riddle/client.rb:415:in `request'
vendor/plugins/thinking-sphinx/lib/riddle/client.rb:170:in `run'
vendor/plugins/thinking-sphinx/lib/riddle/client.rb:277:in `query'
vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:200:in
`search_results'
vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:156:in
`search'
vendor/plugins/thinking-sphinx/lib/thinking_sphinx/active_record/
search.rb:29:in `search'

This error is always the same and since on line 433 of Riddle the
comparison is between a string length (this is explicitly set in the
code) and the length returned from sphinx, I must assume it is the
returned length that is nil....

Thanks for the help!!!

-Matt

Pat Allan

unread,
Aug 22, 2008, 2:32:42 PM8/22/08
to thinkin...@googlegroups.com
Hi Matt

Your lines of code from the error don't match up with the latest
version of the client.. although nothing's really changed in Sphinx/
Riddle in the last few months... still, update the code, and if the
issue still happens, send through the new call stack :)

Cheers

--
Pat

mhodgson

unread,
Aug 23, 2008, 6:10:13 PM8/23/08
to Thinking Sphinx
Hmmm, well, I updated the code and let it run for a week or so.
Getting the same deal. Here's the new trace (same error message):

vendor/rails/activesupport/lib/active_support/whiny_nil.rb:55:in `<'
vendor/plugins/thinking-sphinx/lib/riddle/client.rb:479:in `request'
vendor/plugins/thinking-sphinx/lib/riddle/client.rb:430:in `connect'
vendor/plugins/thinking-sphinx/lib/riddle/client.rb:461:in `request'
vendor/plugins/thinking-sphinx/lib/riddle/client.rb:200:in `run'
vendor/plugins/thinking-sphinx/lib/riddle/client.rb:307:in `query'
vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:266:in
`search_results'
vendor/plugins/thinking-sphinx/lib/thinking_sphinx/search.rb:186:in
`search'
vendor/plugins/thinking-sphinx/lib/thinking_sphinx/active_record/
search.rb:29:in `search'

Thanks!

-Matt

mhodgson

unread,
Aug 26, 2008, 2:38:16 PM8/26/08
to Thinking Sphinx
Pat (or anyone), Any idea what might be causing this. Still seeing
this error a lot even with the latest code.

Really appreciate the help.

-Matt

Pat Allan

unread,
Aug 26, 2008, 6:22:41 PM8/26/08
to thinkin...@googlegroups.com
Hi Matt

Try changing the following lines in client.rb, see if we can get some
sort of error code from Sphinx.
#479
while response && response.length < length

#485
if response.blank? || response.length != length

Sorry there's nothing more concrete.

--
Pat

Scott Rushforth

unread,
Nov 15, 2008, 11:25:16 AM11/15/08
to Pat Allan, thinkin...@googlegroups.com, matth...@mac.com
Hey there..

New to this group, but I came across your posting a bit ago when I hit
this same issue.

After some poking around, I am pretty sure what is happening, is that
you are searching for a word that is less than what is listed in your
sphinx.conf file for this particular indexes min_word_len.

So for me the pattern is like this:

min_word_len = 1
@author johndoe @inventory_code rt

--searches ok...

min_word_len = 2
@author johndoe @inventory_code rt

--searches ok...

min_word_len = 3
@author johndoe @inventory_code rt

--does not search ok..

min_word_len = 3
@author ja

--searches ok, returns basically everything and seems to ignore query,
probably normal

So its a bit odd, but it seems as if you are using extended mode and
attempting to search 2 fields, searchd segfaults. When searchd
segfaults riddle doesnt get anything back, and the version that I have
complains about the Fixnum as you posted. I have applied the error
checking you mention above, and riddle throws a ResponseError but
version/error are totally blank as searchd's thread segfaults.

I will continue to try and debug it more and I guess probably submit a
bug report to sphinx. If anyone else experiencing this issue can
confirm this behaviour that would be cool.

Cheers, and enjoy your weekend.

-Scott Rushforth

manohar amrutkar

unread,
Jan 6, 2009, 4:09:34 AM1/6/09
to Thinking Sphinx
Hi Scott,

I am receiving the same error.

It works in few cases,

(Test cases examples are taken from console.)
eg.

>> @results = FeedItem.search "attack",:conditions => { :feed_id=>1},:match_mode => :extended,:per_page=>1000

=> [#<FeedItem id: 12367, feed_id: 1, title: "Attacks in Iraq kill 20
people", url: "http://edition.cnn.com/2008/WORLD/meast/12/15/
iraq....", description: "Deadly attacks in northern Iraq on Monday
left nine...", publication_date: "2008-12-16 06:29:05", created_at:
"2008-12-16 06:29:05", updated_at: "2008-12-16 06:29:05", delta: nil>,
#<FeedItem id: 5891, feed_id: 1, title: "U.N. sanctions Mumbai attacks
suspects", url: "http://edition.cnn.com/2008/WORLD/asiapcf/12/10/
un....", description: "A U.N. committee has designated as terrorists
four ...", publication_date: "2008-12-11 01:36:20", created_at:
"2008-12-11 05:51:40", updated_at: "2008-12-11 05:51:40", delta: nil>]

And it doesn't work in case like,

eg.

>> @results = FeedItem.search "terror",:conditions => { :feed_id=>1},:match_mode => :extended,:per_page=>1000
ArgumentError: comparison of Fixnum with nil failed
from /code/vendor/plugins/thinking-sphinx/lib/riddle/client.rb:
479:in `<'
from /code/vendor/plugins/thinking-sphinx/lib/riddle/client.rb:
479:in `request'
from /code/vendor/plugins/thinking-sphinx/lib/riddle/client.rb:
430:in `connect'
from /code/vendor/plugins/thinking-sphinx/lib/riddle/client.rb:
461:in `request'
from /code/vendor/plugins/thinking-sphinx/lib/riddle/client.rb:
200:in `run'
from /code/vendor/plugins/thinking-sphinx/lib/riddle/client.rb:
307:in `query'
from /code/vendor/plugins/thinking-sphinx/lib/thinking_sphinx/
search.rb:249:in `search_results'
from /code/vendor/plugins/thinking-sphinx/lib/thinking_sphinx/
search.rb:180:in `search'
from /code/vendor/plugins/thinking-sphinx/lib/thinking_sphinx/
active_record/search.rb:29:in `search'
from (irb):7


Could you please help me out to resolve this issue?


Thanks,
Manohar

Pat Allan

unread,
Jan 6, 2009, 7:41:52 AM1/6/09
to thinkin...@googlegroups.com
Hi Manohar

Your stack trace doesn't seem to match the latest version of Thinking
Sphinx (or are you running the 0.9.9 branch?). If you could update it
and repost the trace, that'd be great :)

Cheers

--
Pat

vk

unread,
Jan 20, 2009, 10:50:27 AM1/20/09
to Thinking Sphinx
Hi

I am facing the same problem. But only if my search string contains a
* + space. like
"vikas *" -> no error
"vikas * " -> error
"vikas*vikas" -> no error
"vikas*" ->no error

Please help me out. And hey, on one of my servers (which is in
production mode) its working for all the cases. Stacktrace same as
previous posts. Is there some setting for sphinx specifically for
special chars?

Pat Allan

unread,
Jan 20, 2009, 11:15:15 AM1/20/09
to thinkin...@googlegroups.com
Hi Vikas

Technically, "vikas * " is a useless query - well, the * does nothing,
as it's not indicating a prefix or a suffix. That said, we don't want
it erroring.

Just to confirm, what's the stack trace when you get the error?

Cheers

--
Pat

bantic

unread,
Mar 5, 2009, 5:42:02 PM3/5/09
to Thinking Sphinx
Hey all,

I'm still having this issue. Here's some limited information I've
been able to gather:

I threw some begin/rescue code around the offending line, like so:
begin
while response && response.length < length
part = socket.recv(length - response.length)
response << part if part
end
rescue => e
raise "some issue w/response from searchd (status: #
{status}, version: #{version}) #{messages.collect{|m|
m.to_s}.inspect}"
end

And here's the traceback:
/var/lib/gems/1.8/gems/riddle-0.9.8.1231.0/lib/riddle/client.rb:439:in
`request': some issue w/response from searchd (status: , version: )
["\000\000\000\000\000\000\000\024\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\031DELIMITER
query DELIMITER\000\000\000\000\000\000\000\021place_namings_idx
\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\016metro_area_ids
\000\000\000\000\000\000\000\001\000\000\b
\352\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\350\000\000\000\v@group
desc
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"]
(RuntimeError)
from /var/lib/gems/1.8/gems/riddle-0.9.8.1231.0/lib/riddle/client.rb:
400:in `connect'
from /var/lib/gems/1.8/gems/riddle-0.9.8.1231.0/lib/riddle/client.rb:
415:in `request'
from /var/lib/gems/1.8/gems/riddle-0.9.8.1231.0/lib/riddle/client.rb:
170:in `run'
from /var/lib/gems/1.8/gems/riddle-0.9.8.1231.0/lib/riddle/client.rb:
277:in `query'

This seems to occur with the place_namings_idx every time. There are 4
indexes we use, and place_namings_idx is the only one I've seen have
trouble. Other than that, I don't see any pattern.

Any ideas, or ways I can give you more information?
thanks,
Cory

Pat Allan

unread,
Mar 15, 2009, 9:54:24 PM3/15/09
to thinkin...@googlegroups.com
Hi Cory

I'm not entirely sure what the bug is, but it looks like Sphinx is
bailing for some reason, given there's no status or version returned.
What's the query you're running in Thinking Sphinx or Riddle (the call
to the relevant method, as well as the data being passed through)?
Also, in your debug information, can you output the response as well?

--
Pat
Reply all
Reply to author
Forward
0 new messages