Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error detecting node runtime #1283

Open
2 of 5 tasks
giggio opened this issue Feb 15, 2024 · 4 comments
Open
2 of 5 tasks

Getting error detecting node runtime #1283

giggio opened this issue Feb 15, 2024 · 4 comments
Labels

Comments

@giggio
Copy link

giggio commented Feb 15, 2024

Describe the bug
I have read through the issues and can't find an answer. I don't know what is happening, but I'm getting the message:

Check Terminal view for an erroring 'detect node runtime' session. Capture details for investigation, then kill the terminal to continue SQLTools extension startup. Change the 'sqltools.useNodeRuntime' setting to disable runtime detection.

Every time code opens.

Logs for sqltools show:

[1707959449029] INFO  (ext): SQLTools is starting
[1707959449033] INFO  (ext): initializing language client...
[1707959449050] INFO  (ext): Detecting node path (if this stalls check Terminal view for the stuck session and kill it)...
    ns: "lc"

This takes about 5 seconds. The terminal shows:

node -e 'require("fs").writeFileSync("/home/user/.local/share/vscode-sqltools/.node-runtime", process.execPath)' && exit 0                                                                                     

~/p/sql ❯ 

It seems that the script to set the path at /home/user/.local/share/vscode-sqltools/.node-runtime worked, the file is written with the path to node.
After furter investigating, the file was already there. It is not being recreated. See comment: #1283 (comment)

When I close the terminal the extension then works. I get a notification:

Node runtime auto-detected. Using /home/user/.n/bin/node.

Logs also show it:

[1707959947965] INFO  (ext): Node runtime auto-detected. Using /home/giggio/.n/bin/node.
    ns: "lc"
[1707959947970] INFO  (ext): Registering client for languages [{"scheme":"sqltools"},{"language":"sql","scheme":"untitled"},{"language":"sql","scheme":"file"},{"language":"sql","scheme":"sqltools"}]
    ns: "lc"

(log continues after this)

To Reproduce
Steps to reproduce the behavior:

  1. Open Code
  2. See the described behavior

Expected behavior
No error.

Screenshots
N/A

Desktop (please complete the following information):

  • SQLTools Version 0.5.0
  • VS Code Version: `1.86.1
  • OS: Linux (on WSL)
  • Driver:
    • PostgreSQL/Redshift
    • MySQL/MariaDB
    • MSSQL/Azure
    • SQLite
    • Other? Which...
  • Database version: [PostgreSQL 16.2, SQLite 3]

Additional context
It seems to me that the problem is with the terminal, that is not closing.

When using the extension on Windows (same computer, same vscode, as this problem is in WSL) it works.

@giggio giggio added the triage label Feb 15, 2024
@gjsjohnmurray
Copy link
Collaborator

When that stuck terminal appears, does it close if you enter the following command at its prompt?

exit 0

If it does, please repeat the test but this time enter:

date && exit 0

@giggio
Copy link
Author

giggio commented Feb 16, 2024

When that stuck terminal appears, does it close if you enter the following command at its prompt?

exit 0

If it does, please repeat the test but this time enter:

date && exit 0

@gjsjohnmurray In both cases the terminal closes and the process continues as I described, as if I had closed the terminal by clicking on the trash icon.

This is bash:
image

@giggio
Copy link
Author

giggio commented Feb 16, 2024

I notice that it seems that scripts are NOT running.
I just noticed a similar behavior, I tried to open a sqlite file, it asked me to install the npm module sqlite. I agreed, it opened a terminal, and exited. The module was not installed.

image

These are the logs:

[1708123705523] ERROR (ext): ERROR: Failed to install dependencies for SQLite: failed to install, 'failed to install'
    ns: "error-handler"
[1708123709001] INFO  (ext): EXECUTING COMMAND => sqltools.showOutputChannel

After closing the terminal, it was still not working, so it asked again to install, this time I inspected the environment:

image

Then, after closing the terminal, everything worked.

I don't know why that command is failing.

@giggio
Copy link
Author

giggio commented Feb 16, 2024

Ok, I investigated it a little further.
I deleted the ~/.local/share/vscode-sqltools/.node-runtime file. It is NOT being recreated. So this is just like the npm install issue above, the command is not actually running.

The weird thing about this detail is the the extension works fine without the file. After I close the terminal it works just fine and I can open sqlite databases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants