Closed mauro-ni closed 3 years ago
Hi Mauro
This is a bit of a mystery bug! I'm not really sure what the cause is… but I guess my one thought thus far is: has Sphinx been compiled with MySQL support? And especially, against MySQL v5.7? I know it seems likely, given you're using MySQL 5.7, but given the issue seems to be tied to connecting to Sphinx itself, that's my first guess.
And unfortunately, it's difficult to tell whether Sphinx has such support compiled. There's no flag to run one of the binaries with to check. So: how did you install Sphinx in this docker image?
Hi Pat, many thanks for your replay.
My development environment is based on Docker, I have to images:
From second container:
$ mysql --version
mysql Ver 14.14 Distrib 5.7.34, for Linux (x86_64) using EditLine wrapper
This setup worked with ruby 2.6.x, but now that I upgraded to ruby 3.0.2 and thinking-sphinx 5.2.1 it doesn't work anymore. Is this related to the thinking_sphinx.yml configuration file? Or maybe to the mysql container (do I have to expose ports other than the classic 3306)?
Many thanks in advance.
Mauro
Hmm. Can you check whether any other versions of the MySQL client libraries are installed? I'm wondering if Sphinx or mysql2 got compiled against the wrong version.
It's just that I've only seem these ambiguous errors due to incorrect MySQL versions (usually via the client libraries).
I don't think it's anything to do with the MySQL container or ports - it's not an issue with talking to your database, but rather talking to Sphinx. Sphinx uses the MySQL protocol for communications with its daemon, hence the importance of the MySQL client library. (i.e. this can also be an issue with the MySQL client library even when using PostgreSQL for your app's database)
@pat many thanks for your help.
I carefully checked my Docker file and I finally managed to solve the problem: the problem was related to the libmysqlclient-dev package that was installed through apt-get command.
I now install MySQL related packages through specific .deb packages download from MySQL web site. I provide the relevant part of my Dockerfile as it could be useful to others.
# OTHER STUFF HERE
##########################################################################
# update/upgrade system and install missing libraries
##########################################################################
RUN apt-get update && \
apt-get upgrade -y -o Dpkg::Options::="--force-confold" && \
apt-get install -qq -y imagemagick nano rsync git-extras tzdata nfs-common shared-mime-info wget libaio1 libtinfo5 libnuma1 --fix-missing --no-install-recommends && \
apt remove -y libmysqlclient-dev && \
apt autoremove -y
RUN wget https://downloads.mysql.com/archives/get/p/23/file/mysql-common_5.7.34-1ubuntu18.04_amd64.deb && \
dpkg -i mysql-common_5.7.34-1ubuntu18.04_amd64.deb && \
rm mysql-common_5.7.34-1ubuntu18.04_amd64.deb
RUN wget https://downloads.mysql.com/archives/get/p/23/file/mysql-community-client_5.7.34-1ubuntu18.04_amd64.deb && \
dpkg -i mysql-community-client_5.7.34-1ubuntu18.04_amd64.deb && \
rm mysql-community-client_5.7.34-1ubuntu18.04_amd64.deb
RUN wget https://downloads.mysql.com/archives/get/p/23/file/libmysqlclient20_5.7.34-1ubuntu18.04_amd64.deb && \
dpkg -i libmysqlclient20_5.7.34-1ubuntu18.04_amd64.deb && \
rm libmysqlclient20_5.7.34-1ubuntu18.04_amd64.deb
RUN wget https://downloads.mysql.com/archives/get/p/23/file/libmysqlclient-dev_5.7.34-1ubuntu18.04_amd64.deb && \
dpkg -i libmysqlclient-dev_5.7.34-1ubuntu18.04_amd64.deb && \
rm libmysqlclient-dev_5.7.34-1ubuntu18.04_amd64.deb
# OTHER STUFF HERE
Ah, fantastic to hear you found the issue and got it fixed :) Thanks for sharing the Docker details too!
Hi folks, I have a problem with thinking-sphinx 5.2.1 and a docker based development env based on passenger-docker (https://github.com/phusion/passenger-docker) & mysql 5.7. I'm using the gem mysql2 version 0.5.3
This is my thinking_sphinx.yml used to generate the file config/development.sphinx.conf
This is what I get on index rebuild
Many thanks in advance for your help.
Mauro