FlowiseAI / Flowise

Drag & drop UI to build your customized LLM flow
https://flowiseai.com
Apache License 2.0
29.74k stars 15.32k forks source link

[BUG] message stopped and Error: Cannot read properties of undefined (reading 'length') #2899

Open castorinop opened 1 month ago

castorinop commented 1 month ago

Describe the bug I follow a video demo that how create a Software development team with agents.

To Reproduce Steps to reproduce the behavior:

  1. import Software Development Team Agents.json

  2. run chat

  3. ask "Build a To Do list app"

  4. chat:

AI

Hi there! How can I help? Me

build a to do list app AI agentPNG Supervisor

Build a to-do list app agentPNG Product Designer

To-Do List App Design Requirements

Overview

The To-Do List App is a mobile and web application designed to help users manage their tasks and increase productivity. The app will allow users to create, organize, and prioritize their to-do lists, set reminders, and track their progress.

Core Features

Task Management
    Users can create new tasks with description, due date, and priority level (low, medium, high)
    Tasks can be organized into categories (folders) and subcategories
    Users can add attachments to tasks (photos, documents, etc.)
Task List View
    A list view of all tasks, filtered by category, priority, and due date
    Users can toggle tasks as completed
Reminders
    Users can set reminders for tasks, with customizable notification times and frequencies (e.g., daily, weekly)
    Reminders can be sent via email, push notifications, or in-app notifications
Customization
    Users can customize their task list view with sorting, filtering, and grouping options
    Users can change their theme, font size, and other visual settings
Syncing and Backup
    Tasks will be synced across devices via cloud storage (Google Drive, Dropbox, etc.)
    Users can export their task list to CSV or PDF for backup or sharing
Integrations
    Integration with popular calendar apps (Google Calendar, Apple Calendar, etc.) for automatic task synchronization
    Integration with productivity apps (Trello, Asana, etc.) for seamless task management

User Interface

Home Screen
    A clean and simple home screen with a prominent task list view
    Tap-to-create interface for adding new tasks
Task Detail Screen
    A detailed view of selected tasks with editable fields (description, due date, priority)
    Attachment display and editing functionality
Settings Screen
    A dedicated settings screen for theme, font size, and other customizations
    Syncing and backup options (cloud storage, export, etc.)

Technical Requirements

Backend
    Use a cloud-based backend (Firebase, AWS, etc.) for task storage and syncing
    Implement RESTful API for task management and integration with other apps
Frontend
    Build the UI using a popular frontend framework (React, Angular, etc.)
    Use a mobile-optimized CSS framework (Bootstrap, Material-UI, etc.)

Mockup

Here's a rough mockup of the To-Do List App UI:

Home Screen

Task list view with tap-to-create interface
Filter and sorting options
Prominent call-to-action for adding new tasks

Task Detail Screen

Task summary with editable fields
Attachment display and editing functionality

Settings Screen

Theme picker
Font size slider
Syncing and backup options

Next Steps

Develop the core features and UI components
Implement task management and syncing functionality
Integrate with calendar and productivity apps
Conduct user testing and gather feedback
Iterate on design and functionality based on feedback

This design meets the core requirements for the To-Do List App. The next steps involve developing the UI components and implementing the core features. agentPNG Supervisor

Design the UI for the To-Do List App agentPNG Product Designer

Next Steps: Design Development

Based on the design requirements, I will focus on developing the UI components and implementing the core features.

Task Management Component

I will design a reusable Task Management component that includes:

Task summary with editable fields (description, due date, priority)
Attachment display and editing functionality
Filter and sorting options

jsx

// TaskManagement.js import React from 'react'; import { Feather } from 'react-feather';

const TaskManagement = ({ task, onEdit, onDelete }) => { return (

{task.name}

{task.description}

Due Date: {task.dueDate}

Priority: {task.priority}

{task.attachments.map((attachment, index) => ( {attachment.name} ))}

); };

