BerriAI / litellm

Python SDK, Proxy Server (LLM Gateway) to call 100+ LLM APIs in OpenAI format - [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropic, Sagemaker, HuggingFace, Replicate, Groq]
https://docs.litellm.ai/docs/
Other
14.16k stars 1.68k forks source link

[Bug]: migration fails when .Values.db.useExisting is true #6791

Open stevencrake-nscale opened 1 week ago

stevencrake-nscale commented 1 week ago

What happened?

When .Values.db.useExisting is true, the migration job is unable to connect to the DB, because the .Values.db.url references env vars that the migration job does not have access to. As a result, the env vars are not replaced, and the url looks like postgresql://$(DATABASE_USERNAME):$(DATABASE_PASSWORD)@$(DATABASE_HOST)/$(DATABASE_NAME) verbatim.

This is because the migration template does not include them, whereas the deployment template does.

I propose that we simply add the missing env vars to the migration template.

Relevant log output

kubectl logs litellm-migrations-xw76p -n litellm --previous
Attempt 1...
Retrying in 10 seconds...
Attempt 2...
Retrying in 10 seconds...
Attempt 3...
Unable to push database changes after 3 retries.

Shelling into the migration job highlights the missing env vars:

root@litellm-migrations-xw76p:/app# env | sort
DATABASE_URL=postgresql://$(DATABASE_USERNAME):$(DATABASE_PASSWORD)@$(DATABASE_HOST)/$(DATABASE_NAME)
DISABLE_SCHEMA_UPDATE=false
...

After this change applied:

kubectl logs litellm-migrations-nw7gh -n litellm
Attempt 1...
Database push successful!

Twitter / LinkedIn details

No response