crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

Bug: Error when trying to create a project with multiple Crews

Open wagnerdriva opened this issue 1 year ago • 3 comments

I created a project that would have two crews, one called BoardCrew and another called DataOpsCrew, using the new decorators from the latest version. When he started to install and run the first crew, I received the following error:

   File "/home/wagner/projects/driva/driva-crew-ai/.venv/lib/python3.10/site-packages/crewai/project/annotations.py", line 23, in wrapper
     possible_task = getattr(self, task_name)
AttributeError: 'WrappedClass' object has no attribute 'sql_developer_task'

Looking at the source code, I discovered that it is because it tries to fetch the sql_developer_task from the other crew in the wrapper. This generates the error, since the getattr function returns an error when we do not define a default value. In this case I changed from getattr(self, task_name) to getattr(self, task_name, None).

wagnerdriva avatar Mar 13 '24 20:03 wagnerdriva

I am facing the same issue with multiple crews. defaulting the getattr to None like you stated worked!

mhdhazmi avatar Apr 08 '24 17:04 mhdhazmi

Same issue here.

FixingPixels avatar May 08 '24 17:05 FixingPixels

Facing the same issue . @wagnerdriva - using your workaround of getattr(self, task_name, None) for now. Thanks

tsukhu avatar May 20 '24 10:05 tsukhu

I think we now fixed this in main, would you folks mind double checking this in case?

joaomdmoura avatar Jul 06 '24 05:07 joaomdmoura

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Aug 20 '24 10:08 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Aug 25 '24 12:08 github-actions[bot]