-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Bug: removing projects with associated messages fails with an IntegrityError #5925
Comments
Hey @Naroh091! 👋 I'm here to help you with bugs, questions, and even becoming a contributor. Let's squash those bugs together! The issue you're encountering is due to a foreign key constraint violation when attempting to delete a project with associated messages. The To address this, you have two potential solutions:
Both approaches have their merits. Requesting confirmation provides users with control over data deletion, while transparent deletion simplifies the process by automatically cleaning up related data. Choose the approach that best fits the user experience you want to provide in Langflow. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Hi @Naroh091, I couldn’t reproduce this error locally. I tested it using the latest version of LangFlow (1.1.2) available on uv run langflow run Could you please provide more context on how you’re running LangFlow? Additionally, please ensure you’re using our latest version. You can find instructions on managing LangFlow versions here: [LangFlow Update Guide]. Thanks for your feedback. |
@Cristhianzl I'm running the Docker image connected to the Postgresql container under Ubuntu Server 24.04. It's not a fresh install but an update from 1.1.1 - maybe some migration was missing? I'll try to locally reproduce the issue this week. |
Hi @Naroh091, The issue seems to be related to the "messages" table, which is used to store message history for flows with memory functionality. You can safely delete the records in this table to resolve the immediate problem. The error you're encountering is likely related to a migration issue during the version upgrade. To better diagnose the root cause, I would need to see more detailed logs from your environment. For local development, we provide utility commands to handle database migrations:
Please try these commands and let me know if you need any further assistance or if the issue persists. |
Hello, @Naroh091 I don't think this is a migration issue. I tried to reproduce the problem in my environment using Docker containers for Langflow and Postgres. I deleted the flow through the frontend UI, and everything worked fine. Then, I created a flow on branch v1.1.1, updated to branch v1.1.2, and deleted it again through the UI. Everything worked perfectly once more. Additionally, I tried deleting the flow directly from the database using:
However, the database returned a constraint error that prevented the operation, as expected. In summary, I couldn't reproduce your issue, even when deliberately trying to break things. |
Please follow up this PR with the fix: #6667 |
Bug Description
Hi! First of all, thanks for the amazing work developing Langflow - It's an amazing product.
I just noticed that removing projects with playground messages fails with this toast:
This is because the project has associated relations that are not removed at the time of the request.
I'd be happy to send the fix, but first I'd like if the preferred solution is to request a confirmation when the project to remove has associated messages or if we should delete it transparently.
Thanks!
Reproduction
Steps to reproduce:
Expected behavior
Shouldn't fail, either asking the user for confirmation when messages exist or removing them without confirmation.
Who can help?
No response
Operating System
Ubuntu Server 24.04
Langflow Version
1.1.2
Python Version
3.12
Screenshot
No response
Flow File
No response
The text was updated successfully, but these errors were encountered: