tag:support.flying-sphinx.com,2011-01-05:/discussions/problems/1870-connection-failureFlying Sphinx: Discussion 2016-08-11T01:31:08Ztag:support.flying-sphinx.com,2011-01-05:Comment/367399752015-05-04T04:20:37Z2015-05-04T04:20:37ZConnection failure<div><p>Hi Matt</p>
<p>The Flying Sphinx gem should indeed pick up the environment
variables. I'm a little surprised why it currently isn't doing that
for you. I presume the environment vars <em>are</em> set? (There
should be four - api key, host, identifier, port.)</p>
<p>And I presume restarting the app hasn't helped fix this
either?</p>
<p>Kind regards,</p>
<p>Pat</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/367399752015-05-04T04:28:06Z2015-05-04T04:28:07ZConnection failure<div><p>Yes, <code>FLYING_SPHINX_API_KEY</code>,
<code>FLYING_SPHINX_HOST</code>,
<code>FLYING_SPHINX_IDENTIFIER</code>, and
<code>FLYING_SPHINX_PORT</code> are all set. And yes, I've tried
restarting the app.</p>
<p>It's puzzling that I can run <code>flying-sphinx</code> commands
successfully (which presumably read from these same environment
variables), but when I run the app, Thinking Sphinx tries to
connect to <code>127.0.0.1</code>.</p>
<p>Any ideas?</p></div>Matt Olsontag:support.flying-sphinx.com,2011-01-05:Comment/367399752015-05-04T04:31:44Z2015-05-04T04:31:44ZConnection failure<div><p>Would it be possible for you to add me to the app to debug
directly? My Heroku account is <a href="mailto:pat@freelancing-gods.com">pat@freelancing-gods.com</a>.</p>
<p>If this is not an option, that's completely understandable...
I'll keep pondering either way.</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/367399752015-05-04T04:48:15Z2015-05-04T04:48:16ZConnection failure<div><p>Sorry, Pat, but I don't think I can do that.</p>
<p>However, here's another mystery: I just restarted the app after
switching from Github master for Flying Sphinx to the 1.2.0 gem,
and got this instead:</p>
<pre>
<code>2015-05-04T04:46:11.001853+00:00 app[web.1]: ThinkingSphinx::SphinxError (Lost connection to MySQL server at 'reading authorization packet', system error: 0 - SELECT * FROM `title_core` WHERE MATCH('@full_title hayy') AND `sphinx_deleted` = 0 ORDER BY `full_title` ASC LIMIT 0, 20; SHOW META):</code>
</pre></div>Matt Olsontag:support.flying-sphinx.com,2011-01-05:Comment/367399752015-05-04T04:50:33Z2015-05-04T04:50:33ZConnection failure<div><p>Definitely best to stick to the 1.2.0 release for the moment,
instead of the latest in master. That error is perhaps a little
more promising - though it indicates Sphinx isn't running on the
Flying Sphinx side of things (and from what I can see, it is). Will
dive deeper on the servers to see what might be going wrong.</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/367399752015-05-04T04:53:10Z2015-05-04T04:53:11ZConnection failure<div><p>OK, good to know. I think things are working now! Did you do
something on your side? This sequence of events is mysterious to
me...</p></div>Matt Olsontag:support.flying-sphinx.com,2011-01-05:Comment/367399752015-05-04T04:57:28Z2015-05-04T04:57:28ZConnection failure<div><p>I hadn't even got to SSH'ing into the server! But here's my
thinking:</p>
<ul>
<li>There must be a bug in master since the 1.2.0 release of the
flying-sphinx gem.</li>
<li>The very first connection hits the Sphinx proxy on the
appropriate Flying Sphinx server, which hasn't seem these
credentials before. It drops that connection, but also
asynchronously updates expected credentials.</li>
<li>Hence, further search requests are working, because the
credentials are now cached.</li>
</ul>
<p>Great to have it working now... I'll see if I can fix whatever
the bug in recent commits is.</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/367399752015-05-04T05:13:04Z2015-05-04T05:13:04ZConnection failure<div><p>OK, sounds like a plan.</p>
<p>On another note, while I have your attention... :)</p>
<p>I'm planning to upgrade another instance from Flying Sphinx
0.8.4 to 1.2.0 and Thinking Sphinx 2.0.13 to 3.1.3. (The instance
in the original post is a new staging server to test the changes.)
Apart from <code>flying-sphinx rebuild</code>, are there any other
steps I should take when pushing this change? I've already made any
code changes, such as moving the index definition from the model to
<code>app/indices</code>. Everything seems to be working now on
staging, just wondering if there are any gotchas from the Flying
Sphinx side of things if I upgrade the gems.</p>
<p>Thanks,<br>
Matt</p></div>Matt Olsontag:support.flying-sphinx.com,2011-01-05:Comment/367399752015-05-04T05:46:05Z2015-05-04T05:46:05ZConnection failure<div><p>Hi Matt</p>
<p>I presume you’ve got config/thinking_sphinx.yml using a
modern version of Sphinx? 2.1.x is certainly recommended -
available versions are listed here: <a href="http://support.flying-sphinx.com/kb/configuration/setting-your-sphinx-version">
http://support.flying-sphinx.com/kb/configuration/setting-your-sphi...</a>
<a href="http://support.flying-sphinx.com/kb/configuration/setting-your-sphinx-version">
http://support.flying-sphinx.com/kb/configuration/setting-your-sphinx-version</a></p>
<p>I’d expect the flow to be:<br>
* deploy code that include the gem updates * run Sphinx rebuild *
Maybe see a single error message post-rebuild, like previously? *
All fine from that point onwards.</p>
<p>I wouldn’t expect anything to go particularly pear-shaped,
but happy to be on hand if it’s your evening when you roll it
all out.</p>
<p>Cheers</p>
<p>—<br>
Pat</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/367399752015-05-07T05:00:56Z2015-05-07T05:00:57ZConnection failure<div><p>Hey Pat,</p>
<p>FYI, I just upgraded TS and FS without a hitch, just did a
rebuild after deploy and everything went smoothly.</p>
<p>Thanks,<br>
Matt</p></div>Matt Olsontag:support.flying-sphinx.com,2011-01-05:Comment/367399752015-05-07T05:02:06Z2015-05-07T05:02:06ZConnection failure<div><p>Great to hear :)</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/367399752015-05-08T11:11:22Z2015-05-08T11:11:22ZConnection failure<div><p>Hi Matt</p>
<p>Just spending some time trying to reproduce your initial issue,
but no luck yet. Which version of Rails are you using?</p>
<p>Thanks</p>
<p>Pat</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/367399752015-05-08T14:31:19Z2015-05-08T14:31:20ZConnection failure<div><p>I was using 3.2.16</p></div>Matt Olsontag:support.flying-sphinx.com,2011-01-05:Comment/367399752015-05-09T02:07:01Z2015-05-09T02:07:01ZConnection failure<div><p>I was on 3.2.18, switched down to 3.2.16, still no issues. My
Gemfile in this test app is pretty simple: <a href="https://gist.github.com/pat/081500cf3cd6c30f8140">https://gist.github.com/pat/081500cf3cd6c30f8140</a></p>
<p>I'm at a loss as to what's causing the problem... possibly
another gem in your Gemfile was getting in the way? Though I really
don't get how that could be the case (and I don't think there have
been any changes in the way FS works with TS since 1.2.0 was
released anyway). At this point, I'm considering this issue as
unreproduceable - which is frustrating, but hopefully if it does
crop up for anyone else, I'll hear about it and can see if the
extra data points help.</p>
<p>Appreciate your patience with all of this Matt - and at least
things have been working smoothly for you since switching to the
1.2.0 release.</p></div>Pat Allan