Config error running crew locally: AttributeError: 'function' object has no attribute 'get'

I created an empty template project using crewai create. I changed it to hierarchical, edited the yaml files, updated the crew.py file. I ran into several issues with the template (e.g. agent and expected_output missing from task.yaml). Now I am stuck with an error in the initialization of Crew class. When running ‘crewai run’. I get the error:
AttributeError: ‘function’ object has no attribute ‘get’

With this stack trace:
Traceback (most recent call last):
File “/.venv/bin/run_crew”, line 8, in
sys.exit(run())
^^^^^
File “/src/okr_crew/main.py”, line 23, in run
OkrCrew().crew().kickoff(inputs=inputs)
^^^^^^^^^^^^^^^^
File “/.venv/lib/python3.12/site-packages/crewai/project/utils.py”, line 7, in memoized_func
cache[key] = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/.venv/lib/python3.12/site-packages/crewai/project/annotations.py”, line 97, in wrapper
crew = func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/src/okr_crew/crew.py”, line 56, in crew
return Crew(
^^^^^
File “/okr_crew/.venv/lib/python3.12/site-packages/pydantic/main.py”, line 214, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/.venv/lib/python3.12/site-packages/crewai/agents/agent_builder/base_agent.py”, line 137, in process_model_config
return process_config(values, cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/.venv/lib/python3.12/site-packages/crewai/utilities/config.py”, line 19, in process_config
config = values.get(“config”, {})
^^^^^^^^^^
AttributeError: ‘function’ object has no attribute ‘get’
An error occurred while running the crew: Command ‘[‘uv’, ‘run’, ‘run_crew’]’ returned non-zero exit status 1.

Any idea on how I could try to understand the root cause of this issue?
How to best run ‘crewai run’ in debug mode from VSCode so that I can figure out what is going on under the hood?
Am I doing something completely wrong in the setup

3 Likes

+1 i am seeing a similiar stacktrace:

Traceback (most recent call last):
  File "/Users/dannomayer/code/monorepo/python/riskers/src/riskers/main.py", line 24, in run
    Riskers().crew().kickoff(inputs=inputs)
    ^^^^^^^^^^^^^^^^
  File "/Users/dannomayer/code/monorepo/python/riskers/.venv/lib/python3.11/site-packages/crewai/project/utils.py", line 11, in memoized_func
    cache[key] = func(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dannomayer/code/monorepo/python/riskers/.venv/lib/python3.11/site-packages/crewai/project/annotations.py", line 95, in wrapper
    task_instance = task_method(self)
                    ^^^^^^^^^^^^^^^^^
  File "/Users/dannomayer/code/monorepo/python/riskers/.venv/lib/python3.11/site-packages/crewai/project/utils.py", line 11, in memoized_func
    cache[key] = func(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dannomayer/code/monorepo/python/riskers/.venv/lib/python3.11/site-packages/crewai/project/annotations.py", line 28, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dannomayer/code/monorepo/python/riskers/src/riskers/crew.py", line 69, in map_task
    return Task(
           ^^^^^
  File "/Users/dannomayer/code/monorepo/python/riskers/.venv/lib/python3.11/site-packages/pydantic/main.py", line 214, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dannomayer/code/monorepo/python/riskers/.venv/lib/python3.11/site-packages/crewai/task.py", line 196, in process_model_config
    return process_config(values, cls)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dannomayer/code/monorepo/python/riskers/.venv/lib/python3.11/site-packages/crewai/utilities/config.py", line 19, in process_config
    config = values.get("config", {})
             ^^^^^^^^^^
AttributeError: 'function' object has no attribute 'get'

answered here