evidence-dev / sqltools-duckdb-driver

DuckDB Driver for SQLTools
https://marketplace.visualstudio.com/items?itemName=Evidence.sqltools-duckdb-driver
MIT License
17 stars 6 forks source link

[VSCode Extension]: Cannot connect to DuckDB database due to broken driver detection behind corporate Proxy. #21

Open evx73 opened 1 month ago

evx73 commented 1 month ago

Describe the bug

Cannot connect to DuckDB database due to broken driver detection behind corporate Proxy.

Steps to Reproduce

Set a new DuckDB connection, and connect

SqlTools log:

ERROR (ls): Connecting error: {"code":1000,"data":{"notification":"Core/missingModule","dontNotify":true,"args":{"conn":{"name":"DuckDB2","accessMode":"Read/Write","previewLimit":50,"driver":"DuckDB","databaseFilePath":":memory:","isActive":false,"isConnected":false,"id":"DuckDB2|DuckDB||"},"action":"install","deps":[{"type":"package","name":"duckdb-async","version":"0.10.2"}]}}} ns: "conn-manager"

Warning: You need to install "duck-async@0.10.2" to conttect to DuckDB

Action: Install now

Info: "duck-async@0.10.2" installed. Go ahead and connect!

Action: Connect to DuckDB

Repeat from step "2" above

Logs

ERROR (ls): Connecting error: {"code":1000,"data":{"notification":"Core/missingModule","dontNotify":true,"args":{"conn":{"name":"DuckDB2","accessMode":"Read/Write","previewLimit":50,"driver":"DuckDB","databaseFilePath":":memory:","isActive":false,"isConnected":false,"id":"DuckDB2|DuckDB||"},"action":"install","deps":[{"type":"package","name":"duckdb-async","version":"0.10.2"}]}}}
ns: "conn-manager"

System Info

SQLTools Version 0.28.3
VS Code Version: 1.92.0
OS: Windows 10
Driver:
DuckDBDriver for SQLTools Version 1.0.0
Database version: :memory:
Node: node-v19.9.0-x64 or node-v20.16.0-x64

Severity

serious, but I can work around it

Additional Information, or Workarounds

Raise as vscode-sqltools bug and I was advised to raise a bug with the author of the DuckDB driver https://github.com/mtxr/vscode-sqltools/issues/1362

archiewood commented 1 month ago

Moving this across to the correct repo

evx73 commented 1 month ago

I have logged the exception that causes the connection to fail.

exception duckdb-async 0.10.2 Error: Module did not self-register: '\\?\C:\Users\XXXX\AppData\Local\vscode-sqltools\Data\node_modules\duckdb\lib\binding\duckdb.node'.

Do you have any suggestions on how to fix this? I have tried with several versions on nodejs and installed the module several times with no success.

This is the code to log the exception:

checkDependencies() {
....
                } catch (e) {
                  this.log.error(`exception ${dep.name} ${dep.version} ${e}`); // @hack
                  throw new missing_module_1.default(this.deps, this.credentials, mustUpgrade);
                }
evx73 commented 1 month ago

See https://github.com/mtxr/vscode-sqltools/issues/1362#issuecomment-2273371479