You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To Reproduce
Steps to reproduce the behavior:
graph_config = {
"llm": {
"model_instance": llm_model_instance,
"model_tokens": 128000,
},
"verbose": True,
"headless": True,
"reattempt": True
}
smart_scraper_graph = SmartScraperGraph(
prompt=prompt,
config=graph_config,
schema=None,
source="https://perinim.github.io/"
)
result = smart_scraper_graph.run()
Traceback (most recent call last):
File "C:\Users\malsina\Documents\projects\sql_crew.venv\Lib\site-packages\scrapegraphai\graphs\base_graph.py", line 117, in _set_conditional_node_edges
node.false_node_name = outgoing_edges[1][1].node_name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'node_name'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\malsina\Documents\projects\sql_crew\test_web_scraping.py", line 59, in
smart_scraper_graph = SmartScraperGraph(
^^^^^^^^^^^^^^^^^^
File "C:\Users\malsina\Documents\projects\sql_crew.venv\Lib\site-packages\scrapegraphai\graphs\smart_scraper_graph.py", line 61, in init
super().init(prompt, config, source, schema)
File "C:\Users\malsina\Documents\projects\sql_crew.venv\Lib\site-packages\scrapegraphai\graphs\abstract_graph.py", line 76, in init
self.graph = self._create_graph()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\malsina\Documents\projects\sql_crew.venv\Lib\site-packages\scrapegraphai\graphs\smart_scraper_graph.py", line 274, in _create_graph
return BaseGraph(
^^^^^^^^^^
File "C:\Users\malsina\Documents\projects\sql_crew.venv\Lib\site-packages\scrapegraphai\graphs\base_graph.py", line 78, in init
self._set_conditional_node_edges()
File "C:\Users\malsina\Documents\projects\sql_crew.venv\Lib\site-packages\scrapegraphai\graphs\base_graph.py", line 122, in _set_conditional_node_edges
raise ValueError(
ValueError: Failed to set false_node_name for ConditionalNode 'ConditionalNode'
The error happens because, when 'reattempt' is set to True, the graph configuration creates a ConditionalNode with one of its outgoing edges pointing to None (to represent a terminal/exit branch). However, the core graph logic expects both outgoing edges from a ConditionalNode to point to real nodes, and tries to access node_name on both. This causes the AttributeError you’re seeing, and then a ValueError is raised when the false_node_name can't be set properly see code detailsand graph config.
This design was introduced in the PR you referenced, but it’s not compatible with the current node/graph contract. To work around this, you’d need to ensure that both outgoing edges from the ConditionalNode point to actual nodes. One common pattern is to add a dummy terminal node (like a NoOp or End node) instead of None.
Until the library is updated to handle None as a valid terminal, you’ll hit this error with 'reattempt': True. You can track for updates or consider patching locally by adding a dummy node in place of None in your graph config.
Docs do mention 'reattempt' as a feature example, but the current implementation has this incompatibility.
Error when using reattempt parameter on config.
To Reproduce
Steps to reproduce the behavior:
graph_config = {
"llm": {
"model_instance": llm_model_instance,
"model_tokens": 128000,
},
"verbose": True,
"headless": True,
"reattempt": True
}
smart_scraper_graph = SmartScraperGraph(
prompt=prompt,
config=graph_config,
schema=None,
source="https://perinim.github.io/"
)
result = smart_scraper_graph.run()
Traceback (most recent call last):
File "C:\Users\malsina\Documents\projects\sql_crew.venv\Lib\site-packages\scrapegraphai\graphs\base_graph.py", line 117, in _set_conditional_node_edges
node.false_node_name = outgoing_edges[1][1].node_name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'node_name'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\malsina\Documents\projects\sql_crew\test_web_scraping.py", line 59, in
smart_scraper_graph = SmartScraperGraph(
^^^^^^^^^^^^^^^^^^
File "C:\Users\malsina\Documents\projects\sql_crew.venv\Lib\site-packages\scrapegraphai\graphs\smart_scraper_graph.py", line 61, in init
super().init(prompt, config, source, schema)
File "C:\Users\malsina\Documents\projects\sql_crew.venv\Lib\site-packages\scrapegraphai\graphs\abstract_graph.py", line 76, in init
self.graph = self._create_graph()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\malsina\Documents\projects\sql_crew.venv\Lib\site-packages\scrapegraphai\graphs\smart_scraper_graph.py", line 274, in _create_graph
return BaseGraph(
^^^^^^^^^^
File "C:\Users\malsina\Documents\projects\sql_crew.venv\Lib\site-packages\scrapegraphai\graphs\base_graph.py", line 78, in init
self._set_conditional_node_edges()
File "C:\Users\malsina\Documents\projects\sql_crew.venv\Lib\site-packages\scrapegraphai\graphs\base_graph.py", line 122, in _set_conditional_node_edges
raise ValueError(
ValueError: Failed to set false_node_name for ConditionalNode 'ConditionalNode'
I saw this implemented here: eaa83ed
Am i missing something?
Thanks!
The text was updated successfully, but these errors were encountered: