-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Failed to load SQLite3 Dynamic Library
– example code not working
#105
Comments
I don't think this library works on aarch64 linux yet. But let us try anyway! The error you have posted simply means that you did not pass the I do not have an actual aarch64 Linux machine to test on. But I will investigate this issue further over the weekend. I can probably natively virtualize Linux on Arm-based Mac. |
Oh, my bad. Tried deno run -A --unstable test.ts
error: Uncaught (in promise) Error: Failed to load SQLite3 Dynamic Library
throw new Error("Failed to load SQLite3 Dynamic Library", { cause: e });
^
at https://deno.land/x/[email protected]/src/ffi.ts:618:9
at eventLoopTick (ext:core/01_core.js:183:11)
Caused by: Error: Could not open library: Could not open library: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/ubuntu/.cache/deno/plug/https/github.com/3cb5e608efce656445a255c1ab6f4d25155f9e25e344dc43ab8a196786e951cf.so)
at new DynamicLibrary (ext:deno_ffi/00_ffi.js:440:46)
at Object.dlopen (ext:deno_ffi/00_ffi.js:577:10)
at dlopen (https://deno.land/x/[email protected]/mod.ts:155:15)
at eventLoopTick (ext:core/01_core.js:183:11)
at async https://deno.land/x/[email protected]/src/ffi.ts:601:7 Maybe if I update glibc, it will be solved, but... Is this an absolute necessity? I mean, I have ldd --version
ldd (Ubuntu GLIBC 2.31-0ubuntu9.7) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper. I tried older versions of deno-sqlite3, but they don't work it seems: it's trying to download What do you think? Updating glibc, or an OS, – the only right way forward? |
Do you have sqlite installed on your system? You can try using the default sqlite. To do that, set DENO_SQLITE_PATH to full path to the library file present on your system. |
Yes, sqlite3 is installed: sqlite3 --version
3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1 If I set path explicitly, the error is a bit different but still there: DENO_SQLITE_PATH=/usr/bin/sqlite3 deno run -A --unstable test.ts
error: Uncaught Error: Failed to load SQLite3 Dynamic Library
throw new Error("Failed to load SQLite3 Dynamic Library", { cause: e });
^
at https://deno.land/x/[email protected]/src/ffi.ts:618:9
Caused by: Error: Could not open library: Could not open library: /usr/bin/sqlite3: cannot dynamically load position-independent executable
at new DynamicLibrary (ext:deno_ffi/00_ffi.js:440:46)
at Object.dlopen (ext:deno_ffi/00_ffi.js:577:10)
at https://deno.land/x/[email protected]/src/ffi.ts:598:16 I might be wrong, but this new error, Is it possible to set custom path for glibc? I think if glibc is, truly, the only reason, then this workaround would be enough for me. At least it would simplify debugging, as I don't have to replace my system-level glibc. |
You need to point the path to sqlite3 shared library not the binary. It would look like libsqlite3.so. |
Hooray, it works! Thanks. I'd add some details to whatever people coming here after. I first found several
I tried them all, some of them returned errors just like in already mentioned issue: DENO_SQLITE_PATH=/snap/lxd/24065/lib/libsqlite3.so deno run -A --unstable test.ts
Segmentation fault (core dumped) Some returned the same DENO_SQLITE_PATH=/snap/gnome-42-2204/112/usr/lib/aarch64-linux-gnu/libsqlite3.so deno run -A --unstable test.ts
error: Uncaught Error: Failed to load SQLite3 Dynamic Library
throw new Error("Failed to load SQLite3 Dynamic Library", { cause: e });
^
at https://deno.land/x/[email protected]/src/ffi.ts:618:9
Caused by: Error: Could not open library: Could not open library: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /snap/gnome-42-2204/112/usr/lib/aarch64-linux-gnu/libsqlite3.so)
at new DynamicLibrary (ext:deno_ffi/00_ffi.js:440:46)
at Object.dlopen (ext:deno_ffi/00_ffi.js:577:10)
at https://deno.land/x/[email protected]/src/ffi.ts:598:16 ✅ And with one, deno actually executed example code without errors, correctly logging sqlite version: DENO_SQLITE_PATH=/snap/gnome-3-38-2004/145/usr/lib/aarch64-linux-gnu/libsqlite3.so deno run -A --unstable test.ts
3.41.2 Weirdly though, it shows different version than sqlite3 --version
3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1 So I guess I have several sqlite3 installed and some of them don't work, including this one used by default. |
I'm trying to run this code sample from readme:
And I'm getting this error:
It might be somehow related to this:
I think of this relation because I'm also using aarch64 / Raspberry Pi. But it's another error so idk.
Version info:
I already used dozens of other deno packages, they work perfectly fine.
The text was updated successfully, but these errors were encountered: