ibmdb / vscode-extension

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

Help wanted: Db2Connect Extension Installation Issue Within Corporate Network #70

Closed TDKZG closed 7 months ago

TDKZG commented 8 months ago

Hi to all,

I'm encountering an issue with the Db2Connect extension for VSCode in a corporate environment with strict internet access restrictions. We use a Nexus Repository (tool for managing software artifacts and dependencies), avoiding direct internet access.

While the Db2Connect installation completes successfully, attempting to run the extension results in a "Failed to rebuild native modules" error. The detailed error message indicates a failure to download the ibm_db driver from GitHub, likely due to our security policies blocking direct internet access:

Intellisense Activated [3/11/2024 12:12:34 PM] Proceeding to rebuild native modules Error: ENOENT: no such file or directory, access 'c:\Users\USER\.vscode\extensions\ibm.db2connect-2.3.1\node_modules\ibm_db' [3/11/2024 12:12:34 PM] No ibm_db found... Downloading node ibm_db Driver from https://github.com/ibmdb/node-ibm_db/archive/master.zip ... ERR_BAD_REQUEST : https://github.com/ibmdb/node-ibm_db/archive/master.zip Error 407: Proxy Authentication Required - https://github.com/ibmdb/node-ibm_db/archive/master.zip Error: Installation of ibm_db failed.

I attempted a manual installation of ibm_db within the node_modules directory at the path c:\Users\USER.vscode\extensions\ibm.db2connect-2.3.1\node_modules\ibm_db using the command _npm install ibmdb. The command executed successfully, and the ibm_db folder was created. However, when I subsequently opened VSCode and selected the Db2Connect icon, the ibm_db folder was deleted, leading to a "Failed to rebuild native modules" error again.

I've configured npm to use our Nexus repository(npm config set registry http:///repository/npm/ ), but it seems this process bypasses (does not use) npm for this. Is there a way to configure Db2Connect or VSCode to use Nexus for downloading the ibm_db driver, or any workaround to address this issue? @akhilravuri1 if you still working on this, or anybody else, your guidance would be greatly appreciated. Thank you in advance!

Db2 Connect extension: v2.3.1 VSCode Version: 1.76 Version: 1.76.0 (system setup) Git version 2.43.0.windows.1 Date: 2023-03-01T10:22:44.506Z Electron: 19.1.11 Chromium: 102.0.5005.196 Node.js: 16.14.2 V8: 10.2.154.26-electron.0 OS: Windows_NT x64 10.0.19045 Sandboxed: No

Steps to Reproduce:

  1. Find and install Db2 Connect in Extensions in VSC
  2. When installed, click in Db2Connect extension bee icon
  3. When clicked I get: Failed to rebuild native modules
bimalkjha commented 8 months ago

@TDKZG Try below commands from terminal:

cd c:\Users\USER.vscode\extensions\ibm.db2connect-2.3.1\node_modules\ibm_db
npm install --vscode
cd c:\Users\USER.vscode\extensions\ibm.db2connect-2.3.1
echo "" > rebuilt_dont_delete

Close VSCode and reopen. Now, it should not rebuilt and you should be able to use it. Thanks.

bimalkjha commented 7 months ago

@TDKZG Any update? Thanks.

TDKZG commented 7 months ago

@TDKZG Any update? Thanks.

Hi @bimalkjha, sorry for the late response; it's been a busy period. It worked for me when I did the following:

  1. Installed a fresh copy of the Db2Connect extension in Visual Studio Code (VSC).
  2. Navigated to File -> Preferences -> Settings -> Application -> Proxy, and entered the proxy that corresponds to my organization.
  3. Closed the Settings tab and clicked on the extension icon (which looks like a bee) to activate the rebuilding of the extension.
  4. After the rebuild finished, I returned to the previous step and removed the proxy URL from the Proxy field.
  5. Restarted VSC.

This method resolved the issue for me. I haven't tried other methods, including the one suggested by @bimalkjha. Nonetheless, I appreciate the suggestion.