SQLite package has not been found installed. When running inside Apache Passenger

When installing n8n inside my ApachePassenger instance I get what looks like a “caught error” on sqlite3

/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/buildcheck/lib/index.js:115
  throw new Error('Unable to detect compiler type');
  ^

Error: Unable to detect compiler type
    at BuildEnvironment.getKind (/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/buildcheck/lib/index.js:115:9)
    at BuildEnvironment.tryCompile (/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/buildcheck/lib/index.js:537:15)
    at BuildEnvironment.checkHeader (/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/buildcheck/lib/index.js:423:25)
    at Object.<anonymous> (/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/cpu-features/buildcheck.js:16:4)
    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)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47

> [email protected] install /home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/ssh2
> node install.js

make: Entering directory `/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/ssh2/lib/protocol/crypto/build'
  CXX(target) Release/obj.target/sshcrypto/src/binding.o
make: execvp: g++: Permission denied
make: *** [Release/obj.target/sshcrypto/src/binding.o] Error 127
make: Leaving directory `/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/ssh2/lib/protocol/crypto/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/alt/alt-nodejs14/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System Linux 2.6.32-954.3.5.lve1.4.89.el6.x86_64
gyp ERR! command "/opt/alt/alt-nodejs14/root/usr/bin/node" "/opt/alt/alt-nodejs14/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/bin/node-gyp.js" "--target=v14.18.3" "--real_openssl_major=1" "rebuild"
gyp ERR! cwd /home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/ssh2/lib/protocol/crypto
gyp ERR! node -v v14.18.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
Failed to build optional crypto binding

> [email protected] install /home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

[sqlite3] Success: "/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-x64/node_sqlite3.node" is installed via remote

Since the last message is a Success I assumed everything should work but when I try to run n8n I get the error:

Initializing n8n process
There was an error initializing DB: “SQLite package has not been found installed. Try to install it: npm install sqlite3 --save”

Stopping n8n…

After installing sqlite3 globally I get

npm install sqlite3 -g

> [email protected] install /home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/lib/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

[sqlite3] Success: "/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/lib/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-x64/node_sqlite3.node" is installed via remote
+ [email protected]

It stills does not work.

After installing locally I get


> [email protected] install /home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/cpu-features
> node buildcheck.js > buildcheck.gypi && node-gyp rebuild

/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/buildcheck/lib/index.js:115
  throw new Error('Unable to detect compiler type');
  ^

Error: Unable to detect compiler type
    at BuildEnvironment.getKind (/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/buildcheck/lib/index.js:115:9)
    at BuildEnvironment.tryCompile (/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/buildcheck/lib/index.js:537:15)
    at BuildEnvironment.checkHeader (/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/buildcheck/lib/index.js:423:25)
    at Object.<anonymous> (/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/cpu-features/buildcheck.js:16:4)
    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)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47

> [email protected] install /home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

[sqlite3] Success: "/home/my-account/nodevenv/MY-FOLDER/n8n.my-domain.com/14/lib/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-x64/node_sqlite3.node" is installed via remote
npm WARN [email protected] requires a peer of @fortawesome/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @fortawesome/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @fortawesome/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/cpu-features):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node buildcheck.js > buildcheck.gypi && node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ [email protected]
updated 1 package and audited 1104 packages in 13.871s

But it still does not work.

witch sqlite3 returns /usr/bin/sqlite3

I am out of ideas, I am assuming, reading another similar posts, that some path needs to be set but I can not find which and where.

I hope somebody can help me with it.

Thanks!

version:
n8n/0.193.5 linux-x64 node-v14.18.3

The first problem was that I did not had privileges to run gcc. I got it from the server admin, but now looks like the gcc version is too old (4.4.7):

cc1plus: error: unrecognized command line option "-std=gnu++1y"

The server admin told me that the gcc version can not be changed.

So I am now searching how to fix that…

Hi @distante, welcome to the community!

I am not entirely sure if this will help but the first thing that springs to mind would be the Node.js version you have in use. We’re currently using Node.js 16 which is the current LTS. In another recent case a Node.js upgrade has fixed problems around the sqlite module installation. Perhaps you could give this a go?

If this still fails, perhaps the n8n docker image might be worth a shot? This comes pre-built, so would hopefully cause less trouble/

Sadly I have no way to use docker at the moment :pensive:.

I will ask the server admin if update node is a possibility since node 14 was the higher version I was able to choose there.

On the other side, locally, using nvm with the same node version everything worked.

Thank you for your help!

So the server admin responded and sadly no update or so will be posible.

I will look if I can find some service for docker with a free tier that is not that hard to use since I have 0 experience with docker configuration.

I just want to start with n8n since I saw it on the place I work and right now I just really have one, low maintenance node that I want to try to know when the garbage collector will come :joy:.

1 Like

I will look if I can find some service for docker with a free tier that is not that hard to use since I have 0 experience with docker configuration.

If you are looking for a free tier on a service capable of running docker, you might want to check out Oracle Cloud. I’ve written a tutorial in the past after their service came up on the forum.

I just want to start with n8n since I saw it on the place I work and right now I just really have one, low maintenance node that I want to try to know when the garbage collector will come :joy:.

Well, that is one of my workflows actually and it has made my life easier :wink:. On the very off chance you’re living in the Barnim district of Germany give me a shout and I’m happy to share my workflow.

2 Likes

Thanks for the idea for a workflow. I always forget when the Garbage truck comes and notifications in their app suck. Dont know why I didnt think of it myself :upside_down_face:

2 Likes

Same here :smiley:

My basic logic looks like this in case anyone happens to use a utility company using the same backend as mine:

This will throw out all relevant future dates (which can then for example be sent to a messaging service, email, push notification, etc.).

Yes! I am following your tutorial! so far so good, I am just in the part when I can see the Caddy webpage using the server IP address. I am now trying to figure out why when I put the Ip address on my cloudflare account it returns an error 521.

I am a little bit south! on Bayern :slight_smile:

1 Like

Yes! I am following your tutorial! so far so good, I am just in the part when I can see the Caddy webpage using the server IP address. I am now trying to figure out why when I put the Ip address on my cloudflare account it returns an error 521.

Glad to hear, though I am unfortunately not a Cloudflare user so can’t help much with that part of yours :frowning:

As update, looks like I need something on my firewall

From https://community.cloudflare.com/t/community-tip-fixing-error-521-web-server-is-down/42461

521 error happens when we are unable to make a TCP connection to your origin server. Specifically, Cloudflare tried to connect to your origin server on port 80 or 443, but received a connection refused error. This is often caused by security or firewall software and happens if the origin server has directly refused Cloudflare’s proxy request.

1 Like

Ah, that should be covered by the security list setup:

image

Though if you try to connect to a caddy webserver before defining a hostname (happening in the Make n8n available via the internet section further down) it probably won’t listen on port 443 (as there is no valid SSL certificate part at this point).

So my suggestion would be to run through the full setup without Cloudflare first, then add Cloudflare into the mix once you’re sure everything runs as it should.

Yes! Ypu are right. I also disabled the proxy from cloudflare and let it just in DNS, I do not need cloudflare to cache anything there.

Success!! It works!

1 Like

Awesome, thanks for confirming!