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

in 1.0.14 URGENT : Langflow Front end times out while saving, deletes current workflow #3164

Closed
Arron-Clague opened this issue Aug 2, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@Arron-Clague
Copy link

Bug Description

When the front times out, for example with a save or cancel save, the current workflow is show no components. Logging off and logging in again deletes the flow entirely !

Reproduction

Duplicate an existing flow for safety.
Open the flow
Allow the front end to timeout or save to fail
restart
navigate back to collectoion
navigate to flow : flow is empty
navigate back to collection
Flow is now deleted

Expected behavior

To save correctly and not delete user flows.

Who can help?

@ogabrielluiz
@nicoloboschi
@zzzming
@jordanrfrazier
@mfortman11
@NadirJ

Operating System

Ubuntu 22.04

Langflow Version

1.0.14

Python Version

3.10

Screenshot

No response

Flow File

No response

@Arron-Clague Arron-Clague added the bug Something isn't working label Aug 2, 2024
Copy link

dosubot bot commented Aug 2, 2024

To address the issue in Langflow version 1.0.14 on Ubuntu 22.04 with Python 3.10, where the front end times out during a save or cancel save operation, causing the current workflow to show no components and eventually leading to the flow being deleted after logging off and logging in again, you can try the following steps:

  1. Check Server Logs: Ensure that the backend server logs do not show any errors or warnings during the save or cancel save operations. This can help identify if there are any server-side issues causing the timeout.

  2. Increase Timeout Settings: If the issue is due to a timeout, you can try increasing the timeout settings in the frontend or backend configuration. This can help prevent the operation from timing out before it completes. The default timeout setting for the backend is 60 seconds, which can be configured using the --timeout option or the LANGFLOW_TIMEOUT environment variable. For the frontend, the default timeout setting is 0 seconds, configurable via the LANGFLOW_FRONTEND_TIMEOUT environment variable [1][2][3].

  3. Optimize Database Operations: Ensure that the database operations related to saving the workflow are optimized. Slow database operations can cause timeouts and lead to the issues you are experiencing.

  4. Update Dependencies: Ensure that all dependencies are up to date. Sometimes, issues can be caused by outdated libraries or dependencies.

  5. Check Network Configuration: Ensure that there are no network issues or misconfigurations that could be causing the timeout. This includes checking firewall settings, proxy configurations, and network latency.

  6. Debug Frontend Code: Use browser developer tools to debug the frontend code and identify any issues that may be causing the timeout. Look for any errors or warnings in the console.

  7. Review HAR File: The provided HAR file shows the network requests and responses. Ensure that the requests related to saving the workflow are completing successfully and returning the expected responses [4].

Here is an example of how you might increase the timeout settings in a typical frontend configuration:

// Example of increasing timeout settings in an Axios instance
import axios from 'axios';

const axiosInstance = axios.create({
  baseURL: 'http://localhost:3000/api/v1',
  timeout: 60000, // Set timeout to 60 seconds
  headers: {
    'Content-Type': 'application/json',
  },
});

export default axiosInstance;

If the issue persists after trying these steps, you may need to provide more detailed logs or additional context to further diagnose the problem.

To continue talking to Dosu, mention @dosu.

@Cristhianzl
Copy link
Collaborator

hi @Arron-Clague
I couldn't reproduce this error.
Could you please provide a detailed step by step or a video to us?
Thank you!

@Arron-Clague
Copy link
Author

