ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
188 stars 151 forks source link

npm install not working with podman #994

Closed repomike closed 1 month ago

repomike commented 2 months ago

Please provide below information while opening an issue to understand your problem

Please provide below problem specific info:

========================================= We recently switched from docker to podman and trying to build an image for our application based on the RHEL node.js image fails to install ibm_db. The build just hangs on driverInstall.js.

STEP 7/10: RUN npm install --verbose
npm verb cli /usr/bin/node /usr/bin/npm
npm info using npm@10.2.4
npm info using node@v20.11.1
npm verb title npm install
npm verb argv "install" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/opt/app-root/src/.npm/_logs/2024-04-22T13_11_38_968Z-
npm verb logfile /opt/app-root/src/.npm/_logs/2024-04-22T13_11_38_968Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/ibm_db/-/ibm_db-3.2.4.tgz 66179ms (cache miss)
npm info run ibm_db@3.2.4 install node_modules/ibm_db node installer/driverInstall.js

I can verify that a node app builds and runs without ibm_db but we think we've narrowed it down to the exec statement in the driverInstall.js file that can't issue the make command to get the version.

var makeVersion = execSync('make -v').toString();
repomike commented 2 months ago

Issue could be related to RHEL and podmans extra permissions on selinux:

-rwxr-xr-x. 1 root root system_u:object_r:container_file_t:s0:c530,c693 90900480 Mar  5  2023 /usr/local/bin/node

vs. docker:

-rwxr-xr-x 1 root root ? 90900480 Mar  5  2023 /usr/local/bin/node
bimalkjha commented 2 months ago

@repomike If execSync() function can't execute make command, then its problem with child_process package and execSync() is part of child_process and ibm_db uses it as an dependency. Are you able to call execSync using a sample nodejs program? Thanks.

bimalkjha commented 1 month ago

@repomike Any update about this issue? Are you able to call execSync using a sample nodejs program? Thanks.

repomike commented 1 month ago

I was able to use the emulator to build and run locally.

$ arch -x86_64

on my mac puts me into a new shell where i can issue the npm install

bimalkjha commented 1 month ago

@repomike So, finally issue got resolved?

repomike commented 1 month ago

I would say so. thanks

bimalkjha commented 1 month ago

Closing the issue now. Thanks.