Skip to content

fix: allow empty password when reloading pgvector-family results - #847

Open
serhiizghama wants to merge 2 commits into
zilliztech:mainfrom
serhiizghama:fix/pg-config-empty-password-reload
Open

fix: allow empty password when reloading pgvector-family results#847
serhiizghama wants to merge 2 commits into
zilliztech:mainfrom
serhiizghama:fix/pg-config-empty-password-reload

Conversation

@serhiizghama

Copy link
Copy Markdown

Closes #831.

If you run pgvector with an empty password (local trust/peer auth, which is the default on a fresh local Postgres), the saved result stores password: "". Reopening that result then blows up with PgVectorConfig Value error, Empty field(s): password and the results page won't render — you have to hand-edit the JSON to add a fake password.

The cause is DBConfig.not_empty_field: it rejects any empty string field, but on the reload path an empty password is legitimate, not a misconfiguration. I added password to the config's _extra_empty_skip set so the guard leaves it alone — the same mechanism tidb and milvus already use, and the same class of reload bug adbpg was fixed for. I also gave password/db_name defaults so older result files that omit those fields rehydrate cleanly.

The reporter hit the same thing on PgVectorScale (it additionally complained about db_name), so I fixed the whole postgres-connection-string family — pgvector, pgvectorscale and alloydb share identical config code and the identical bug.

Tests in tests/test_pgvector_config_roundtrip.py cover the reload shapes (password empty-and-present, and absent) for all three, plus a negative control confirming the empty-field guard still fires for non-credential fields like host. They fail on main and pass here; ruff and black are clean.

A run using an empty password (local trust/peer auth) saves a result whose
db_config carries password="". Reopening it rehydrated the config through
DBConfig.not_empty_field, which rejected the empty password with
"Empty field(s): password" and made the results page fail to load.

Skip password in the empty-field guard for the postgres-connection-string
configs (pgvector, pgvectorscale, alloydb) and give the credential/db_name
fields defaults so older result files that omit them still rehydrate. Mirrors
how tidb, milvus and adbpg already handle this.
@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: serhiizghama
To complete the pull request process, please assign xuanyang-cn after the PR has been reviewed.
You can assign the PR to them by writing /assign @xuanyang-cn in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After a successful pgvector run: "PgVectorConfig Value error, Empty field(s): password"

2 participants