cmoog / vscode-sql-notebook

Open SQL files as VSCode Notebooks.
https://marketplace.visualstudio.com/items?itemName=cmoog.sqlnotebook
MIT License
123 stars 16 forks source link

Unable to reconnect to passwordless database #18

Closed scsmithr closed 2 years ago

scsmithr commented 2 years ago

When attempting to reconnect to a passwordless postgres database after closing and reopening vscode, I get the following error: image

Steps to reproduce

  1. Setup a postgres database configured to not use a password (e.g. via docker: docker run --rm --name sql-notebook -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:14).
  2. Configure the connection in the SQL notebook panel. Values I used with the above docker container:
    • Display Name: sql-notebook
    • Database Driver: postgres
    • Database Host: 172.17.0.2
    • Database Port: 5432
    • Database User: postgres
    • Database Password: (empty)
    • Database Name: postgres
  3. Try to connect to this database. This does work.
  4. Close and reopen vscode. Attempt to use the connection previously configured. Observe the "Connection password not found in the secret store" error.

Misc info

No other extensions are installed, and I'm using a completely stock configuration for vscode.

cmoog commented 2 years ago

I'm having difficulty reproducing this behavior on the versions given. Out of curiosity, are you able to configure a nonempty password such that it properly persists between sessions?

scsmithr commented 2 years ago

Welp, turns out I can't configure a connection with a password and have it persist. I get the same error when trying to connect.

cmoog commented 2 years ago

Ah ok. Maybe the secret store behaves differently between platforms. Are you running vscode on Linux?

scsmithr commented 2 years ago

Yeah, so seems vscode is using the keytar lib which tries to communicate with whatever keychain service is running. Except I don't use a keychain service...

Idk how you'd want to handle that. I know I'm probably on the fringe with my setup, I'd imagine most people are reasonable and are running with a keychain so this wouldn't affect them.

scsmithr commented 2 years ago

Actually kind of unclear what's going on considering https://github.com/microsoft/vscode/issues/115215