Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to run mumble_server-1.4.230.x64.linux static binary on headless Debian Bullseye - needs libmysqlclient.so.21 #5522

Closed
JedMeister opened this issue Jan 26, 2022 · 4 comments
Labels
feature-request This issue or PR deals with a new feature triage This issue is waiting to be triaged by one of the project members

Comments

@JedMeister
Copy link

JedMeister commented Jan 26, 2022

Context

Apologies if here isn't the right place to be posting this...

Perhaps I'm trying to do something that isn't supported, but I have been trying to run the new 1.4.230 mumble-server on a headless Debian Bullseye server.

I've installed what I gather are the dependencies, but it seems that it's explicitly compiled against MySQL (not MariaDB) and unfortunately fails if I try to run it against MariaDB client shared lib. The relevant MySQL library is in Sid (not in any stable version of Debian), but installing that is far from ideal and I'd prefer to avoid it if possible.

Obviously I could compile it myself (and I'm assuming that I could then compile against MariaDB and/or SQLite instead?!). But in my perfect world, I much rather just pull your pre-compiled binary and it "just works"!

Description

IMO it'd be better to use MariaDB by default for your pre-compiled static binary. AFAIK all distros have MariaDB available these days, but I'm not sure which ones have actual MySQL anymore (although I know Ubuntu does and Debian definitely doesn't! Debian still uses the "MySQL" namespace, but everything MySQL actually points to MariaDB equivalents).

Anyway, here's the explicit commands that I tried. As you can see at the bottom, once I installed actual MySQL shared lib (from unstable/Sid) then it appeared to be working ok. But that's a dirty hack and IMO is not acceptable for a production server.

root@core ~# apt update
[...]
root@core ~# apt install -y libavahi-compat-libdnssd1 libodbc1 libsybdb5
[...]
root@core ~# wget https://dl.mumble.info/stable/mumble_server-1.4.230.x64.linux
root@core ~# chmod +x mumble_server-1.4.230.x64.linux
root@core ~# ./mumble_server-1.4.230.x64.linux
./mumble_server-1.4.230.x64.linux: error while loading shared libraries: libmysqlclient.so.21: cannot open shared object file: No such file or directory

I then tested libmariadb-dev-compat (which does provide libmysqlclient.so - it still doesn't have libmysqlclient.so.21 so I just made a symlink):

root@core ~# apt install -y libmariadb-dev-compat
[...]
root@core ~# ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so  /usr/lib/x86_64-linux-gnu/libmysqlclient.so.21
root@core ~# ls -la /usr/lib/x86_64-linux-gnu/libmysqlclient*
lrwxrwxrwx 1 root root 12 Aug 30 03:29 /usr/lib/x86_64-linux-gnu/libmysqlclient.a -> libmariadb.a
lrwxrwxrwx 1 root root 15 Aug 30 03:29 /usr/lib/x86_64-linux-gnu/libmysqlclient.so -> libmariadb.so.3
lrwxrwxrwx 1 root root 43 Jan 26 08:39 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.21 -> /usr/lib/x86_64-linux-gnu/libmysqlclient.so
lrwxrwxrwx 1 root root 12 Aug 30 03:29 /usr/lib/x86_64-linux-gnu/libmysqlclient_r.a -> libmariadb.a
lrwxrwxrwx 1 root root 15 Aug 30 03:29 /usr/lib/x86_64-linux-gnu/libmysqlclient_r.so -> libmariadb.so.3
root@core ~#  ./mumble_server-1.4.230.x64.linux   
./mumble_server-1.4.230.x64.linux: /lib/x86_64-linux-gnu/libmysqlclient.so.21: version `libmysqlclient_21.0' not found (required by ./mumble_server-1.4.230.x64.linux)

So I removed libmariadb-dev-compat (and the symlink) and manually downloaded the actual MySQL lib from unstalbe/Sid:

root@core ~# apt remove -y libmariadb-dev-compat
[...]
root@core ~# rm /usr/lib/x86_64-linux-gnu/libmysqlclient.so.21
root@core ~# wget http://deb.debian.org/debian/pool/main/m/mysql-8.0/libmysqlclient21_8.0.23-3+b1_amd64.deb
[...]
root@core ~# apt install -y ./libmysqlclient21_8.0.23-3+b1_amd64.deb
[...]
root@core ~# ls -la /usr/lib/x86_64-linux-gnu/libmysqlclient*
lrwxrwxrwx 1 root root      25 Mar  7  2021 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.21 -> libmysqlclient.so.21.1.23
-rw-r--r-- 1 root root 6809416 Mar  7  2021 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.21.1.23

Now it will run (actually it won't because I haven't set up the ini file etc, but it demonstrates that it no longer errors and it exits 0):

root@core ~# ./mumble_server-1.4.230.x64.linux; echo $?
0
root@core ~# ./mumble_server-1.4.230.x64.linux -limits
<W>2022-01-26 08:46:36.612 Initializing settings from /root/.murmurd/murmur.ini (basepath /root/.murmurd)
<W>2022-01-26 08:46:38.708 MetaParams: TLS cipher preference is "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:AES256-SHA:AES128-SHA"
<C>2022-01-26 08:46:38.709 WARNING: You are running murmurd as root, without setting a uname in the ini file. This might be a security risk.
<W>2022-01-26 08:46:38.709 Resource limits were 0 0
<W>2022-01-26 08:46:38.709 Successfully dropped capabilities
<W>2022-01-26 08:46:38.709 Running descriptor test.
<W>2022-01-26 08:46:38.709 0 descriptors...
<C>2022-01-26 08:46:38.762 Managed to open 1014 descriptors
<W>2022-01-26 08:46:38.762 0 threads...
<F>2022-01-26 08:46:38.825 Managed to spawn 126 threads

(FWIW, obviously running in production I would use a systemd service file, a proper ini file and not be running it directly as root!)

Mumble component

Server

OS-specific?

Yes

Additional information

If the chance of precompiling your Linux static binary against MariaDB instead is unlikely, would it be possible to share how I could compile against MariaDB instead myself (on Debian)?

Ideally it'd be great if I could skip MSSQL support too (if SQLite is still and option for v14.x, then that might be nice to include, but no one on Debian is ever going to use MSSQL...).

@JedMeister JedMeister added feature-request This issue or PR deals with a new feature triage This issue is waiting to be triaged by one of the project members labels Jan 26, 2022
@Krzmbrzl
Copy link
Member

There is no pre-compiled Linux binary anymore because the supposedly static binary turned out to not be static. See also #5453

We decided to no longer provide the static binary on our website for that reason. We will only be able to do that again once someone finds a way to convince vcpkg to create a fully static build of Mumble.

@Krzmbrzl
Copy link
Member

If you compile it yourself, you only have to make sure the correct Qt DB backend is installed on your system and then choose the DB type in the server's configuration file. No need to change the build.
However, we don't explicitly support MariaDB but as far as I understood, you can just set it to use MySQL and then MariaDB will work with that (pretending to be MySQL) 🤔
If you don't do anything extra, the server will use SQLite

@JedMeister
Copy link
Author

There is no pre-compiled Linux binary anymore because the supposedly static binary turned out to not be static. See also #5453

Ah ok, thanks... FWIW I found my way there after following the note in the wiki: "For nearly all Linux distributions, you can simply use the static binary." (and "static binary" links to http://dl.mumble.info/ - where I found it in https://dl.mumble.info/stable/).

If you compile it yourself, you only have to make sure the correct Qt DB backend is installed on your system and then choose the DB type in the server's configuration file. No need to change the build.

Ah ok, great thanks. 😄

However, we don't explicitly support MariaDB but as far as I understood, you can just set it to use MySQL and then MariaDB will work with that (pretending to be MySQL).

AFAIK you're right. Although we're really just hoping that the MariaDB devs continue to make MariaDB fully backwards compatible with MySQL. But they are also making lots of improvements (that aren't in MySQL) so as time goes on, the drift gets greater. (and currenlty whilst you can replace MySQL with MariaDB, you can't go back the other way).

IMO it might be worth rethinking "official" support for MariaDB if you want to support a hi-throughput scalable SQL DB on Linux into the future?! I say that as lots of Linux distros default to using MariaDB to provide "MySQL". Many have completely replaced MySQL with MariaDB (e.g. Debian, Arch, CentOS, Slackware, etc). From what I can gather, since Oracle bought Sun (and they changed to an "open core" licence model), all active open source MySQL devs have moved to MariaDB. The only devs actively working on MySQL appear to be paid Oracle employees, so are only doing maintenance to the open source release. Additional MySQL features seem to only be available via a (paid) proprietary licence.

But obviously, it's your project, so while MariaDB is backwards compatible, it should continue to work...

If you don't do anything extra, the server will use SQLite

Good to know, thanks!

@Krzmbrzl
Copy link
Member

FWIW I found my way there after following the note in the wiki: "For nearly all Linux distributions, you can simply use the static binary." (and "static binary" links to http://dl.mumble.info - where I found it in https://dl.mumble.info/stable/).

Ah okay - I would say about 90% of the information in the wiki is outdated by now 🙈

IMO it might be worth rethinking "official" support for MariaDB if you want to support a hi-throughput scalable SQL DB on Linux into the future?!

Yeah that sounds reasonable. We'll have to rewrite the DB implementation at some point anyway, because the current implementation is just horrible. At that stage we could also think about supporting new backends. At the moment we are strictly limited to whatever Qt supports (and in addition to that what we support in our code explicitly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request This issue or PR deals with a new feature triage This issue is waiting to be triaged by one of the project members
Projects
None yet
Development

No branches or pull requests

2 participants