Crash when starting searchd

Issue #1086 resolved
Waldemar Hamm created an issue

Hello Janos,

for some reason, when I visited one of my piler instances I saw

Error: SQLSTATE[HY000] [2002] Connection refused on database: sphinx

I tried running searchd manually and saw this:

Any idea what I could try? Do you need more infos?

Comments (23)

  1. Janos SUTO repo owner

    Hello Waldemar, yes, I need more info: what has changed on the host? It looks like you have a sphinx 2.2.x compatible sphinx.conf file, but you are running sphinx-3.2.1.

  2. Waldemar Hamm reporter

    Hello Janos,

    thank you very much for replying.

    I can’t remember why I did it then but I upgraded from Sphinx 2 to Sphinx 3.1.1 at some point. It worked flawlessly for at least a few days after that tho.

    This happened in June 2019 from what I can gather on the file date.

    I don’t think I did anything else than that.

    EDIT: Other than trying Sphinx 3.2.1 the other day which didn’t help.

  3. Waldemar Hamm reporter

    We’re getting closer.

    I think that sph stuff is from Sphinx 3.X Can I revert those indices somehow? Maybe with reindex -a?

  4. Waldemar Hamm reporter

    Running reindex and indexer.delta.sh at least the dailydelta and delta indices work again.

    Sadly indexer.main.sh doesn’t work since it fails to merge dailydelta1 due to mismatching sph version. (All the main indices are still on a sph version from a newer sphinx binary…)

    Is there some way to completely recreate the index?

  5. Janos SUTO repo owner

    Well, I suggest to stop search, remove all index files under /var/piler/sphinx, then install sphinx-3.2.1, and make sure, sphinx.conf has the proper SPHINX_VERSION settings.

    Then run indexer --all --config /usr/local/etc/piler/sphinx.conf to initialize the index data. And run reindex -a. Then the cron jobs take care of the rest.

  6. Waldemar Hamm reporter

    Where exactly do I find the SPHINX_VERSION setting? I don’t seem to have it in my sphinx.conf 😞

  7. Waldemar Hamm reporter

    I’ll follow these steps from the postinstall and see if it helps now:

    # cp etc/sphinx.conf.in /usr/local/etc/piler/sphinx.conf
    # chmod +x /usr/local/etc/piler/sphinx.conf
    # su - piler
    $ indexer --all --config /usr/local/etc/piler/sphinx.conf
    

  8. Waldemar Hamm reporter

    Yeah, I copied the sphinx.conf.in from the etc folder in the files used for the upgrade.

    I changed the SPHINX_VERSION, localstatedir and mysql credentials.

    indexer --all --config

    and

    reindex -a

    is running now.

    Will also run indexer.delta.sh and indexer.main.sh afterwards.

    Will tell you how it went. Thanks a lot!

  9. Waldemar Hamm reporter

    After doing the above everything seems to have went through.

    I got a HTTP 500 at first but it seemed that the config-site.php was overwritten. I replicated it and now it seems that everything’s running again.

    I hope this issue is a help to others that may face the same problem.

    Thanks for accompanying me on my way to success Janos.

  10. Waldemar Hamm reporter

    Hey Janos,

    one thing makes me wonder now, though.

    I only see mails from since I “repaired” sphinx now in the piler web GUI.

    Any idea what might be the issue?

  11. Janos SUTO repo owner

    Connect to searchd with

    mysql -h 127.0.0.1 -P9306
    

    then run

    select * from main1,dailydelta1,delta1;
    

    What IDs do you get?

  12. Janos SUTO repo owner

    Indeed you miss anything before 159661. Do the following. Run

    cd /tmp
    reindex -f 1 -t 100
    su -c /usr/local/libexec/piler/indexer.delta.sh piler
    

    Then check the previous query again. It should display from 1 to 20.

  13. Waldemar Hamm reporter

    Yes I can see IDs 1 to 20 now.

    If reindex did the trick, I don’t understand why, though. I did a reindex -a before doing indexer.delta.sh and indexer.main.sh 😞

    What should I do now to get all the mails again?

  14. Janos SUTO repo owner

    Not sure why. Anyway, repeat this process from 101 to 159660. Perhaps in 10k batches, eg. 101-10000, then 10001-20000, etc.

  15. Waldemar Hamm reporter

    I don’t know why but reindex -a and indexer.delta.sh did the trick this time.

    Was it wrong to run indexer.main.sh afterwards when I did this before?

  16. Log in to comment