riddle icon indicating copy to clipboard operation
riddle copied to clipboard

Wierd problem, please help.

Open Shinta opened this issue 13 years ago • 17 comments

Hello,

I'm using Ruby 1.9.2 p320 with RVM, latest Sphinx (2.0.6), latests Thinking Sphinx (2.0.14), Rails 3.0.18 and Riddle 1.5.4, and I'm getting this wierd error only only in the browser, in the console it works like a charm:

undefined method unpack' for nil:NilClass riddle (1.5.4) lib/riddle/client/response.rb:25:innext_int'

More backtrace

riddle (1.5.4) lib/riddle/client/response.rb:25:in next_int' riddle (1.5.4) lib/riddle/client/response.rb:62:inblock in next_int_array' riddle (1.5.4) lib/riddle/client/response.rb:61:in times' riddle (1.5.4) lib/riddle/client/response.rb:61:innext_int_array' riddle (1.5.4) lib/riddle/client.rb:836:in attribute_from_type' riddle (1.5.4) lib/riddle/client.rb:270:inblock (3 levels) in run' riddle (1.5.4) lib/riddle/client.rb:269:in each' riddle (1.5.4) lib/riddle/client.rb:269:inblock (2 levels) in run' riddle (1.5.4) lib/riddle/client.rb:263:in each' riddle (1.5.4) lib/riddle/client.rb:263:inmap' riddle (1.5.4) lib/riddle/client.rb:263:in block in run' riddle (1.5.4) lib/riddle/client.rb:228:incollect' riddle (1.5.4) lib/riddle/client.rb:228:in run' riddle (1.5.4) lib/riddle/client.rb:338:inquery' thinking-sphinx (2.0.14) lib/thinking_sphinx/search.rb:429:in block (2 levels) in populate' activesupport (3.0.18) lib/active_support/notifications.rb:52:inblock in instrument' activesupport (3.0.18) lib/active_support/notifications/instrumenter.rb:21:in instrument' activesupport (3.0.18) lib/active_support/notifications.rb:52:ininstrument' thinking-sphinx (2.0.14) lib/thinking_sphinx/search.rb:556:in log' thinking-sphinx (2.0.14) lib/thinking_sphinx/search.rb:565:inlog' thinking-sphinx (2.0.14) lib/thinking_sphinx/search.rb:428:in block in populate' thinking-sphinx (2.0.14) lib/thinking_sphinx/search.rb:606:incall' thinking-sphinx (2.0.14) lib/thinking_sphinx/search.rb:606:in retry_on_stale_index' thinking-sphinx (2.0.14) lib/thinking_sphinx/search.rb:426:inpopulate' thinking-sphinx (2.0.14) lib/thinking_sphinx/search.rb:95:in initialize' thinking-sphinx (2.0.14) lib/thinking_sphinx/search_methods.rb:368:innew' thinking-sphinx (2.0.14) lib/thinking_sphinx/search_methods.rb:368:in `search'

Please if you can help me will be awesome.

Shinta avatar Jan 09 '13 16:01 Shinta

Hi Augusto

Do you have any other versions of Sphinx installed? And is this error occurring locally, or on production? What webserver setup are you using? (Apache/Nginx/Pow/Mongrel/Webrick/Unicorn/etc...)

pat avatar Jan 10 '13 04:01 pat

The thing is, this only happens when I use Passenger + Apache, it works fine on console, WEBrick and Passenger standalone.

The other thing is, I have a newer version that the code I'm having problems, I deployed in the same server, and I works fine, so there is also a problem with my older code, I think.

I having the sites running over Passenger standalone + Apache Proxy Pass, sucks a little but it does the job.

I only maintain a single version of Sphinx on my servers.

Let me if you find out something.

On Thu, Jan 10, 2013 at 1:53 AM, Pat Allan [email protected] wrote:

Hi Augusto

Do you have any other versions of Sphinx installed? And is this error occurring locally, or on production? What webserver setup are you using? (Apache/Nginx/Pow/Mongrel/Webrick/Unicorn/etc...)

— Reply to this email directly or view it on GitHubhttps://github.com/pat/riddle/issues/56#issuecomment-12080745.

Augusto Ruibal

Shinta avatar Jan 10 '13 11:01 Shinta

Right, so I think this is a PATH issue - Passenger/Apache doesn't run within your user account, so it can't find Sphinx to determine which version it's dealing with.

If you set bin_path in config/sphinx.yml, this should resolve the problem. You can figure out the value by running which indexer within your shell, then remove the 'indexer' part of the output, and put the rest in as the value. The docs cover this as well (granted, you've got to know what to look for!): http://pat.github.com/ts/en/common_issues.html#passenger

Hope that helps!

On 10/01/2013, at 10:51 PM, Augusto Ruibal wrote:

The thing is, this only happens when I use Passenger + Apache, it works fine on console, WEBrick and Passenger standalone.

The other thing is, I have a newer version that the code I'm having problems, I deployed in the same server, and I works fine, so there is also a problem with my older code, I think.

I having the sites running over Passenger standalone + Apache Proxy Pass, sucks a little but it does the job.

I only maintain a single version of Sphinx on my servers.

Let me if you find out something.

On Thu, Jan 10, 2013 at 1:53 AM, Pat Allan [email protected] wrote:

Hi Augusto

Do you have any other versions of Sphinx installed? And is this error occurring locally, or on production? What webserver setup are you using? (Apache/Nginx/Pow/Mongrel/Webrick/Unicorn/etc...)

— Reply to this email directly or view it on GitHubhttps://github.com/pat/riddle/issues/56#issuecomment-12080745.

Augusto Ruibal — Reply to this email directly or view it on GitHub.

pat avatar Jan 10 '13 12:01 pat

I always overwrite bin_path, I've using this configuration for the path four years (I've written and maintain like 4 classifieds networks), like I wrote in the title, this is very weird, It's an old site anyways.

Here's an example of my sphinx.yml:

< ENVIRONMENT - have like 24 environments >: bin_path: /usr/local/bin port: < PORT - have like 22 Sphinx's instances > max_matches: 100000 mem_limit: 64M charset_table: < LOTS OF TEXT >

Thank you very much for your time Pat.

On Thu, Jan 10, 2013 at 9:35 AM, Pat Allan [email protected] wrote:

Right, so I think this is a PATH issue - Passenger/Apache doesn't run within your user account, so it can't find Sphinx to determine which version it's dealing with.

If you set bin_path in config/sphinx.yml, this should resolve the problem. You can figure out the value by running which indexer within your shell, then remove the 'indexer' part of the output, and put the rest in as the value. The docs cover this as well (granted, you've got to know what to look for!): http://pat.github.com/ts/en/common_issues.html#passenger

Hope that helps!

On 10/01/2013, at 10:51 PM, Augusto Ruibal wrote:

The thing is, this only happens when I use Passenger + Apache, it works fine on console, WEBrick and Passenger standalone.

The other thing is, I have a newer version that the code I'm having problems, I deployed in the same server, and I works fine, so there is also a problem with my older code, I think.

I having the sites running over Passenger standalone + Apache Proxy Pass, sucks a little but it does the job.

I only maintain a single version of Sphinx on my servers.

Let me if you find out something.

On Thu, Jan 10, 2013 at 1:53 AM, Pat Allan [email protected] wrote:

Hi Augusto

Do you have any other versions of Sphinx installed? And is this error occurring locally, or on production? What webserver setup are you using? (Apache/Nginx/Pow/Mongrel/Webrick/Unicorn/etc...)

— Reply to this email directly or view it on GitHub< https://github.com/pat/riddle/issues/56#issuecomment-12080745>.

Augusto Ruibal

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/pat/riddle/issues/56#issuecomment-12092687.

Augusto Ruibal

Shinta avatar Jan 10 '13 12:01 Shinta

Hrm. Okay. This is certainly odd then. What happens if you downgrade to 1.5.3?

On 10/01/2013, at 11:44 PM, Augusto Ruibal wrote:

I always overwrite bin_path, I've using this configuration for the path four years (I've written and maintain like 4 classifieds networks), like I wrote in the title, this is very weird, It's an old site anyways.

Here's an example of my sphinx.yml:

< ENVIRONMENT - have like 24 environments >: bin_path: /usr/local/bin port: < PORT - have like 22 Sphinx's instances > max_matches: 100000 mem_limit: 64M charset_table: < LOTS OF TEXT >

Thank you very much for your time Pat.

On Thu, Jan 10, 2013 at 9:35 AM, Pat Allan [email protected] wrote:

Right, so I think this is a PATH issue - Passenger/Apache doesn't run within your user account, so it can't find Sphinx to determine which version it's dealing with.

If you set bin_path in config/sphinx.yml, this should resolve the problem. You can figure out the value by running which indexer within your shell, then remove the 'indexer' part of the output, and put the rest in as the value. The docs cover this as well (granted, you've got to know what to look for!): http://pat.github.com/ts/en/common_issues.html#passenger

Hope that helps!

On 10/01/2013, at 10:51 PM, Augusto Ruibal wrote:

The thing is, this only happens when I use Passenger + Apache, it works fine on console, WEBrick and Passenger standalone.

The other thing is, I have a newer version that the code I'm having problems, I deployed in the same server, and I works fine, so there is also a problem with my older code, I think.

I having the sites running over Passenger standalone + Apache Proxy Pass, sucks a little but it does the job.

I only maintain a single version of Sphinx on my servers.

Let me if you find out something.

On Thu, Jan 10, 2013 at 1:53 AM, Pat Allan [email protected] wrote:

Hi Augusto

Do you have any other versions of Sphinx installed? And is this error occurring locally, or on production? What webserver setup are you using? (Apache/Nginx/Pow/Mongrel/Webrick/Unicorn/etc...)

— Reply to this email directly or view it on GitHub< https://github.com/pat/riddle/issues/56#issuecomment-12080745>.

Augusto Ruibal

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/pat/riddle/issues/56#issuecomment-12092687.

Augusto Ruibal — Reply to this email directly or view it on GitHub.

pat avatar Jan 10 '13 12:01 pat

Tried, same problem, tried to downgrade Sphinx to 0.9.9, same problem.

On Thu, Jan 10, 2013 at 9:49 AM, Pat Allan [email protected] wrote:

Hrm. Okay. This is certainly odd then. What happens if you downgrade to 1.5.3?

On 10/01/2013, at 11:44 PM, Augusto Ruibal wrote:

I always overwrite bin_path, I've using this configuration for the path four years (I've written and maintain like 4 classifieds networks), like I wrote in the title, this is very weird, It's an old site anyways.

Here's an example of my sphinx.yml:

< ENVIRONMENT - have like 24 environments >: bin_path: /usr/local/bin port: < PORT - have like 22 Sphinx's instances > max_matches: 100000 mem_limit: 64M charset_table: < LOTS OF TEXT >

Thank you very much for your time Pat.

On Thu, Jan 10, 2013 at 9:35 AM, Pat Allan [email protected] wrote:

Right, so I think this is a PATH issue - Passenger/Apache doesn't run within your user account, so it can't find Sphinx to determine which version it's dealing with.

If you set bin_path in config/sphinx.yml, this should resolve the problem. You can figure out the value by running which indexer within your shell, then remove the 'indexer' part of the output, and put the rest in as the value. The docs cover this as well (granted, you've got to know what to look for!): http://pat.github.com/ts/en/common_issues.html#passenger

Hope that helps!

On 10/01/2013, at 10:51 PM, Augusto Ruibal wrote:

The thing is, this only happens when I use Passenger + Apache, it works fine on console, WEBrick and Passenger standalone.

The other thing is, I have a newer version that the code I'm having problems, I deployed in the same server, and I works fine, so there is also a problem with my older code, I think.

I having the sites running over Passenger standalone + Apache Proxy Pass, sucks a little but it does the job.

I only maintain a single version of Sphinx on my servers.

Let me if you find out something.

On Thu, Jan 10, 2013 at 1:53 AM, Pat Allan [email protected]

wrote:

Hi Augusto

Do you have any other versions of Sphinx installed? And is this error occurring locally, or on production? What webserver setup are you using? (Apache/Nginx/Pow/Mongrel/Webrick/Unicorn/etc...)

— Reply to this email directly or view it on GitHub< https://github.com/pat/riddle/issues/56#issuecomment-12080745>.

Augusto Ruibal

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub< https://github.com/pat/riddle/issues/56#issuecomment-12092687>.

Augusto Ruibal — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/pat/riddle/issues/56#issuecomment-12094048.

Augusto Ruibal

Shinta avatar Jan 10 '13 13:01 Shinta

What version of Riddle were you using previously to this issue/1.5.4?

pat avatar Jan 13 '13 22:01 pat

Tested using riddle (1.5.4, 1.5.3).

Shinta avatar Jan 14 '13 12:01 Shinta

But you had this working at some point, right? What version of Riddle were you running then?

On 14/01/2013, at 11:56 PM, Augusto Ruibal wrote:

Tested using riddle (1.5.4, 1.5.3). — Reply to this email directly or view it on GitHub.

pat avatar Jan 15 '13 00:01 pat

Sorry, I don't know :S, updated all my gems, oldest riddle I have is 1.5.3.

On Mon, Jan 14, 2013 at 9:25 PM, Pat Allan [email protected] wrote:

But you had this working at some point, right? What version of Riddle were you running then?

On 14/01/2013, at 11:56 PM, Augusto Ruibal wrote:

Tested using riddle (1.5.4, 1.5.3).

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/pat/riddle/issues/56#issuecomment-12247595.

Augusto Ruibal

Shinta avatar Jan 15 '13 15:01 Shinta

If the oldest version you have installed is 1.5.3, then perhaps that's the version that worked? Unless you regularly remove gems from your system that are no longer used? I'm not sure what could be tried next with this...

Is your Gemfile.lock file in your git repo? If so, the git history should detail what the older versions of Thinking Sphinx and Riddle that were working were.

pat avatar Jan 23 '13 07:01 pat

Closing as this ticket's been quiet for a month. If you hit the problem again (or someone else does) let me know.

pat avatar Feb 23 '13 02:02 pat

I ran into this problem and fixed it by adding sphinx's directory to PATH for the ruby script's environment

bts avatar Jun 24 '13 18:06 bts

I'm getting this problem with a remote sphinx server. It seems it still needs the indexer to be installed on the local app server as well?

Our config:

production:
  port: 3312
  address: 'remote-host'

levent avatar Jul 16 '13 10:07 levent

Hi Levent!

You'll want to specify the Sphinx version in config/sphinx.yml, so TS/Riddle loads the right versions of the protocol. Something along the lines of:

production:
  port: 3312
  address: 'remote-host'
  version: 2.0.4

pat avatar Jul 16 '13 11:07 pat

Hey Pat, I ran into this issue a couple of times again (today for example :D) and I fixed it by installing Sphinx in the server where my Rails app runs, It seems that the problem is that Riddle needs Sphinx installed. I have dedicated Sphinx servers, that's because I didn't installed it in the first place.

I'm sure you have the theory crafting explanation to this.

Keep your awesome work.

Thanks.

Shinta avatar Jul 25 '13 17:07 Shinta

That'll certainly do the trick - but having the version set to ensure Riddle loads the right versions of the protocol should do the trick as well.

When Riddle is required, it tries to determine which version of Sphinx is present, so it can communicate with it accordingly. Thinking Sphinx can pass through the version though, so that should do the trick. That said, if you're going down the path of installing Sphinx on the web servers too, just make sure it's the same version of Sphinx on all machines :)

pat avatar Jul 26 '13 05:07 pat