langflow-ai / langflow

Langflow is a low-code app builder for RAG and multi-agent AI applications. It’s Python-based and agnostic to any model, API, or database.
http://www.langflow.org
MIT License
31.93k stars 3.94k forks source link

Error building "SQL Executor" component #4127

Open SavvySupport opened 6 days ago

SavvySupport commented 6 days ago

Bug Description

We were using V1.0.16. The SQL Executor component was working fine.

We upgraded to version V1.0.19. Since then, we've had issues with the "SQL Executor" component.

When we click on the "play" button on the SQL Executor component, it says:

'SQLExecutorComponent' object has no attribute 'set_event_manager'

The component output shows the following: Traceback (most recent call last): File "/langflow/venv/lib/python3.10/site-packages/langflow/api/v1/chat.py", line 219, in _build_vertex vertex_build_result = await graph.build_vertex( File "/langflow/venv/lib/python3.10/site-packages/langflow/graph/graph/base.py", line 1384, in build_vertex await vertex.build( File "/langflow/venv/lib/python3.10/site-packages/langflow/graph/vertex/base.py", line 832, in build await step(user_id=user_id, event_manager=event_manager, **kwargs) File "/langflow/venv/lib/python3.10/site-packages/langflow/graph/vertex/base.py", line 498, in _build self._custom_component.set_event_manager(event_manager) AttributeError: 'SQLExecutorComponent' object has no attribute 'set_event_manager'

Reproduction

  1. Enter in fields for the SQL Executor component (Database URL, query)
  2. Click on the "play" button to run the component

Expected behavior

It would run the query with no error messages previously on V1.0.16. The standard "tick" would show on the component to show it running properly.

Who can help?

No response

Operating System

macOS Ventura 13.5.1

Langflow Version

V1.0.19

Python Version

3.10

Screenshot

https://prnt.sc/eInlqX0wlqqF, https://prnt.sc/wKBejoiFS4-h

Flow File

No response

dosubot[bot] commented 6 days ago

The AttributeError you're encountering with the SQLExecutorComponent in version V1.0.19 is due to the absence of the set_event_manager method, which was likely present in version V1.0.16. This method is used to assign an EventManager instance to the component for handling events [1].

To resolve this issue, you can:

  1. Check for Updates: Look for any updates or patches that might address this issue in the latest version.
  2. Modify Code: If you have access to the code, you could add a placeholder set_event_manager method to the SQLExecutorComponent to bypass the error temporarily.
  3. Revert to V1.0.16: If the above options are not feasible, consider reverting to version V1.0.16 where the component was functioning correctly.

These steps should help you address the error until a more permanent fix is available.

To continue talking to Dosu, mention @dosu.

tonnyESP commented 4 days ago

👋 Same issue here!

I've tried updating the component code, following the guidelines. No errors are returned, but I still get the message: "Please build the component first" when I "play" the node.

Gluepower commented 3 days ago

I have this issue with every custom component I have build. image