tag:support.flying-sphinx.com,2011-01-05:/discussions/problems/1988-connection-to-127001-on-9312-failedFlying Sphinx: Discussion 2016-08-11T01:31:03Ztag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-05T00:39:35Z2015-09-05T00:39:35ZConnection to 127.0.0.1 on 9312 failed.<div><p>Hi Jay</p>
<p>Did this work previously? Can you let me know what the name of
the app is? Also, I'd highly recommend at least updating to
thinking-sphinx 1.5.0 and flying-sphinx 1.2.0 (they should work
together).</p>
<p>Kind regards,</p>
<p>Pat</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-05T03:40:36Z2015-09-05T03:40:39ZConnection to 127.0.0.1 on 9312 failed.<div><p>Hi Pat,</p>
<p>I'm just being brought on to the project to replace the previous
developer. The name of the app is projectalert - accessible at
<a href="http://projectalert.com">http://projectalert.com</a>. As
far as I know it was operational previously - at the very least
prior to last evening when a small update was pushed up (just
replacing some image files).</p>
<p>I'll go ahead and update those gems - which should also
necessitate a Ruby version upgrade since it is currently running on
1.8.7.</p>
<p>I'll let you know once I've been able to do this, thanks!</p></div>Jay Liutag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-05T04:44:26Z2015-09-05T04:44:26ZConnection to 127.0.0.1 on 9312 failed.<div><p>Both of those gem versions should work on 1.8.7, if that makes
things easier (well, until Heroku forces you onto Cedar-14, where
1.9.3 is the minimum version of Ruby supported).</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-08T07:29:42Z2015-09-08T07:29:42ZConnection to 127.0.0.1 on 9312 failed.<div><p>Hi Pat,</p>
<p>I was able to get the gems for thinking-sphinx and flying-sphinx
updated to 1.5 and 1.2, respectively. Unfortunately I'm running
into the same issue and in addition, when I try to run <code>heroku
run rake fs:rebuild</code> I'm getting the following error:</p>
<p>Pusher : error : #></p>
<p>I've included openssl-nonblock in my Gemfile as well, is there
any guidance you can offer?</p>
<p>Thanks!</p></div>Jay Liutag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-08T07:35:57Z2015-09-08T07:35:57ZConnection to 127.0.0.1 on 9312 failed.<div><p>In addition, I'm getting the same error with all of the legacy
rake fs:* commands.</p>
<p>Thanks for your help.</p></div>Jay Liutag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-08T18:18:16Z2015-09-08T18:18:16ZConnection to 127.0.0.1 on 9312 failed.<div><p>Just to confirm: you're still seeing the read_nonblock error
with the openssl-nonblock in place? This is certainly unexpected.
Is adding me to the project to debug directly an option? (My Heroku
account is pat at freelancing-gods dot com). If it's not, that's
completely understandable… I'll ponder further about what
could be the cause…</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-08T18:23:32Z2015-09-08T18:23:32ZConnection to 127.0.0.1 on 9312 failed.<div><p>Also, it's worth noting that the daemon is running on Flying
Sphinx, and indexing calls have been coming through daily, so it
feels like this is very much an issue with the app and its
interaction with the Thinking Sphinx and Flying Sphinx gems. What's
in your <code>config/sphinx.yml</code> file for the relevant
environment (if the file doesn't exist, that's fine)? And are there
any initialisers mucking about with Thinking Sphinx settings?</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-08T18:30:58Z2015-09-08T18:30:58ZConnection to 127.0.0.1 on 9312 failed.<div><p>Yes, I'm still getting the read_nonblock error with the
openssl-nonblock in place. I just tried to run <code>rake
fs:index</code> and I got the following output:</p>
<pre>
<code>Executing Action: configure
SQL (0.7ms) SET client_min_messages TO 'panic'
SQL (0.7ms) SET standard_conforming_strings = on
SQL (0.6ms) SET client_min_messages TO 'notice'
rake aborted!
can't convert nil into String</code>
</pre>
<p>But the other actions, like :rebuild and :start both result in
the non_block error.</p>
<p>I totally agree with you about the app and its interaction, I'm
just not sure what to change to remedy this situation. The
<code>config/sphinx.yml</code> file is actually in .gitignore, so
I'm not 100% sure what's going on with it in the production
environment. From what I got from the previous developer it has the
following:</p>
<pre>
<code>production:
<<: *default
config_file: config/production.sphinx.conf
pid_file: log/searchd.production.pid
searchd_file_path: db/sphinx/production/
version: 1.10-beta</code>
</pre>
<p>As far as adding you to debug, I may have to ask the other
project staff since it is still in production.</p></div>Jay Liutag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-08T18:34:26Z2015-09-08T18:34:27ZConnection to 127.0.0.1 on 9312 failed.<div><p>Also, I don't think that there's any initializers messing with
Thinking Sphinx - at least I couldn't find any references to it in
the project aside from the #search method calls and the
indices.</p></div>Jay Liutag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-08T19:06:50Z2015-09-08T19:06:50ZConnection to 127.0.0.1 on 9312 failed.<div><p>Appreciate those details - nothing's jumping out as being
obviously wrong. Those settings in config/sphinx.yml shouldn't have
an impact (beyond the version, but that's fine, that one is
useful).</p>
<p>With the fs:index call failing - can you run it with
<code>--trace</code> and let me know what the full output is?</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-08T19:09:11Z2015-09-08T19:09:12ZConnection to 127.0.0.1 on 9312 failed.<div><p>Here's the full output:</p>
<pre>
<code>Running `rake fs:index --trace` attached to terminal... up, run.1394
(in /app)
** Invoke fs:index (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute fs:index
Executing Action: configure
SQL (0.8ms) SET client_min_messages TO 'panic'
SQL (0.7ms) SET standard_conforming_strings = on
SQL (0.6ms) SET client_min_messages TO 'notice'
rake aborted!
can't convert nil into String
/app/vendor/bundle/ruby/1.8/gems/multipart-post-2.0.0/lib/composite_io.rb:91:in `basename'
/app/vendor/bundle/ruby/1.8/gems/multipart-post-2.0.0/lib/composite_io.rb:91:in `initialize'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/gzipped_hash.rb:31:in `new'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/gzipped_hash.rb:31:in `gzip'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/gzipped_hash.rb:11:in `to_gzipped_hash'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/gzipped_hash.rb:11:in `each'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/gzipped_hash.rb:11:in `to_gzipped_hash'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/configuration_options.rb:19:in `gzipped_files_hash'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/configuration_options.rb:3:in `to_hash'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/controller.rb:20:in `configure'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/cli.rb:46:in `configure'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/cli.rb:29:in `send'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/cli.rb:29:in `run'
/app/vendor/bundle/ruby/1.8/gems/activesupport-2.3.15/lib/active_support/dependencies.rb:184:in `all?'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/cli.rb:27:in `each'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/cli.rb:27:in `all?'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/cli.rb:27:in `run'
/app/vendor/bundle/ruby/1.8/gems/flying-sphinx-1.2.0/lib/flying_sphinx/tasks.rb:4
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/app/vendor/ruby-1.8.7/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/app/vendor/bundle/ruby/1.8/gems/rake-0.8.7/bin/rake:31
/app/vendor/bundle/ruby/1.8/bin/rake:23:in `load'
/app/vendor/bundle/ruby/1.8/bin/rake:23</code>
</pre></div>Jay Liutag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-08T19:13:05Z2015-09-08T19:13:05ZConnection to 127.0.0.1 on 9312 failed.<div><p>Can you see if switching to flying-sphinx 1.0.0 helps at
all?</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-08T20:39:36Z2015-09-08T20:39:38ZConnection to 127.0.0.1 on 9312 failed.<div><p>Hey Pat,</p>
<p>I'm running into the same error with flying-sphinx 1.0.0 - both
the being unable to search (the original error) and getting the
NoMethodError on read_nonblock.</p>
<p>I've added you as a collaborator on the project, hopefully that
will help in diagnosing the issue, let me know if there's anything
I can help with / if you need more information.</p></div>Jay Liutag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-08T22:38:49Z2015-09-08T22:38:49ZConnection to 127.0.0.1 on 9312 failed.<div><p>I've no idea why this is the case, but it seems as if Flying
Sphinx is not being required, even though it's in the Gemfile and
config/environment.rb.</p>
<p>One way to work around this is to add an initializer that just
has <code>require 'flying_sphinx'</code> and see if that helps? I'm
hoping that resolves the wrong Sphinx address/port issue.</p>
<p>As for the openssl_nonblock - can you try putting that gem above
both of the Sphinx gems in both the Gemfile and
config/environment.rb? Of course, perhaps its not being required
either - so it wouldn't hurt adding a require statement for it to
the same initializer, before the one for flying_sphinx.</p>
<p>I've not made any commits to test these changes on the app
itself, but when I run <code>heroku run bundle exec
./script/console</code>, both <code>require 'flying_sphinx'</code>
and <code>require 'openssl_nonblock'</code> return true, indicating
they're not already loaded.</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-08T23:32:17Z2015-09-08T23:32:18ZConnection to 127.0.0.1 on 9312 failed.<div><p>I just put in the changes you recommended and it looks like
there's some progress. I'm no longer seeing the connection error,
but when the search is being executed I'm seeing:</p>
<p><code>Sphinx Caught Sphinx exception: undefined
method</code>collect' for nil:NilClass (0 tries left)`</p>
<p>I'm kind of assuming this is because I still need to run
<code>rake fs:rebuild</code> on the server, which I currently have
going now. If that's not the case let me know, either way I'll let
you know what I get after the rebuild finishes.</p></div>Jay Liutag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-08T23:33:39Z2015-09-08T23:33:39ZConnection to 127.0.0.1 on 9312 failed.<div><p>I would presume it's related to the rebuild that you're
currently running. Let me know how it's behaving once the rebuild
is finished :)</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-09T01:14:43Z2015-09-09T01:14:47ZConnection to 127.0.0.1 on 9312 failed.<div><p>It looks like some of the tasks I'm trying to run are timing
out. I started running <code>rake fs:rebuild</code> and it seemed
like it wasn't moving or doing anything (about an hour). I aborted
the task and tried both <code>rake fs:index</code>, <code>rake
fs:start</code> and even <code>rake fs:stop</code> and both
returned this output:</p>
<p><code>Action timed out. If this is happening regularly, please
contact Flying Sphinx support:
http://support.flying-sphinx.com</code></p>
<p>Both had the 'Executing Action: *' and 'Action Finished: *`
preceding the time out message.</p>
<p>Thanks again for all of your help, Pat!</p></div>Jay Liutag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-09T01:31:19Z2015-09-09T01:31:19ZConnection to 127.0.0.1 on 9312 failed.<div><p>So, since flying-sphinx 1.0, websockets are used instead of
polling to track when a task has finished. Annoyingly, it looks
like it’s flaky with 1.8.7, even with openssl_nonblock (it
would generally work for me in the past, but now it seems almost
never. <em>sigh</em>)</p>
<p>So, can you try downgrading to flying-sphinx 0.7.1 (from memory,
the 0.8.x releases weren’t 1.8.7-friendly) and see how things
go from there?</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-09T05:29:15Z2015-09-09T05:29:16ZConnection to 127.0.0.1 on 9312 failed.<div><p>Pat, you are amazing. It's back into working order. I'm working
on an upgrade of this application at this point anyway - but the
project wanted this bit operational for the time being.</p>
<p>Thanks for all of your help.</p></div>Jay Liutag:support.flying-sphinx.com,2011-01-05:Comment/378514852015-09-09T05:31:13Z2015-09-09T05:31:13ZConnection to 127.0.0.1 on 9312 failed.<div><p>I’m very glad we got there - shame about the frustrating
bugs along the way (especially the gems not being required - that
is super odd!)</p>
<p>Good luck with the upgrades :)</p></div>Pat Allan