apache / apache/tooling-llmao

make db rotates the Postgres password on every run

Open Beginner friendly
#20 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

`bin/setup_litellm_db.py:133` generates a fresh password on every invocation
and `ALTER ROLE`s it, then prints the `database_url` for manual pasting into
`litellm.yaml`.

So running `make db` twice — or after any unrelated config edit — silently
breaks a working `litellm.yaml`. The failure surfaces as:

```
Authentication failed against database server at `127.0.0.1`,
the provided database credentials for `llmao` are not valid.
```

which points at credentials rather than at the script that changed them. The
proxy gets far enough to register both models from YAML before dying, so the
config looks fine.

**Fix:** read the existing password out of `litellm.yaml` when one is present
and reuse it, generating only when the role does not exist. Or write the value
back into `litellm.yaml` rather than printing it.

**Workaround:** re-run `make db` and paste the new `database_url`, or set the
role to match the file already in place:

```bash
sudo -u postgres psql -c "ALTER ROLE llmao PASSWORD ''"
```

Not an issue under Puppet — the manifest generates the password from eyaml and
creates the role with it, so the two cannot drift.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with bin/setup_litellm_db.py:133 and inspect how it generates and applies the password, then check the existing database_url in litellm.yaml. Run make db twice with an existing role and configuration; done means the second run does not invalidate the credentials used by litellm.yaml and the proxy can authenticate.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
databases, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.