Page MenuHomePhabricator

cxserver: sqlite installation fails
Closed, ResolvedPublicBUG REPORT

Description

SQLite installation fails with the current npm version (3.0.x), while updating the version works with installation, it might require updating code (eg: scripts/SectionTitleAlignment/alignwithmt.js and so on..)

Error log

$ npm install                                                                                                                               
npm WARN deprecated kad-fs@0.0.4: This package is no longer maintained.                                                                                                                     
npm WARN deprecated har-validator@5.1.5: this library is no longer supported                                                                                                                
npm WARN deprecated kad-memstore@0.0.1: This package is no longer maintained.                                                                                                               
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.de
v/blog/math-random for details.                                                                                                                                                             
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142                                                                         
npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates 
in the future
npm ERR! code 1
npm ERR! path /home/kartik/Development/WP/cxserver/node_modules/sqlite3
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! make: Entering directory '/home/kartik/Development/WP/cxserver/node_modules/sqlite3/build'
npm ERR!   ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c
npm ERR! make: Leaving directory '/home/kartik/Development/WP/cxserver/node_modules/sqlite3/build'
npm ERR! Failed to execute '/usr/bin/node /usr/share/nodejs/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/kartik/Development/WP/cxserver/node_modules/sqlite3/lib/bindin
g/node-v83-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/kartik/Development/WP/cxserver/node_modules/sqlite3/lib/binding/node-v83-linux-x64 --napi_version=8 --
node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.11.0
npm ERR! node-pre-gyp info using node@14.19.1 | linux | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download 
npm ERR! node-pre-gyp info check checked for "/home/kartik/Development/WP/cxserver/node_modules/sqlite3/lib/binding/node-v83-linux-x64/node_sqlite3.node" (not found)
npm ERR! node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-linux-x64.tar.gz
npm ERR! node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-linux-x64.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-linux-x64.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and node@14.19.1 (node-v83 ABI, glibc) (falling back to source compile with node-gyp) 
npm ERR! node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-linux-x64.tar.gz 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@14.19.1 | linux | x64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@14.19.1 | linux | x64
npm ERR! gyp info find Python using Python version 3.10.4 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/share/nodejs/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/kartik/Development/WP/cxserver/node_modules/sqlite3/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/share/nodejs/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/include/nodejs/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/usr/include/nodejs',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/share/nodejs/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/usr/include/nodejs/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/kartik/Development/WP/cxserver/node_modules/sqlite3',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@14.19.1 | linux | x64
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! /bin/sh: 1: python: not found
npm ERR! make: *** [deps/action_before_build.target.mk:13: Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c] Error 127
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/share/nodejs/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
npm ERR! gyp ERR! System Linux 5.16.0-6-amd64
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/share/nodejs/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/kartik/Development/WP/cxserver/node_modules/sqlite3/lib
/binding/node-v83-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/home/kartik/Development/WP/cxserver/node_modules/sqlite3/lib/binding/node-v83-linux-x64" "--napi
_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
npm ERR! gyp ERR! cwd /home/kartik/Development/WP/cxserver/node_modules/sqlite3
npm ERR! gyp ERR! node -v v14.19.1
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok 
npm ERR! node-pre-gyp ERR! build error 
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/share/nodejs/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/kartik/Development/WP/cxserver/
node_modules/sqlite3/lib/binding/node-v83-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/kartik/Development/WP/cxserver/node_modules/sqlite3/lib/binding/node-v8
3-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/kartik/Development/WP/cxserver/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1058:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
npm ERR! node-pre-gyp ERR! System Linux 5.16.0-6-amd64
npm ERR! node-pre-gyp ERR! command "/usr/bin/node" "/home/kartik/Development/WP/cxserver/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /home/kartik/Development/WP/cxserver/node_modules/sqlite3
npm ERR! node-pre-gyp ERR! node -v v14.19.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.11.0
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/kartik/.npm/_logs/2022-04-04T17_29_08_354Z-debug-0.log

Event Timeline

npm ERR! /bin/sh: 1: python: not found

This is the root cause. sqlite3 building require python. Your system may have python3 and python2 already, but not specifically python
Also see https://stackoverflow.com/questions/65758025/cant-install-sqlite3-dependency-with-npm

@santhosh, Also From: scripts/SectionTitleAlignment/alignwithmt.js
sqlite3 is a dependency of sqlite. We can use sqlite3 alone if we raise our
minimum node version support to 11+. Currently it is 10.

We are now on node 12, so should we update sqlite dependency?

Change 777192 had a related patch set uploaded (by KartikMistry; author: Santhosh):

[mediawiki/services/cxserver@master] Update sqlite package and sqlite3 driver to latest versions

https://gerrit.wikimedia.org/r/777192

Change 777192 merged by jenkins-bot:

[mediawiki/services/cxserver@master] Update sqlite package and sqlite3 driver to latest versions

https://gerrit.wikimedia.org/r/777192

santhosh triaged this task as Medium priority.

Change 777694 had a related patch set uploaded (by KartikMistry; author: KartikMistry):

[operations/deployment-charts@master] Update cxserver to 2022-04-05-070409-production

https://gerrit.wikimedia.org/r/777694

Change 777694 merged by jenkins-bot:

[operations/deployment-charts@master] Update cxserver to 2022-04-06-080942-production

https://gerrit.wikimedia.org/r/777694

This is deployed, but somehow message wasn't logged by logmsgbot.