-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Error in DB migration with PostgreSQL for Langflow v0.6 #1432
Comments
🤖 Hey @mkohei! 🚀 Great to see you back. Hope you're ready for another round of troubleshooting adventure with Langflow! Based on the information you've provided, it seems like you're encountering a similar issue to the ones reported in these two issues: Alembic DB migration error in Langflow v0.6.0 with PostgreSQL and The migration is failed when the database is postgresql. The errors you're seeing, The Here are a few steps you could try:
In the Hotfix 0.6.2 commit that resolved the similar issue, four new columns were added to the 'flow' table, an index was created on the 'user_id' column, and a foreign key was created that references the 'id' column in the 'user' table. You can find more details about these changes in the commit. If these steps do not resolve your issue, could you provide more specific information about your database schema, the migration scripts, and the exact SQL command that is failing? This information could help identify the root cause of the issue. Sources
|
|
Hey @mkohei I'm having trouble with that too lately. I'm considering improving the migration fix script to back up the database first, then rebuilding it and reinserting the data. |
have this issue when deploy a new langflow with empty postgresql database. |
Hello everyone, is there any improvements regarding this problem? I am having same issue lately but didn't have a chance to overcome. Do you have any suggestions or work around? |
Hi everyone. I have release a fix for this in the latest version and managed to get it working locally. Unfortunately, it seems some cases are still not working so what I need from you all is the output of the following: cd src/backend/langflow
LANGFLOW_DATABASE_URL=<your database url here> poetry run alembic check Or, you could just get the output when you run langflow INCLUDING the part where it says: alembic.util.exc.AutogenerateDiffsDetected: New upgrade operations ... |
When I applied this
The result is 024-03-10 15:31:46.072 | DEBUG | langflow.services.manager:_create_service:48 - Create service database_service What I did I created a .env and installed the node and poetry. I create .env file commented out the sqlite database URL and past my postgre db URL as LANGFLOW_DATABASE_URL = xxx . It didn't workout even I cleaned the target database. |
Ok. I think the command might not be correct. Since you know your way around the repo. |
Okay,I did update sqlalchemy.url ... in alembic.ini and then run the same command and here is the result: LANGFLOW_DATABASE_URL=postgresqlxxx poetry run alembic check |
Good. Could try running |
@Alperemrehas If you are ok with dumping the database, I can run the tests with it on my end to get to the bottom of this. You can send it to me on discord. |
@ogabrielluiz Yes, I can try that and let you know. |
Hello everyone, Unfortunantly, I was not able to solve this migration issue. What I tried so far: I pulled a postgre docker and run the docker to create the URL. After that I have updated LANGFLOW_DATABASE_URL to postsql URL. But when I run the poetry run alembic upgrade head command same error occured. The interesting part actually whenever I tried to make backend and frontend after creating .env file it crashes eventhough keeping the database url same didn't make any difference. |
That is so weird. I'm going to get to the bottom of this and update it asap. |
I've updated it and pushed version 0.6.14 |
Had the same issue. Just installed and ran the pre-release version and it's now working. python -m pip install langflow --pre --force-reinstall |
Same issue, once i force-reinstalled the langflow from 0.6 to the pre-release version. |
Hello Gabriel, Thank you for your ongoing support. I wanted to inform you that I've tested version 0.6.14 thoroughly, particularly with .env files containing updated Azure requires the presence of an "@" symbol in PostgreSQL passwords. Unfortunately, during Alembic initialization, the use of a single "%40" to represent "@" failed. To address this, I've implemented a fix in version 0.6.14. I've extensively tested this fix with PostgreSQL passwords containing "@" symbols on Azure resources, and it's functioning impeccably. I believe this fix will alleviate the problem for others encountering the same issue. |
Describe the bug
When using PostgreSQL as the database for Langflow version 0.6, an error occurs during the DB migration process. Despite the log suggesting to run
langflow migration --fix
, executing this command does not resolve the error.Browser and Version
To Reproduce
Steps to reproduce the behavior:
compose.yaml
andDockerfile
.docker compose up
.langflow migration --fix
and note the error persists.Additional context
Directory Structure:
compose.yaml
Dockerfile
Error log at start-up
Error log when running
langflow migration --fix
The text was updated successfully, but these errors were encountered: