ibmdb / node-ibm_db

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

Error: getaddrinfo ENOTFOUND public.dhe.ibm.com #950

Closed abinayaa-r closed 9 months ago

abinayaa-r commented 9 months ago

I am currently working on a node.js application using ibm_db. But while installation of ibm_db using npm install ibm_db, I didn't get any error. But if I start server using npm start then I am getting below error.

Error: Could not locate the bindings file. Tried: →C:\Users\FirstProject\node_modules\ibm_db\build\odbc_bindings.node → C:\Users\FirstProject\node_modules\ibm_db\build\Debug\odbc_bindings.node → C:\Users\FirstProject\node_modules\ibm_db\build\Release\odbc_bindings.node

I can see build is available as Zipped folder inside node_modules/ibm_db but its not unzipped (I didn't find any unzipped build folder). So tried navigating into nodemodule/ibm_db and i run the npm install command but getting the below error.

**> node installer/driverInstall.js

Downloading DB2 ODBC CLI Driver from https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ntx64_odbc_cli.zip...

Error: getaddrinfo ENOTFOUND public.dhe.ibm.com at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26){ errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'public.dhe.ibm.com' }**

So i have also tried installing older version but I am facing the same error. Please help me in this regard to resolve it. Thank you.

bimalkjha commented 9 months ago

@abinayaa-r Please share output of command cd C:\Users\FirstProject\ && npm ls ibm_db. Thanks.

bimalkjha commented 9 months ago

Also, share complete output of npm install command, not partial. Thanks.

abinayaa-r commented 9 months ago

If I give npm i ibm_db, I didn't get any error. If i give npm start getting below error, (complete output)

Uncaught Error: Could not locate the bindings file. Tried: → C:\Users\FirstProject\node_modules\ibm_db\build\odbc_bindings.node → C:\Users\FirstProject\node_modules\ibm_db\build\Debug\odbc_bindings.node → C:\Users\FirstProject\node_modules\ibm_db\build\Release\odbc_bindings.node → C:\Users\FirstProject\node_modules\ibm_db\out\Debug\odbc_bindings.node → C:\Users\FirstProject\node_modules\ibm_db\Debug\odbc_bindings.node → C:\Users\FirstProject\node_modules\ibm_db\out\Release\odbc_bindings.node → C:\Users\FirstProject\node_modules\ibm_db\Release\odbc_bindings.node → C:\Users\FirstProject\node_modules\ibm_db\build\default\odbc_bindings.node → C:\Users\FirstProject\node_modules\ibm_db\compiled\18.12.1\win32\x64\odbc_bindings.node → C:\Users\FirstProject\node_modules\ibm_db\addon-build\release\install-root\odbc_bindings.node → C:\Users\FirstProject\node_modules\ibm_db\addon-build\debug\install-root\odbc_bindings.node → C:\Users\FirstProject\node_modules\ibm_db\addon-build\default\install-root\odbc_bindings.node → C:\Users\FirstProject\node_modules\ibm_db\lib\binding\node-v108-win32-x64\odbc_bindings.node at bindings (file:///C:/Users/FirstProject/node_modules/ibm_db/node_modules/bindings/bindings.js:126:9) at (file:///C:/Users/FirstProject/node_modules/ibm_db/lib/odbc.js:31:31) at Module._compile (node:internal/modules/cjs/loader:1159:14) at Module._extensions..js (node:internal/modules/cjs/loader:1213:10) at Module._load (node:internal/modules/cjs/loader:1037:32) at Module._load (node:internal/modules/cjs/loader:878:12) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at (file:///C:/Users/FirstProject/sample_local.js:3:13) at Module._compile (node:internal/modules/cjs/loader:1159:14) at Module._extensions..js(node:internal/modules/cjs/loader:1213:10) at Module.load (node:internal/modules/cjs/loader:1037:32) at Module._load (node:internal/modules/cjs/loader:878:12) at executeUserEntryPoint (node:internal/modules/run_main:81:12) at (node:internal/main/run_main_module:23:47)


If if give npm install inside that directory then I am getting below error: ( i have also tried with newer version still same error)

→ C:\Users\FirstProject\node_modules\ibm_db>npm install npm WARN deprecated har-validator@5.1.5: this library is no longer supported 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.dev/blog/math-random for details. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

ibm_db@2.5.0 install node installer/driverInstall.js

Downloading DB2 ODBC CLI Driver from https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ntx64_odbc_cli.zip...

Error: getaddrinfo ENOTFOUND public.dhe.ibm.com at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26){ errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'public.dhe.ibm.com' }

added 107 packages, and audited 108 packages in 1m

4 packages are looking for funding run npm fund for details

2 moderate severity vulnerabilities

Some issues need review, and may require choosing a different dependency.

Run npm audit for details.

bimalkjha commented 9 months ago

@abinayaa-r The problem is, IBM site https://public.dhe.ibm.com/ is down due to maintenance activity and hence download of clidriver fails and error. Another problem is you are using very old ibm_db version 2.5.0 which we can see in the output of npm install. If you install latest version of ibm_db@3.2.1, this problem of downloading clidriver is fixed there and ibm_db would work fine. Check your package.json file of application and see if it has fixed the ibm_db version to 2.5.0. Change it to 3.2.1 and then run npm start. Try below commands from command prompt:

cd C:\Users\FirstProject\
npm uninstall ibm_db
<make sure directory C:\Users\FirstProject\node_modules\ibm_db got deleted, if not, delete it manually.>
npm install ibm_db@3.2.1
npm start

If still getting issue, then cd C:\Users\FirstProject\node_modules\ibm_db and run npm install. It should work. Make sure this time you have latest version of ibm_db. Thanks.

abinayaa-r commented 9 months ago

Before I have tried with new version.. Ok let me try again and will inform you. Thank you @bimalkjha

bimalkjha commented 9 months ago

@abinayaa-r The file https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ntx64_odbc_cli.zip is also available now and npm install should work fine now. But still update the ibm_db to latest. Thanks.