getaddrinfo: Error: getaddrinfo: Servname not supported for ai_socktype

Hassan Abdul Rehman's Avatar

Hassan Abdul Rehman

20 May, 2014 03:59 AM

As Per Request, posting it here:


Found the similar issue here:
The conversation doesnt end conclusively.

Very rarely, but i see this issue when trying to update an attribute of a model that has indexes defined on it. This crashes causing the object to NOT be saved.

here's the last few lines of the trace:
Please ignore the timestamps and the process. This is on heroku and my process is called clock.1.

154 1 2014-05-19T10:05:07.043719+00:00 app clock.1 - - Error: getaddrinfo: Servname not supported for ai_socktype
184 1 2014-05-19T10:05:07.043721+00:00 app clock.1 - - /app/vendor/bundle/ruby/1.9.1/gems/riddle-1.5.3/lib/riddle/client.rb:575:in initialize' 177 1 2014-05-19T10:05:07.043722+00:00 app clock.1 - - /app/vendor/bundle/ruby/1.9.1/gems/riddle-1.5.3/lib/riddle/client.rb:575:innew'
191 1 2014-05-19T10:05:07.043724+00:00 app clock.1 - - /app/vendor/bundle/ruby/1.9.1/gems/riddle-1.5.3/lib/riddle/client.rb:575:in initialise_socket' 199 1 2014-05-19T10:05:07.043726+00:00 app clock.1 - - /app/vendor/bundle/ruby/1.9.1/gems/riddle-1.5.3/lib/riddle/0.9.9/client.rb:8:ininitialise_connection'
185 1 2014-05-19T10:05:07.043728+00:00 app clock.1 - - /app/vendor/bundle/ruby/1.9.1/gems/riddle-1.5.3/lib/riddle/client.rb:501:in open_socket' 181 1 2014-05-19T10:05:07.043729+00:00 app clock.1 - - /app/vendor/bundle/ruby/1.9.1/gems/riddle-1.5.3/lib/riddle/client.rb:538:inconnect'
181 1 2014-05-19T10:05:07.043740+00:00 app clock.1 - - /app/vendor/bundle/ruby/1.9.1/gems/riddle-1.5.3/lib/riddle/client.rb:625:in request' 180 1 2014-05-19T10:05:07.043742+00:00 app clock.1 - - /app/vendor/bundle/ruby/1.9.1/gems/riddle-1.5.3/lib/riddle/client.rb:423:inupdate'
229 1 2014-05-19T10:05:07.043743+00:00 app clock.1 - - /app/vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-2.0.11/lib/thinking_sphinx/active_record/attribute_updates.rb:44:in update_index' 249 1 2014-05-19T10:05:07.043745+00:00 app clock.1 - - /app/vendor/bundle/ruby/1.9.1/gems/thinking-sphinx-2.0.11/lib/thinking_sphinx/active_record/attribute_updates.rb:23:inblock in update_attribute_values'

i'm using:
ruby 1.9.2p320 (2012-04-20 revision 35421)
Rails 3.2.3
flying-sphinx (0.8.4)
thinking-sphinx (2.0.11)


  1. Support Staff 1 Posted by Pat Allan on 20 May, 2014 04:50 AM

    Pat Allan's Avatar

    Thanks Hassan - also, one more bit of useful information: what's the name of your app on Heroku?

  2. 2 Posted by Hassan Abdul Re... on 20 May, 2014 05:09 AM

    Hassan Abdul Rehman's Avatar

    my heroku app is called 'hedgepo'. In the config:


    We'll move this conversation to private if you want api-key and identifier.

    Let me know what else you need.

  3. Support Staff 3 Posted by Pat Allan on 20 May, 2014 10:57 AM

    Pat Allan's Avatar

    Your app name is enough for me to get the rest of the details... but the host is what I was particularly curious about (some hosts in the system are IPs, some are domains). It turns out that with v3 of the API, you're receiving the latter, even though the environment variable (which is a fallback should the Flying Sphinx API be down) is an IP address.

    I've just changed your specific server to use the IP address consistently. When you have a chance, restart your app, and see how things behave from that point on. Googling the specific error message doesn't confirm that it's DNS related, but I think we'll start there (partially because I'm not currently sure what other steps are possible).

    For the record, v4 of the API is used by the flying-sphinx gem since v1.0.0, and is more reliable across the board (it uses websockets instead of polling). I'm currently working on v5, which will be even better :)

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac