[MDEV-25892] cannot INSTALL SONAME 'ha_sphinx'; Created: 2021-06-10 Updated: 2021-06-16 Resolved: 2021-06-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Plugins |
| Affects Version/s: | 10.4.18 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Karl Klepper | Assignee: | Daniel Black |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | alpine, docker, sphinx | ||
| Environment: |
docker alpine |
||
| Description |
|
I have a 10.1.26 docker alpine container based on a previous version of Johan Bergström working with sphinx (on docker hub kklepper/mariadb33). In order to upgrade, I adopted the new version of Johan (kklepper/mariadb33-10.4.18) in which I cannot activate the sphinx plugin:
Unfortunately, this plugin is crucial for my application, so I have to fix this. The error message is enigmatic for me, however, and I have no idea of how to debug this. I added ha_sphinx.so to /usr/lib/mariadb/plugin/ manually. The original file is indeed present at the given path and file privileges do not matter. The former image features 36 plugins. I had to manually add ha_sphinx.so in previous versions, so I guess the appropriate alpine package had been augmented. What can I do to resolve this problem? Is it a problem of MariaDB or of the alpine package involved? |
| Comments |
| Comment by Karl Klepper [ 2021-06-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I told Johan Bergstroem about this and he wrote: "This is probably not a bug, just a consequence of shaving off bytes." I tested this hypothesis – indeed he shaves off all plugins, which would be ok as ha_sphinx.so is not among them anyway. If I prevent deletion of what he deems to be dispensable I still get this same error. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2021-06-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
If you use the official docker library it include a few extra bytes including a working ha_sphinx.so that you require.
I did need to install it twice, The first error cases 2021-06-11 13:39:54 8 [Warning] Plugin 'SPHINX' is of maturity level gamma while the server is stable The relocation error is due to a mixing of the sphinxse and a different mariadb version. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Karl Klepper [ 2021-06-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you. I used INSTALL SONAME 'ha_sphinx'; twice with no difference. As far as I remember I had a bad time finding ha_sphinx.so and it is very probably that this file is outdated. Where can I find a current version? Googling brought me https://www.rpmfind.net/linux/rpm2html/search.php?query=ha_sphinx.so()(64bit) with 10.0.x versions only (probably not only the .so file). Is that the right one? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2021-06-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Set plugin_maturity=gamma in your configuration. Google copy/paste/no analysis/move file X will just end in tears like where you started. Look at log files. Read and understand. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Karl Klepper [ 2021-06-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you very much. / # ls -latr /usr/lib/mariadb/plugin/ mysql.err 2021-06-11 18:30:21 0 [ERROR] mysqld: Can't open shared library '/usr/lib/mariadb/plugin/ha_sphinx.so' (errno: 0, Error relocating /usr/lib/mariadb/plugin/ha_sphinx.so: _ZNK30Type_handler_hybrid_field_type26get_handler_by_result_typeE11Item_r) Hope that helps. What more am I to read and understand? I installed the latest mariadb on CentOS 8
It is GPL v2 licensed, which means you can use the it free of charge under the MariaDB documentation can be found at https://mariadb.com/kb
SHOW plugins delivers 68 entries, no sphinx Now what? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Karl Klepper [ 2021-06-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Surprise: What do I learn from this with respect to docker? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Karl Klepper [ 2021-06-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
show plugins;
------------------------------ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Karl Klepper [ 2021-06-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Interestingly, there is no plugin subdirectory of /usr/lib/mariadb. Instead, ha_sphinx.so is placed in this directory now and it is the same I already own. From this I conclude this file is produced on the fly. If so, why the error message to being with? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Karl Klepper [ 2021-06-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I'm sorry, I have to correct myself. Looking again, everything is as expected. MariaDB [(none)]> SHOW VARIABLES LIKE '%plu%';
----------------
---------------- I don't think I hallucinated back 3 hours ago and don't have an explanation for this. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Karl Klepper [ 2021-06-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Well, look twice: it is lib64, not lib and mysql, not mariadb, which is somehow not quite consistent:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2021-06-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Use docker logs container_name to view the logs from any container. RPMs package things slightly different to the Ubuntu focal that is the basis for the Docker Library mariadb contains. I'm not going to advise on anything apart from the Docker Library mariadb container that I largely got working in 3 minutes. For a bug report this is quite unfocused as to what you are using from where. Collect your thoughts and focus a bit more and write clearly. If this is still a mess next week when I look at it gain it will be closed. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Karl Klepper [ 2021-06-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thorough investigatio, as best I can: 10.5.10 on host:
As we have no arguments, the following is built in: MariaDB [(none)]> SHOW VARIABLES LIKE '%plu%';
----------------
---------------- I don't think I hallucinated back 3 hours ago and don't have an explanation for this. Well, look twice: it is lib64, not lib and mysql, not mariadb, which is somehow not quite consistent:
So this was an insight from 10.5.10 on host: There is no /usr/lib/mariadb/plugin, but /usr/lib64/mysql/plugin/ has all the files, and additionally /usr/lib/mariadb/ has the installed plugin. Maybe it is just a hickup in renaming things. Let's try and define the plugin_dir. In the Dockerfiles, I made sure I created the directory /usr/lib64/mariadb/plugin and copied ha_sphinx.so to this folder, then changed my.cnf and added plugin_dir=/usr/lib64/mysql/plugin/. This did not help for 10.4.18, though: M:2521920 [(none)]>select version();
---------------------
--------------------- M:2521920 [(none)]>SHOW VARIABLES LIKE 'plu%';
----------------
---------------- M:2521920 [(none)]>INSTALL SONAME 'ha_sphinx'; This is the same error I had before and I get it with 10.5.9 as well. If I omit the plugin_dir directive, plugin_dir = /usr/lib/mariadb/plugin/, but it makes no difference. So for me this is proof it is not a docker or container definition problem. I will test with 10.4 if I can. Well, I cannot. I removed 10.5, installed 10.4, started, but got an error.
I give up for now. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Karl Klepper [ 2021-06-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Well, stackoverflow came to the rescue: first rm -rf /var/lib/mysql, too.
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> select version();
-----------------
----------------- MariaDB [(none)]> SHOW VARIABLES LIKE '%plu%';
----------------
---------------- MariaDB [(none)]> INSTALL SONAME 'ha_sphinx'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Karl Klepper [ 2021-06-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Johan Bergstroem just mailed me: As I mentioned previously, I think this is by design (not a bug, but intentional). I believe you have the answer here: https://git.alpinelinux.org/aports/tree/main/mariadb/APKBUILD#n162. So the Alpine-maintainer of MariaDB is in charge? Do I understand correctly the Alpine compiles MariaDB without Sphinx? The error message is by MariaDB, not Alpine, right? And it would be triggered by the omission in the build process? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2021-06-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
> So the Alpine-maintainer of MariaDB is in charge? Yes. > Do I understand correctly the Alpine compiles MariaDB without Sphinx? Yes. > The error message is by MariaDB, not Alpine, right? ":errno: 13, Error relocating" is caused by copying around a file that is tightly coupled build process and mariadb version and the dynamic loader not handling it. > And it would be triggered by the omission in the build process? Its triggered by YOU, who ignored "Google copy/paste/no analysis/move file X will just end in tears like where you started". Stop using alpine based containers for sphinxse. It obviously doesn't work. The reasons the official docker image isn't alpine is it isn't actually tested prior to release (https://github.com/MariaDB/mariadb-docker/pull/343), though the alpine maintainers run some tests. The reasons the official Docker Library mariadb does actually work is because it has sphinx as part of the image already. Very simple:
Replacing podman with docker in the above is exactly the same. Final notes:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Karl Klepper [ 2021-06-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you very much for your patience. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Karl Klepper [ 2021-06-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I managed to update my system to use the official mariadb container with little effort. Thank you for your persistent support and detailed teaching. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2021-06-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Glad to hear you managed the migration. If you are stuck trying to achieve something take note of the "Where to get help" in the Quick Reference https://hub.docker.com/_/mariadb. Do report bugs/feature requests with the official container here. Happy MariaDBing. |