I just discovered that the search functionality on my web site doesn’t work. Going through some logs, I find this:
unicorn.stdout.log: (…) Error connecting to Sphinx via the MySQL protocol. Error connecting to Sphinx via the MySQL protocol. Can’t connect to MySQL server on ‘127.0.0.1’ (…)
production.searchd.log: (…) [Sat Mar 24 01:56:16.713 2018] [27459] rotating indices (seamless=1) [Sat Mar 24 01:56:16.730 2018] [27459] rotating index ‘listing_delta’: started [Sat Mar 24 01:56:16.738 2018] [27459] rotating index ‘listing_delta’: success [Sat Mar 24 01:56:16.738 2018] [27459] rotating index: all indexes done [Tue Mar 27 10:28:26.365 2018] [27459] caught SIGTERM, shutting down [Tue Mar 27 10:28:26.926 2018] [27459] shutdown complete <and then nothing after March 27th>
I’m trying rake ts:restart, reindex, stop, start etc, but then I get error messages like this: rake aborted! ActiveRecord::AdapterNotSpecified: ‘development’ database is not configured. Available: [“production”] /path/to/file/environment.rb:17:in `<top (required)>’ Tasks: TOP => ts:index => environment
Everything worked fine before, but all of a sudden this search eror started to occur, and since the last line in the searhd log file is dated March 27, I suspect the behaviour is related to the upgrade.
Any hints on steps to resolve it?
Website: https://hengerdeling.no
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
I am not sure about Sphinx but if you are trying to restart, you may need to specify the Rails environment when calling the rake CLI: RAILS_ENV=production bundle exec rake ts:reindex
Edit: or something similar with whatever is expected in the rake task.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.