Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DB migration erro with Azure PostgreSQL Password with Langflow v0.6.14 #1711

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

Alperemrehas
Copy link
Contributor

Description

This pull request addresses an issue encountered when connecting a PostgreSQL database on Azure, where Azure requires an "@" symbol in all database usernames. Previously, changing passwords containing "@" was a workaround, but it's no longer feasible. Consequently, the migration process failed. To resolve this, a fix has been applied to handle passwords containing "@" by replacing "@" with "%40" in the code.

However, during the initialization of Alembic migrations, a single "%" symbol caused failure. This pull request resolves this issue by replacing single "%" with "%%".

Changes Made

  • Modified the DatabaseService class in service.py to handle passwords containing "@" by replacing "@" with "%40" in the database URL.
  • Adjusted the alembic_cfg.set_main_option("sqlalchemy.url", self.database_url.replace('%', '%%')) line to replace single "%" with "%%" to prevent initialization failure during Alembic migrations.

Related Issues

Error in DB migration with PostgreSQL for Langflow v0.6 #1432

Checklist

  • Tested the changes locally

Copy link

vercel bot commented Apr 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langflow ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 16, 2024 8:20pm

Copy link
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @Alperemrehas

One quick note: v0.6.14 is the main branch. This is the dev branch. We should fix this in the dev too but I'm just not sure if this is what you intended to do.

LGTM, so I'm merging it to start utilizing the fix in the 1.0 alpha.

@ogabrielluiz ogabrielluiz merged commit 24d5c48 into langflow-ai:dev Apr 18, 2024
5 of 9 checks passed
@Alperemrehas
Copy link
Contributor Author

Thanks for the PR, @Alperemrehas

One quick note: v0.6.14 is the main branch. This is the dev branch. We should fix this in the dev too but I'm just not sure if this is what you intended to do.

LGTM, so I'm merging it to start utilizing the fix in the 1.0 alpha.

Thank you Gabriel,

Actually, my bad I did missed that it should be with the dev. So if it is not needed to replicate that for dev, I could work on dev later on. If it is needed I can fork and create a PR for dev either.

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.

2 participants