export default TaskManagement;

Task List Component

I will design a Task List component that includes:

List view of all tasks
Filtering and sorting options
Toggle for completing tasks

jsx

// TaskList.js import React from 'react'; import { Feather } from 'react-feather';

const TaskList = ({ tasks, onToggle, onFilter }) => { return (

Task List

    {tasks.map((task, index) => (
  • console.log('Edit task')} onDelete={() => console.log('Delete task')} />
  • ))}

); };

export default TaskList;

Settings Component

I will design a Settings component that includes:

Theme changer
Font size slider
Syncing and backup options

jsx

// Settings.js import React from 'react'; import { Feather } from 'react-feather';

const Settings = () => { return (

Settings

); };

export default Settings;

Home Component

I will design a Home component that includes:

Home screen with task list view
Tap-to-create interface for adding new tasks

jsx

// Home.js import React from 'react'; import { Feather } from 'react-feather'; import TaskList from './TaskList';

const Home = () => { return (

Home

); };

export default Home;

This is a basic implementation of the UI components and core features of the To-Do List App. The next steps involve integrating the components, implementing the backend API, and conducting user testing.

AI

Cannot read properties of undefined (reading 'length')

6. get error "message stopped"
7. log error

flowise-1 | 2024-07-28 19:55:31 [INFO]: ⬆️ POST /api/v1/internal-prediction/2fd02c0e-d0ed-42cb-b0c8-742b26329a90 flowise-1 | 2024-07-28 19:55:31 [INFO]: [server]: Chatflow 2fd02c0e-d0ed-42cb-b0c8-742b26329a90_38348c3b-1073-4cdb-84c3-cdf2de3526cd added into ChatflowPool flowise-1 | 2024-07-28 19:55:38 [ERROR]: [server]: Error: Cannot read properties of undefined (reading 'length') flowise-1 | TypeError: Cannot read properties of undefined (reading 'length') flowise-1 | at utilBuildAgentResponse (/usr/src/packages/server/dist/utils/buildChatflow.js:388:33) flowise-1 | at async utilBuildChatflow (/usr/src/packages/server/dist/utils/buildChatflow.js:159:20) flowise-1 | at async createInternalPrediction (/usr/src/packages/server/dist/controllers/internal-predictions/index.js:7:29) flowise-1 | 2024-07-28 19:55:38 [ERROR]: [server]: Error: Cannot read properties of undefined (reading 'length') flowise-1 | Error: Cannot read properties of undefined (reading 'length') flowise-1 | at utilBuildAgentResponse (/usr/src/packages/server/dist/utils/buildChatflow.js:451:15) flowise-1 | at async utilBuildChatflow (/usr/src/packages/server/dist/utils/buildChatflow.js:159:20) flowise-1 | at async createInternalPrediction (/usr/src/packages/server/dist/controllers/internal-predictions/index.js:7:29)



**Setup**

Escenario 1:
-   Installation docker flowise/flowise (2.0.1)
-   Browser Firefox

Escenario 2:
-   build docker image from main@e39fd130d0836a1b1dc6c4027552deddd854c7fe
-   Browser Firefox

both with the same error. 