Hi : I think its a DB migration error : 2024-08-05 08:47:54 - ERROR - service - Error migrating transactions service.py:221
from monitor service to database: (sqlite3.IntegrityError) NOT NULL
constraint failed: transaction.flow_id
[SQL: INSERT INTO "transaction" (timestamp, vertex_id, target_id,
inputs, outputs, status, error, flow_id, id) VALUES (?, ?, ?, ?, ?, ?,
?, ?, ?)]
[parameters: [('2024-07-29 11:53:22.000000', 'ChatInput-y0ZNG', None,
'{"files": [], "code": "from langflow.base.data.utils import
IMG_FILE_TYPES, TEXT_FILE_TYPES\nfrom langflow.base.io.chat import
ChatComponent\nfrom ... (2625 characters truncated) ... = message\n
return message\n", "input_value": "hi", "sender": "User",
"sender_name": "User", "session_id": "", "should_store_message": true}',
'{"results": {"message": {"text_key": "text", "data": {"text": "hi",
"sender": "User", "sender_name": "User", "session_id": "", "files": [],
"timestam ... (668 characters truncated) ... sage"}], "timedelta": null,
"duration": null, "component_display_name": "Chat Input",
"component_id": "ChatInput-y0ZNG", "used_frozen_result": false}',
'success', None, None, '5a5544bfb2574a7ab9859956bbe3d267'), ('2024-07-29
11:53:23.000000', 'ChatInput-y0ZNG', 'OpenAIModel-VJs7s', '{"files": [],
"code": "from langflow.base.data.utils import IMG_FILE_TYPES,
TEXT_FILE_TYPES\nfrom langflow.base.io.chat import ChatComponent\nfrom
... (2625 characters truncated) ... = message\n return
message\n", "input_value": "hi", "sender": "User", "sender_name":
"User", "session_id": "", "should_store_message": true}', '{"results":
{"message": {"text_key": "text", "data": {"text": "hi", "sender":
"User", "sender_name": "User", "session_id": "", "files": [], "timestam
... (668 characters truncated) ... sage"}], "timedelta": null,
"duration": null, "component_display_name": "Chat Input",
"component_id": "ChatInput-y0ZNG", "used_frozen_result": false}',
'success', None, None, '9c74fa2f18064e2b9766047dcd53ae63'), ('2024-07-29
11:53:24.000000', 'OpenAIModel-VJs7s', None, '{"code": "import
operator\nfrom functools import reduce\n\nfrom langchain_openai
import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom l ...
(4688 characters truncated) ... ": "http://10.0.0.205:8999/v1",
"openai_api_key": "11111", "output_schema": {}, "seed": 1, "stream":
false, "system_message": "", "temperature": 0.1}', '{"results": {},
"artifacts": {"text_output": {"repr": "Hi! It's nice to meet you. Is
there something I can help you with or would you like to chat?" ... (374
characters truncated) ... "timedelta": null, "duration": null,
"component_display_name": "KONI Connect (1)", "component_id":
"OpenAIModel-VJs7s", "used_frozen_result": false}', 'success', None,
None, '3da001bd27b544a6b57ed44ffc44c69f'), ('2024-07-29
11:53:24.000000', 'OpenAIModel-VJs7s', 'ChatOutput-6hfYp', '{"code":
"import operator\nfrom functools import reduce\n\nfrom
langchain_openai import ChatOpenAI\nfrom pydantic.v1 import
SecretStr\n\nfrom l ... (4688 characters truncated) ... ":
"http://10.0.0.205:8999/v1", "openai_api_key": "11111", "output_schema":
{}, "seed": 1, "stream": false, "system_message": "", "temperature":
0.1}', '{"results": {}, "artifacts": {"text_output": {"repr": "Hi! It's
nice to meet you. Is there something I can help you with or would you
like to chat?" ... (374 characters truncated) ... "timedelta": null,
"duration": null, "component_display_name": "KONI Connect (1)",
"component_id": "OpenAIModel-VJs7s", "used_frozen_result": false}',
'success', None, None, '2f12bba3b25149ce9b699e8cbece1b85'), ('2024-07-29
11:53:24.000000', 'ChatOutput-6hfYp', None, '{"input_value": "Hi! It's
nice to meet you. Is there something I can help you with or would you
like to chat?", "code": "from langflow.base.io.chat ... (2562
characters truncated) ... ge\n return message\n",
"data_template": "{text}", "sender": "Machine", "sender_name": "AI",
"session_id": "", "should_store_message": true}', '{"results":
{"message": {"text_key": "text", "data": {"text": "Hi! It's nice to
meet you. Is there something I can help you with or would you like t ...
(1131 characters truncated) ... ge"}], "timedelta": null, "duration":
null, "component_display_name": "Chat Output", "component_id":
"ChatOutput-6hfYp", "used_frozen_result": false}', 'success', None,
None, 'a898ee76f9864a25a9480ac9bd573dbd')]]
(Background on this error at: https://sqlalche.me/e/20/gkpj)

@Arron-Clague
Copy link
Author

so : ive backed up my flows via Export all : stopped Langflow, and deleted langflow.db and, re- run create superuser, and still the DB is giving errors : it is still getting corrupt data from somewhere : looks like it from outdated custom components : langflow superuser
Username: arroncx
Password:
[08/05/24 09:55:49] ERROR 2024-08-05 09:55:49 - ERROR - service - Error migrating transactions service.py:221
from monitor service to database: (sqlite3.IntegrityError) NOT NULL
constraint failed: transaction.flow_id
[SQL: INSERT INTO "transaction" (timestamp, vertex_id, target_id,
inputs, outputs, status, error, flow_id, id) VALUES (?, ?, ?, ?, ?, ?,
?, ?, ?)]
[parameters: [('2024-07-29 11:53:22.000000', 'ChatInput-y0ZNG', None,
'{"files": [], "code": "from langflow.base.data.utils import
IMG_FILE_TYPES, TEXT_FILE_TYPES\nfrom langflow.base.io.chat import
ChatComponent\nfrom ... (2625 characters truncated) ... = message\n
return message\n", "input_value": "hi", "sender": "User",
"sender_name": "User", "session_id": "", "should_store_message": true}',
'{"results": {"message": {"text_key": "text", "data": {"text": "hi",
"sender": "User", "sender_name": "User", "session_id": "", "files": [],
"timestam ... (668 characters truncated) ... sage"}], "timedelta": null,
"duration": null, "component_display_name": "Chat Input",
"component_id": "ChatInput-y0ZNG", "used_frozen_result": false}',
'success', None, None, 'f5c330f595db42c2894f04c775f21582'), ('2024-07-29
11:53:23.000000', 'ChatInput-y0ZNG', 'OpenAIModel-VJs7s', '{"files": [],
"code": "from langflow.base.data.utils import IMG_FILE_TYPES,
TEXT_FILE_TYPES\nfrom langflow.base.io.chat import ChatComponent\nfrom
... (2625 characters truncated) ... = message\n return
message\n", "input_value": "hi", "sender": "User", "sender_name":
"User", "session_id": "", "should_store_message": true}', '{"results":
{"message": {"text_key": "text", "data": {"text": "hi", "sender":
"User", "sender_name": "User", "session_id": "", "files": [], "timestam
... (668 characters truncated) ... sage"}], "timedelta": null,
"duration": null, "component_display_name": "Chat Input",
"component_id": "ChatInput-y0ZNG", "used_frozen_result": false}',
'success', None, None, 'ad0415c103df4e2da45c493547ddad12'), ('2024-07-29
11:53:24.000000', 'OpenAIModel-VJs7s', None, '{"code": "import
operator\nfrom functools import reduce\n\nfrom langchain_openai
import ChatOpenAI\nfrom pydantic.v1 import SecretStr\n\nfrom l ...
(4688 characters truncated) ... ": "http://10.0.0.205:8999/v1",
"openai_api_key": "11111", "output_schema": {}, "seed": 1, "stream":
false, "system_message": "", "temperature": 0.1}', '{"results": {},
"artifacts": {"text_output": {"repr": "Hi! It's nice to meet you. Is
there something I can help you with or would you like to chat?" ... (374
characters truncated) ... "timedelta": null, "duration": null,
"component_display_name": "KONI Connect (1)", "component_id":
"OpenAIModel-VJs7s", "used_frozen_result": false}', 'success', None,
None, '86d96c71b64a4ef3adc31e24cff95ef5'), ('2024-07-29
11:53:24.000000', 'OpenAIModel-VJs7s', 'ChatOutput-6hfYp', '{"code":
"import operator\nfrom functools import reduce\n\nfrom
langchain_openai import ChatOpenAI\nfrom pydantic.v1 import
SecretStr\n\nfrom l ... (4688 characters truncated) ... ":
"http://10.0.0.205:8999/v1", "openai_api_key": "11111", "output_schema":
{}, "seed": 1, "stream": false, "system_message": "", "temperature":
0.1}', '{"results": {}, "artifacts": {"text_output": {"repr": "Hi! It's
nice to meet you. Is there something I can help you with or would you
like to chat?" ... (374 characters truncated) ... "timedelta": null,
"duration": null, "component_display_name": "KONI Connect (1)",
"component_id": "OpenAIModel-VJs7s", "used_frozen_result": false}',
'success', None, None, '39e92a1f25804080a5e08807f18da149'), ('2024-07-29
11:53:24.000000', 'ChatOutput-6hfYp', None, '{"input_value": "Hi! It's
nice to meet you. Is there something I can help you with or would you
like to chat?", "code": "from langflow.base.io.chat ... (2562
characters truncated) ... ge\n return message\n",
"data_template": "{text}", "sender": "Machine", "sender_name": "AI",
"session_id": "", "should_store_message": true}', '{"results":
{"message": {"text_key": "text", "data": {"text": "Hi! It's nice to
meet you. Is there something I can help you with or would you like t ...
(1131 characters truncated) ... ge"}], "timedelta": null, "duration":
null, "component_display_name": "Chat Output", "component_id":
"ChatOutput-6hfYp", "used_frozen_result": false}', 'success', None,
None, '777b56bea08e431f8fc895dc8a9e420b')]]
(Background on this error at: https://sqlalche.me/e/20/gkpj)
Default folder created successfully.
Superuser created successfully.

@appoks
Copy link

appoks commented Aug 6, 2024

I had this same issue yesterday and lose my entire flow.

It seems that my flow components' are taking longer than normal to load, and if you do anything that trigger the auto save, the flow will be saved as an empty canvas. I will try to reproduce in a video later today.

@Arron-Clague
Copy link
Author

@appks : Its not a complete solution, but while this gets resolved, backing up the flows via export, deleting langflow.db, and restarting with a new superuser account did get me back running again after re-importing the flows. There are still errors in the DB (as above) but I haven't lost any flows, and the load time issue has gone.

@appoks
Copy link

appoks commented Aug 7, 2024

I think this was solved for the version on 'main'

Here's how I could reproduce this bug on my 1.0.14 version (dockerized install)

2024-08-07.18-43-05.mp4

However, I noticed that the there's a new loading on the version I cloned today, directly from main.

image

Not sure if it's really fixed now, but it seems worth to share;

@appoks
Copy link

appoks commented Aug 7, 2024

For me, the issue happens mostly with the flows that has the load time issue as Arron said. I've tried to break other flows that load more fast and could not break any of them. If the flow takes some secs to load, messing the canvas around will delete the flow.

@lucaseduoli
Copy link
Collaborator

Fixed in the last version! Feel free to test it and open this issue if you find anything wrong!

Thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants