unity-sqlite-net icon indicating copy to clipboard operation
unity-sqlite-net copied to clipboard

Unable to load DLL on Linux Dedicated Server build

Open Sleggie opened this issue 8 months ago • 4 comments

Hello

I am getting the error below on Linux Dedicated Server.

Using IL2CPP:

4/5 3:13:51 PM [Info] 2025-04-05T19:13:51.234Z|0x7fdf2d2bc740|DllNotFoundException: Unable to load DLL 'gilzoide-sqlite-net'. Tried the load the following dynamic libraries: Unable to load dynamic library 'gilzoide-sqlite-net' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = gilzoide-sqlite-net: cannot open shared object file: No such file or directory

Using Mono:

4/5 3:55:40 PM [Info] 2025-04-05T19:55:40.410Z|0x7fb73e2c0740|DllNotFoundException: gilzoide-sqlite-net assembly:<unknown assembly> type:<unknown type> member:(null)

Sleggie avatar Apr 05 '25 19:04 Sleggie

Hey @Sleggie, thanks for the report. Say, can you see the libgilzoide-sqlite-net.so file in your build? If yes, there may be another error message above this one you showed with the root error, may be a "undefined symbol X" or maybe something related to the version of GLIBC that is linked to this library. If not though, what version of Unity and what architecture are you building? We only have a prebuilt DLL for Linux for x86_64. As far as I know, Unity makes no difference between standalone builds and dedicated server builds, so the standalone DLL should be copied over and used there 🤔 But I might be wrong, I have never built Unity projects for dedicated servers.

gilzoide avatar Apr 06 '25 12:04 gilzoide

Hey @Sleggie, thanks for the report. Say, can you see the libgilzoide-sqlite-net.so file in your build? If yes, there may be another error message above this one you showed with the root error, may be a "undefined symbol X" or maybe something related to the version of GLIBC that is linked to this library. If not though, what version of Unity and what architecture are you building? We only have a prebuilt DLL for Linux for x86_64. As far as I know, Unity makes no difference between standalone builds and dedicated server builds, so the standalone DLL should be copied over and used there 🤔 But I might be wrong, I have never built Unity projects for dedicated servers.

Hi @gilzoide

The libgilzoide-sqlite-net.so is indeed in the build. Also note that we are using IL2CPP, but the issue still happens with Mono. There are no mentions of undefined symbols above it, we are using unity version 2022.3.50f1, and we are targeting x86_64 architecture.

Because of this issue, we switched to this sqlite solution: https://github.com/kdw9502/UnitySQLiteAsync which ended up working but only with Mono, not IL2CPP. Perhaps that might give a bit more insight into the issue!

Thanks :)

Sleggie avatar Apr 08 '25 16:04 Sleggie

Maybe you need to recompile libgilzoide-sqlite-net.so with your Docker image.

to confirm this, you can use

ldd libgilzoide-sqlite-net.so

if there is "not found" appears, that means it missing dependencies.

There is Makefile in the Plugins folder. If your are using Linux or Mac, use

make docker-all-linux

If you are using Windows, you have to run

cd Plugins
docker build -f tools~/Dockerfile.build.linux --platform=linux/amd64 -t gilzoide-sqlite-net-build-linux:latest  .
docker run --rm -v .:/src -w /src --platform=linux/amd64 gilzoide-sqlite-net-build-linux:latest make all-linux

Before running things above, check Plugins/tools~/Dockerfile.build.linux

# syntax=docker/dockerfile:1
FROM ubuntu:bionic

RUN apt-get -qq update \
    && apt-get -qq install -y --no-install-recommends \
        gcc \
        libc-dev \
        make

i changed the second line to "ubuntu:bionic", which i used to build my dedicated server image.

If it's still not working after done these, you can try to install libsqlite3-dev in your dockerfile

xiaobin83 avatar Jul 18 '25 06:07 xiaobin83

If it's still not working after done these, you can try to install libsqlite3-dev in your dockerfile

There should be no need to install SQLite dev while building, SQLite's source is bundled in this project.

gilzoide avatar Jul 18 '25 10:07 gilzoide