ibmdb / vscode-extension

vscode extenstion for db2 as db2connect
7 stars 2 forks source link

ENOTFOUND when downloading https://github.com/ibmdb/node-ibm_db/archive/master.zip #54

Closed dyacharan closed 1 year ago

dyacharan commented 1 year ago

Steps to Reproduce:

1.upon starting VS Code, DB2 extension fails with output as below Intellisense Activated [1/1/2023 2:20:55 AM] Proceeding to rebuild native modules [1/1/2023 2:20:55 AM] No ibm_db found... Downloading node ibm_db Driver from https://github.com/ibmdb/node-ibm_db/archive/master.zip...

Error: getaddrinfo ENOTFOUND

2.i can't find master.zip in the github repo

bimalkjha commented 1 year ago

@dyacharan When I click on the link, I am able to download master.zip file. Can you paste the link in your browser and see if you are able to download it? If not, check your internet connection. If able to download, then restart the extension and see if it works. Thanks.

dyacharan commented 1 year ago

@bimalkjha, it looks my organisation security firewall rules blocking the file type in the link. Is there anyway to do this offline using a different link? I am unable to download this file directly using browser either and its very difficult to remove such security blocks in my shop

bimalkjha commented 1 year ago

@dyacharan Yes, there is a way. If you have node.js v16.14.2 installed, then close vscode, open windows command prompt and run below commands:

cd C:\Users\%USER%\.vscode\extensions\ibm.db2connect-2.3.0
npm install ibm_db --electron 19.1.8

Now restart vscode and try using the db2connect extension. Thanks.

dyacharan commented 1 year ago

@bimalkjha, i tried the command and it failed as below. i get error when i query https://registry.npmjs.org/19.1.8 from the browser.

980 verbose Windows_NT 10.0.19042 981 verbose node v18.12.1 982 verbose npm v8.19.2 983 error code ETIMEDOUT 984 error syscall connect 985 error errno ETIMEDOUT 986 error network request to https://registry.npmjs.org/19.1.8 failed, reason: connect ETIMEDOUT 104.16.20.35:443 987 error network This is a problem related to network connectivity. 987 error network In most cases you are behind a proxy or have bad network settings. 987 error network 987 error network If you are behind a proxy, please make sure that the 987 error network 'proxy' config is set properly. See: 'npm help config'

bimalkjha commented 1 year ago

@dyacharan Then just run npm install ibm_db@latest and try. Thanks.

dyacharan commented 1 year ago

@bimalkjha, i ran the command successfully

C:\Users\xxxxxx\.vscode\extensions\ibm.db2connect-2.3.0>npm` install ibm_db@latest
npm WARN deprecated [fsevents@2.1.3](mailto:fsevents@2.1.3): "Please update to latest v2.3 or v2.2"
npm WARN deprecated [debug@3.2.6](mailto:debug@3.2.6): Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [vscode-test@1.6.1](mailto:vscode-test@1.6.1): This package has been renamed to @vscode/test-electron, please update to the new name

added 241 packages, removed 2 packages, and changed 8 packages in 45s

however when i start VS Code, i continue to encounter it trying to message "Db2Connect Extension: Please wait while we are setting up native modules..." and it gets stuck there

Intellisense Activated
[1/9/2023 3:03:11 PM] Proceeding to rebuild native modules
[1/9/2023 3:03:11 PM] Cleaning up the current ibm_db
Downloading node ibm_db Driver from https://github.com/ibmdb/node-ibm_db/archive/master.zip...


100.00% | 9388 bytes downloaded out of 9388 bytes.
bimalkjha commented 1 year ago

@dyacharan The last line in above message is 100.00% | 9388 bytes downloaded out of 9388 bytes.. It seems it has downloaded master.zip successfully. I do not see any issue till here, but you have not shared the next line. What is happening after download and what is the error? Any way, to avoid the "setting up native modules..." message, you can create an empty file with name rebuilt_dont_delete under .vscode\extensions\ibm.db2connect-2.3.0 directory. If this file is present, db2connect extension will think that setup is done. So, just follow below steps:

  1. Close VSCode
  2. From command prompt, cd C:\Users\%USER%\.vscode\extensions\ibm.db2connect-2.3.0 and npm install ibm_db@latest
  3. Create empty file cd C:\Users\%USER%\.vscode\extensions\ibm.db2connect-2.3.0\rebuilt_dont_delete
  4. Start VSCode Thanks.
dyacharan commented 1 year ago

@bimalkjha There are no further lines as it gets stuck in that state forever. please refer screenshot below image

i followed your instructions and created empty file after running the command successfully and it throws error as below image

bimalkjha commented 1 year ago

@dyacharan The download issue can be fixed by installing extension win-ca. Installing this extension has fixed similar issue #55 . If still facing issue, then follow below instructions:

  1. Open windows command prompt and cd to C:\Users\USERID\.vscode\extensions\ibm.db2connect-2.3.0 directory
  2. npm install ibm_db@latest
  3. Create an empty file rebuilt_dont_delete without any extension, under C:\Users\USERID\.vscode\extensions\ibm.db2connect-2.3.0 directory. If file exists, then no action required. After that open vscode and try to use db2connect extension. Thanks.
bimalkjha commented 1 year ago

@dyacharan Please let us know if you are still facing this issue after following instructions in previous update. Thanks.