EDIT: in the [Software Development Team Agents.json](https://github.com/user-attachments/files/16404992/Software.Development.Team.Agents.json)  file the LLM temperature should be 0.
chrisagon commented 1 month ago

I have the same issue.

HenryHengZJ commented 1 month ago

Yes, that happens because the LLM is actually not giving any output. If you turn on the analytic using langsmith/langfuse or others, you will see that.

You will need to use a "smarter" model

myronmcm commented 1 month ago

Thanks @HenryHengZJ

Re: Smarter Model I am currently getting this this using 4o, and I will need to verify, but I feel like I also saw it it with Sonnet 3.5 as well (don't quote me).

One thing to add, is that the state of the message window breaks when this happens as well. If you close and reopen it after this issue the messages generated before the failure disappear and you may need to clear the chat several times to get it to render and act properly.

mrode-velera commented 1 month ago

I'm getting the same error and it seems to work sometimes and sometimes it fails. I'm using ChatGoogleGenerativeAI in my flow. Error: predictionsServices.buildChatflow - Cannot read properties of undefined (reading 'length')

blissiraDC commented 1 month ago

Also getting this out of nowhere, using Prompt Engineering Team running on Groq - Llama 3.1 70b - not had an issue with it until now. It was working fine.

Error: predictionsServices.buildChatflow - Cannot read properties of undefined (reading 'length')

blissiraDC commented 1 month ago

Update GPT 4o does indeed throw out this error but then still continues with the request, and produces one empty Agent Messages bubble, and one completed agent message bubble, not sure if that helps locate the bug? @HenryHengZJ

bjoernrenzel-optadata commented 1 month ago

I have the same issue and would appreciate a solution

blissiraDC commented 4 weeks ago

Tried many models, have the same issue with all of them at this point.

Hosselo commented 4 weeks ago

I also have the same issue, was looking for a solution.

xor83 commented 3 weeks ago

I made the necessary adjustments by removing all special characters, indentations, and single quotes from the supervisor and worker node prompt text. After these updates, it seems to be working fine on my end, but I'm not sure—maybe it will work for you as well.

blissiraDC commented 3 weeks ago

@xor83 Great! Thanks for the update, I will try this. But @HenryHengZJ this seems to be a widespread problem. For me the problem got worse to the point where every chat model, smarter or not, now returns this error in Sequential Agents / Agentflows

blissiraDC commented 3 weeks ago

This does not seem to be getting picked up but is a major bug, effecting many users. Maybe we all make a separate post on this it will be picked up?

HenryHengZJ commented 3 weeks ago

I think to solve this problem, what we can do is to add a retry mechanism or a fallback failed message. Because the underlying issue is that LLM does not give any output, hence causing the error.

mrode-velera commented 3 weeks ago

If the LLM is the issue by not generating output, how do I understand what it's being asked to do and what is being returned?

tehmann83 commented 3 weeks ago

Same here. Nothing works. All I get is "Cannot read properties of undefined (reading 'length')"

Did somebody make ANY progress on this?

toi500 commented 3 weeks ago

@HenryHengZJ

I am having the same error, but still working (locally and cloud)

image image

nextgen101 commented 3 weeks ago

If it helps this is what shows in Langsmith:

metadata: {}

runtime library: "langchain-js"

RENDER_GIT_COMMIT: "8bb55e07b63d12407fccf66dd04e83bf7d72e67c"

runtime: "node"

sdk: "langsmith-js"

sdk_version: "0.1.6"

Run:

Aborted!

Error: Aborted! at agentNode (/usr/src/packages/components/dist/nodes/multiagents/Supervisor/Supervisor.js:614:15) at async RunnableLambda.supervisorNode [as func] (/usr/src/packages/components/dist/nodes/multiagents/Supervisor/Supervisor.js:582:57) at async /usr/src/node_modules/.pnpm/@langchain+core@0.2.18langchain@0.2.11@aws-sdk+client-s3@3.529.1_@aws-sdk+credential-provid_7neqxdzwpbrflib37usagtazcm/node_modules/@langchain/core/dist/runnables/base.cjs:1513:34

park150n5 commented 2 weeks ago

I'm having the same issue, new to flowise and really can't help but from what I've read here it seems to be affecting alot of people

iatcteam commented 1 week ago

Completely new to Flowise. Was keen to try it for the multi-agent function, but unfortunately, running into this same issue.

HenryHengZJ commented 1 week ago

If the LLM is the issue by not generating output, how do I understand what it's being asked to do and what is being returned?

you can turn on the the analytics for that. if anyone can send me an analytic trace link that would be great. Perhaps @nextgen101 if you have one