Langflow 0.4.0应用卡在思考阶段无响应问题求助
Langflow 0.4.0聊天应用卡住无响应解决方案
问题复现
- 已成功安装Langflow 0.4.0,构建「带提示词与历史记录的基础聊天」应用:在ChatOpenAI面板填入OpenAI密钥,设置input key为text后完成构建。
- 打开聊天界面输入「hello」,应用卡在思考阶段,界面如下:

- 测试其他应用存在相同问题,服务器可正常访问互联网。
关键日志信息
> Entering new ConversationChain chain... Prompt after formatting: The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know. Current conversation: Human: hello AI: /mnt/data/yangpengcheng/miniconda3/envs/langflow/lib/python3.10/site-packages/tenacity/__init__.py:338: RuntimeWarning: coroutine 'AsyncRunManager.on_retry' was never awaited self.before_sleep(retry_state) RuntimeWarning: Enable tracemalloc to get the object allocation traceback [2023-08-07 01:43:05 +0000] [88942] [INFO] ('10.12.186.19', 55850) - "WebSocket /api/v1/chat/6242294b-dad0-4698-a0cf-3766e80dd008" [accepted] [2023-08-07 01:43:05 +0000] [88942] [INFO] connection open > Entering new LLMChain chain... Prompt after formatting: The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know. Current conversation: Human: hello AI: > Entering new LLMChain chain... Prompt after formatting: The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know. Current conversation: Human: hello AI: [2023-08-07 01:51:10 +0000] [88940] [CRITICAL] WORKER TIMEOUT (pid:88942) [2023-08-07 01:51:10 +0000] [89080] [INFO] Booting worker with pid: 89080 [2023-08-07 01:51:10 +0000] [89080] [INFO] Started server process [89080] [2023-08-07 01:51:10 +0000] [89080] [INFO] Waiting for application startup. [2023-08-07 01:51:10 +0000] [89080] [INFO] Application startup complete.
同类问题参考
Reddit社区有用户反馈相同问题:Langflow聊天功能无响应,症状与本次完全一致。
解决方案
从日志看,核心问题是协程未被正确等待引发的RuntimeWarning,最终导致Worker超时崩溃。可按以下步骤排查修复:
- 升级Langflow版本:0.4.0存在已知的异步处理bug,升级到最新稳定版(如0.5.x及以上)可修复该问题。执行命令:
pip install --upgrade langflow
- 调整Worker超时设置:修改Langflow的启动配置,延长超时时间。启动时添加参数:
langflow run --workers 1 --timeout 120
- 验证OpenAI密钥与连通性:确认密钥权限(是否启用目标模型如gpt-3.5-turbo),可通过代码直接调用OpenAI API测试:
import openai openai.api_key = "你的OpenAI密钥" response = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=[{"role": "user", "content": "hello"}]) print(response.choices[0].message.content)
- 强制同步执行:若异步问题仍存在,可切换为同步模式启动Langflow:
langflow run --no-async
内容的提问来源于stack exchange,提问作者pengchy
相关产品推荐
相关产品推荐

