altimate-code icon indicating copy to clipboard operation
altimate-code copied to clipboard

Warehouse password silently lost when keyring is not installed

Open mhallida opened this issue 8 months ago • 2 comments

When adding a Snowflake warehouse connection via warehouse_add, the password is silently discarded if the keyring Python package is not installed in the altimate-engine's venv (~/.local/share/altimate-code/engine/venv/).

Root Cause

credential_store.py → save_connection() always sets sensitive fields to null in connections.json and attempts to store them in the OS keychain via keyring. However, _keyring_available() returns False when keyring is not installed, and store_credential() silently returns False — so the password is removed from the JSON file but never persisted anywhere.

Steps to Reproduce

  1. Fresh install of altimate-code via Homebrew on macOS
  2. The engine venv at ~/.local/share/altimate-code/engine/venv/ does not include keyring
  3. Run warehouse_add with Snowflake credentials including a password
  4. connections.json is written with "password": null
  5. warehouse_test fails with 251006: Password is empty
  6. No error or warning is shown to the user during warehouse_add

Expected Behavior

Either:

  • keyring should be bundled as a dependency of the engine venv, OR
  • If keyring is unavailable, fall back to storing the password in connections.json (with a warning about plaintext storage), OR
  • Surface an error at warehouse_add time: "Warning: password could not be saved — keyring package is missing"

Additional Context

  • The MCP server process also caches _keyring_cache = False at the module level (credential_store.py), so even after installing keyring, a full restart of the MCP server is required before it takes effect.
  • snowflake-connector-python was also missing from the engine venv and had to be manually installed.

Workaround

Manually install keyring into the engine venv:

~/.local/share/altimate-code/engine/venv/bin/python3 -m pip install keyring

Then re-add the connection and restart the MCP server/IDE.


Metadata

Field Value
CLI Version v0.2.5
Platform darwin
Architecture arm64
OS Release 25.3.0
Category bug
Working Directory AI-Tools
Session ID ses_307cc9cbaffexaotgpBFFWoqh6

mhallida avatar Mar 16 '26 22:03 mhallida

Same issue observed in the attached sessions.

Went through /discover -> setup warehouse connection with warehouse.add. Went in a loop trying to solve keyring issues, could not. I had to manually copy+paste the credentials in the json file for it to work.

session-ses_30d0.md session-ses_30123d0.md

arora-saurabh448 avatar Mar 16 '26 23:03 arora-saurabh448

Closing as fixed on main: #1395 preserves saved passwords, and credential-store.ts now returns explicit warnings (shown by warehouse_add) when secure persistence is unavailable. Please reopen if you still see this on v0.12.9 or later.

anandgupta42 avatar Nov 05 '26 21:11 anandgupta42