sql_connect: could not connect to server: Connection timed out

Son Tran's Avatar

Son Tran

24 Mar, 2012 01:40 AM

Hi,
I set up our app on Heroku, basic shared database, but when indexing we ran into this problem

Sphinx 1.10-beta (r2420)
Copyright (c) 2001-2010, Andrew Aksyonoff
Copyright (c) 2008-2010, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/mnt/sphinx/flying-sphinx/e1823e2399336dcaf/sphinx.conf'...
indexing index 'listing_core'...
ERROR: index 'listing_core': sql_connect: could not connect to server: Connection timed out

Is the server running on host "ec2-107-20-190-94.compute-1.amazonaws.com" (10.96.73.167) and accepting
TCP/IP connections on port 5432?

(DSN=pgsql://ecwbvzzkvd:***@ec2-107-20-190-94.compute-1.amazonaws.com:54...). total 0 docs, 0 bytes
total 193.442 sec, 0 bytes/sec, 0.00 docs/sec
.....

Do you have any idea why this happens?
Thanks a lot
Son Tran

  1. Support Staff 2 Posted by Pat Allan on 24 Mar, 2012 01:47 AM

    Pat Allan's Avatar

    Hi Son

    Are you using the default Heroku shared database, or their shared database add-on? And when you run heroku config --long, what are all the variables that start with FLYING_SPHINX?

    Cheers

    Pat

  2. 3 Posted by Son Tran on 24 Mar, 2012 02:00 AM

    Son Tran's Avatar

    Hi Pat,
    We are using a default Heroku shared database but not sure it come from add-on or not

    => 80965a7398485d93a
       => ec2-23-20-44-208.compute-1.amazonaws.com
    

    => e1823e2399336dcaf

    => false
       => 9335
    

    At some point, we change FLYING_SPHINX_INGRESS to true, and tried to reindex, but the errors were the same
    Thx
    SOn

  3. Support Staff 4 Posted by Pat Allan on 24 Mar, 2012 02:03 AM

    Pat Allan's Avatar

    If it's the default, it's not an add-on - so, what you really want is FLYING_SPHINX_INGRESS not set at all:

    heroku config:remove FLYING_SPHINX_INGRESS
    

    Give that a shot, let me know how you go.

  4. 5 Posted by Son Tran on 24 Mar, 2012 02:12 AM

    Son Tran's Avatar

    That works! Thanks a lot

    But we run into this problem
    using config file '/mnt/sphinx/flying-sphinx/e1823e2399336dcaf/sphinx.conf'...
    indexing index 'listing_core'...
    collected 100 docs, 0.0 MB
    sorted 0.0 Mhits, 100.0% done
    total 100 docs, 23930 bytes
    total 0.381 sec, 62734 bytes/sec, 262.16 docs/sec
    skipping non-plain index 'listing'...
    indexing index 'user_core'...
    ERROR: index 'user_core': sql_range_query: ERROR: function crc32(character varying) does not exist
    LINE 1: ..."class_crc", array_to_string(array_accum(COALESCE(crc32("pos...

                                                             ^
    

    HINT: No function matches the given name and argument types. You might need to add explicit type casts.
    (DSN=pgsql://ecwbvzzkvd:***@127.0.0.1:10335/ecwbvzzkvd).

    I understand that there is some problem with crc32 vs Heroku psql -- Any suggestion to get around this problem would be appreciated
    Thx
    Son

  5. Support Staff 6 Posted by Pat Allan on 24 Mar, 2012 02:19 AM

    Pat Allan's Avatar

    The issue is that you can't have fields or string attributes being facets - if you can share your define_index block for the model, we can see if there's some options to work around it. Of course, if you don't need those attributes or fields as facets, then just remove the facet setting and it should be fine.

  6. 7 Posted by Son Tran on 24 Mar, 2012 02:32 AM

    Son Tran's Avatar

    Thanks a lot Pat. Really appreciate your help. We'll try to use Amazon RDS to get round this problem first.

  7. Support Staff 8 Posted by Pat Allan on 24 Mar, 2012 02:34 AM

    Pat Allan's Avatar

    No worries. The other MySQL add-ons should work fine as well, if you find them to be more reasonably priced.

Reply to this discussion

Internal reply

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

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

Generic

? 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