BobbyWibowo / lolisafe

Blazing fast file uploader and awesome bunker written in node! 🚀
MIT License
317 stars 56 forks source link

sqlite3 CXXABI_1.3.8 not found error #502

Closed Chiaki closed 2 years ago

Chiaki commented 2 years ago

Hi, I moved from de0877e to 630d95b commit and when I trying to start lolisafe I got this:

[2022-05-21 21:10:53] Starting lolisafe…
Knex: run
$ npm install sqlite3 --save
/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /path/lolisafe/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-x64/node_sqlite3.node)
Error: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /path/lolisafe/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-x64/node_sqlite3.node)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/path/lolisafe/node_modules/sqlite3/lib/sqlite3-binding.js:4:17)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)

Node version is 14.19.3, I run yarn full-upgrade then yarn build and yarn start Any help would be appreciated.

BobbyWibowo commented 2 years ago

You'll have to downgrade sqlite3 to 5.0.2 for the time being Related issue https://github.com/TryGhost/node-sqlite3/issues/1582

Chiaki commented 2 years ago

I did this at first, but got the same error. Looks like problem in markdown-it. After I roll back to backup, I've added this dependency and error appears. Sadly, but downgrade even to markdown-it 8.x didn't help. I found that CXXABI 1.3.8 is defined in gcc 4.9, and Centos 7 ships with gcc 4.8.

P.S. Deleting node_modules folder and running yarn full-upgrade is correct way to workaround?

BobbyWibowo commented 2 years ago

I found that CXXABI 1.3.8 is defined in gcc 4.9, and Centos 7 ships with gcc 4.8.

Correct They will have to start shipping Linux binaries built on CentOS 7 docker container, if they want to increase their coverage I believe they will do it eventually, since even sharp did so (https://github.com/lovell/sharp/issues/2119#issuecomment-597301435)

Looks like problem in markdown-it.

That doesn't sound right, imho markdown-it should not have a native binary, it's a pure JS library

Deleting node_modules folder and running yarn full-upgrade is correct way to workaround?

Actually, no yarn full-upgrade is more of a "if you know what you're doing" type of thing, as it deletes the yarn.lock file, which specifies exact versions of dependencies last tested by me to be working It's generally not the end of the world to use it anyway, but it does increase the amount of variables when issues occur

Try to do the following instead

git restore package.json yarn.lock
rm -rf node_modules
env NODE_ENV=production yarn add sqlite3@5.0.2

Remove env NODE_ENV=production if you intend to also install dev dependencies (which you may need if you want to build your own modified client assets, otherwise they're just waste of disk space, roughly 140MB)

BobbyWibowo commented 2 years ago

We switched from sqlite3 to better-sqlite3 by commit https://github.com/BobbyWibowo/lolisafe/commit/afc58503b7d5a1add68a719a6bd8a95c214fa6b7 since it's all around better, and does not require existing installations to manually migrate (Knex.js handles abstraction to the driver)

Unfortunately it does not have prebuilt binaries for CentOS 7 either, but assuming you have Python 3 and GCC 7 (devtoolset-7 or newer), it will build from source just fine during yarn dependencies install