ValueError object is not iterable / vars argument must have __dict__ attribute
Bug Description
The following error is seen with Langflow 1.0.16:
ValueError: [TypeError("'builtin_function_or_method' object is not iterable"), TypeError('vars() argument must have dict attribute')]
This issue leads to failing LF workflows.
2024-09-04 15:05:44.113 | | | us-east-2 | 1858b63c-4888-4066-8812-8aa1b14328df | └ ValueError([TypeError("'builtin_function_or_method' object is not iterable"), TypeError('vars() argument must have __dict__ a...
-- | -- | -- | -- | -- | --
2024-09-04 15:05:44.113 | | | us-east-2 | 1858b63c-4888-4066-8812-8aa1b14328df | │ │ │ │ └ ExceptionGroup('unhandled errors in a TaskGroup', [ValueError([TypeError("'builtin_function_or_method' object is not iterable...
2024-09-04 15:05:44.113 | | | us-east-2 | 1858b63c-4888-4066-8812-8aa1b14328df | └ ValueError([TypeError("'builtin_function_or_method' object is not iterable"), TypeError('vars() argument must have __dict__ a...
2024-09-04 15:05:44.113 | | | us-east-2 | 1858b63c-4888-4066-8812-8aa1b14328df | │ │ │ │ └ ExceptionGroup('unhandled errors in a TaskGroup', [ValueError([TypeError("'builtin_function_or_method' object is not iterable...
2024-09-04 15:05:44.112 | | | us-east-2 | 1858b63c-4888-4066-8812-8aa1b14328df | TypeError: 'builtin_function_or_method' object is not iterable
2024-09-04 15:05:44.085 | error | ERROR | us-east-2 | 1858b63c-4888-4066-8812-8aa1b14328df | 2024-09-04 19:05:44.085 ERROR main.py 178 exception_handler unhandled error: [TypeError("'builtin_function_or_method' object is not iterable"), TypeError('vars() argument must have __dict__ attribute')]
2024-09-04 15:05:39.180 | | | us-east-2 | 1858b63c-4888-4066-8812-8aa1b14328df | ValueError: [TypeError("'builtin_function_or_method' object is not iterable"), TypeError('vars() argument must have __dict__ attribute')]
2024-09-04 15:05:39.180 | | | us-east-2 | 1858b63c-4888-4066-8812-8aa1b14328df | └ [TypeError("'builtin_function_or_method' object is not iterable"), TypeError('vars() argument must have __dict__ attribute')]
2024-09-04 15:05:39.180 | | | us-east-2 | 1858b63c-4888-4066-8812-8aa1b14328df | └ ValueError([TypeError("'builtin_function_or_method' object is not iterable"), TypeError('vars() argument must have __dict__ a...
Reproduction
- Refer to Astra Production customers / with large workflows
Expected behavior
This error should not occur.
Who can help?
@nicoloboschi @zzzming @ogabrielluiz
Operating System
Astra Docker Image / 1.0.16.post4
Langflow Version
1.0.16.post4
Python Version
3.11
Screenshot
No response
Flow File
No response
The error you're encountering in Langflow 1.0.16 is related to the __dict__ attribute and iterable objects. This issue might be influenced by recent changes in the Data class in src/backend/base/langflow/schema/data.py, which has custom implementations for attribute access and manipulation. These custom implementations can interfere with the default behavior of the __dict__ attribute and iterable operations [1].
Additionally, the SequentialTask and HierarchicalTask classes in src/backend/base/langflow/base/agents/crewai/tasks.py handle task groups and task execution, which might be relevant to the reported error [2].
To address this issue, you might want to review the custom attribute access methods in the Data class and ensure that objects passed around in workflows have the necessary __dict__ attribute or are properly iterable.
To continue talking to Dosu, mention @dosu.
@rodageve please add steps to reproduce or more stack trace (if any) otherwise it's impossible to find the root cause, and re-open the issue.