Hi everyone,
I’m encountering an issue with my CrewAI setup, and I’m hoping someone can help me figure out what’s going wrong. I’m running CrewAI on Windows 11 with the following setup:
- crewai-tools: 0.44.0
- crewai: 0.119.0
- Python: 3.12.8
- Model: groq/meta-llama/llama-4-scout-17b-16e-instruct (I try other LLM like GTP-4o and Gemma2)
The problem I’m facing is that CrewAI seems to be stuck in an infinite loop, continuously running and throwing errors. I’ve attached the relevant logs, and I’ve noticed two distinct error sections popping up, which might be clues to what’s happening.
The most frustrating part is that I can’t pinpoint exactly why it’s happening. I’ve double-checked the installation steps, but no luck in resolving the issue.
Here are the two error sections I’ve noticed:
Error Section 1
Tool Usage Failed
Name: Code Interpreter
Error: Arguments validation failed: 1 validation error for CodeInterpreterSchema
libraries_used
Field required [type=missing, input_value={‘code’: ‘\n# Step 1: Cal…5496’, ‘metadata’: {}}}}, input_type=dict]
For further information visit link
I encountered an error while trying to use the tool. This was the error: Arguments validation failed: 1 validation error for CodeInterpreterSchema
libraries_used
Field required [type=missing, input_value={‘code’: ‘\n# Step 1: Cal…5496’, ‘metadata’: {}}}}, input_type=dict]
For further information visit link.
Tool Code Interpreter accepts these inputs: Tool Name: Code Interpreter
Tool Arguments: {‘code’: {‘description’: ‘Python3 code used to be interpreted in the Docker container. ALWAYS PRINT the final result and the output of the code’, ‘type’: ‘str’}, ‘libraries_used’: {‘description’: ‘List of libraries used in the code with proper installing names separated by commas. Example: numpy,pandas,beautifulsoup4’, ‘type’: ‘list[str]’}}
Tool Description: Interprets Python3 code strings with a final print statement.
Error Section 2
Received None or empty response from LLM call.
An unknown error occurred. Please check the details below.
Error details: Invalid response from LLM call - None or empty.
An unknown error occurred. Please check the details below.
Error details: Invalid response from LLM call - None or empty.
2025-05-12 16:19:13,674 - 24704 - rag_storage.py-rag_storage:138 - ERROR: Error during short_term search: APIStatusError.init() missing 2 required keyword-only arguments: ‘response’ and ‘body’
2025-05-12 16:19:13,874 - 24704 - rag_storage.py-rag_storage:138 - ERROR: Error during entities search: APIStatusError.init() missing 2 required keyword-only arguments: ‘response’ and ‘body’
Console Logs
[2025-05-12 16:19:01][INFO]: Planning the crew execution
Crew: crew
└── Task: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead
Status: Executing Task…
Crew: crew
└── Task: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead
Status: Executing Task…
└── Agent: Task Execution Planner
Status: In Progress
Agent: Task Execution Planner
Status: In Progress
└── Thinking…
Agent: Task Execution Planner
Status: In Progress
Crew: crew
└── Task: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead
Status: Executing Task…
└── Agent: Task Execution Planner
Status: Completed
Crew: crew
└── Task: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead
Assigned to: Task Execution Planner
Status: Completed
└── Agent: Task Execution Planner
Status: Completed
╭────────────────────────────────────────────────────────────────────────────────────────────────── Task Completion ──────────────────────────────────────────────────────────────────────────────────────────────────╮
││
│ Task Completed│
│ Name: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead│
│ Agent: Task Execution Planner│
││
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Crew: crew
├── Task: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead
│ Assigned to: Task Execution Planner
│ Status: Completed
│ └── Agent: Task Execution Planner
│ Status: Completed
└── Task: a4f1f8d5-27dc-46ee-a042-4bfd076b88a9
Status: Executing Task…
2025-05-12 16:19:04,512 - 24704 - rag_storage.py-rag_storage:138 - ERROR: Error during short_term search: APIStatusError.init() missing 2 required keyword-only arguments: ‘response’ and ‘body’
2025-05-12 16:19:04,875 - 24704 - rag_storage.py-rag_storage:138 - ERROR: Error during entities search: APIStatusError.init() missing 2 required keyword-only arguments: ‘response’ and ‘body’
Crew: crew
├── Task: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead
│ Assigned to: Task Execution Planner
│ Status: Completed
│ └── Agent: Task Execution Planner
│ Status: Completed
└── Task: a4f1f8d5-27dc-46ee-a042-4bfd076b88a9
Status: Executing Task…
└── Agent: Crew Manager
Status: In Progress
Agent: Crew Manager
Task: User has asked: \n\n Bonjour, calcule 156 puis divise par 5 puis enléve 150 et rajoute 1506\n\n Generate the python code to satisfy the user request. The code should be in a valid python format.
The agent should start by understanding the mathematical operations required in the correct order:
- Calculate 15*6.
- Divide the result by 5.
- Subtract 150 from the result.
- Calculate 150*6.
- Add the result of step 4 to the result of step 3.
The agent will then translate these steps into Python code. The steps can be broken down as follows:
- Step 1: result1 = 15 * 6
- Step 2: result2 = result1 / 5
- Step 3: result3 = result2 - 150
- Step 4: result4 = 150 * 6
- Step 5: final_result = result3 + result4
The Python code can be written as:
result1 = 15 * 6
result2 = result1 / 5
result3 = result2 - 150
result4 = 150 * 6
final_result = result3 + result4
print(final_result)
The agent should ensure the code is correct, well-structured, and readable.
Agent: Crew Manager
Status: In Progress
2025-05-12 16:19:05,914 - 24704 - rag_storage.py-rag_storage:138 - ERROR: Error during short_term search: APIStatusError.init() missing 2 required keyword-only arguments: ‘response’ and ‘body’
2025-05-12 16:19:06,114 - 24704 - rag_storage.py-rag_storage:138 - ERROR: Error during entities search: APIStatusError.init() missing 2 required keyword-only arguments: ‘response’ and ‘body’
Crew: crew
├── Task: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead
│ Assigned to: Task Execution Planner
│ Status: Completed
│ └── Agent: Task Execution Planner
│ Status: Completed
└── Task: a4f1f8d5-27dc-46ee-a042-4bfd076b88a9
Status: Executing Task…
├── Agent: Crew Manager
│ Status: In Progress
└── Agent: Python Code Specialist
Status: In Progress
Agent: Python Code Specialist
Task: Generate Python code for the following mathematical operations:
1. Calculate 15*6.
2. Divide the result by 5.
3. Subtract 150 from the result.
4. Calculate 150*6.
5. Add the result of step 4 to the result of step 3.
Agent: Python Code Specialist
Status: In Progress
Crew: crew
├── Task: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead
│ Assigned to: Task Execution Planner
│ Status: Completed
│ └── Agent: Task Execution Planner
│ Status: Completed
└── Task: a4f1f8d5-27dc-46ee-a042-4bfd076b88a9
Status: Executing Task…
├── Agent: Crew Manager
│ Status: In Progress
└── Agent: Python Code Specialist
Status: In Progress
╭──────────────────────────────────────────────────────────────────────────────────────────────────── Tool Error ─────────────────────────────────────────────────────────────────────────────────────────────────────╮
││
│ Tool Usage Failed │
│ Name: Code Interpreter │
│ Error: Arguments validation failed: 1 validation error for CodeInterpreterSchema │
│ libraries_used │
│ Field required [type=missing, input_value={‘code’: ‘\n# Step 1: Cal…5496’, ‘metadata’: {}}}}, input_type=dict] │
│ For further information visit link ││
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Agent: Python Code Specialist
Status: In Progress
Crew: crew
├── Task: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead
│ Assigned to: Task Execution Planner
│ Status: Completed
│ └── Agent: Task Execution Planner
│ Status: Completed
└── Task: a4f1f8d5-27dc-46ee-a042-4bfd076b88a9
Status: Executing Task…
├── Agent: Crew Manager
│ Status: In Progress
└── Agent: Python Code Specialist
Status: In Progress
╭──────────────────────────────────────────────────────────────────────────────────────────────────── Tool Error ─────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Tool Usage Failed │
│ Name: Code Interpreter │
│ Error: Arguments validation failed: 1 validation error for CodeInterpreterSchema │
│ libraries_used │
│ Field required [type=missing, input_value={‘code’: ‘\n# Step 1: Cal…5496’, ‘metadata’: {}}}}, input_type=dict] │
│ For further information visit link │
│ │
│ │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Agent: Python Code Specialist
Status: In Progress
Crew: crew
├── Task: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead
│ Assigned to: Task Execution Planner
│ Status: Completed
│ └── Agent: Task Execution Planner
│ Status: Completed
└── Task: a4f1f8d5-27dc-46ee-a042-4bfd076b88a9
Status: Executing Task…
├── Agent: Crew Manager
│ Status: In Progress
└── Agent: Python Code Specialist
Status: In Progress
╭──────────────────────────────────────────────────────────────────────────────────────────────────── Tool Error ─────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Tool Usage Failed │
│ Name: Code Interpreter │
│ Error: Arguments validation failed: 1 validation error for CodeInterpreterSchema │
│ libraries_used │
│ Field required [type=missing, input_value={‘code’: ‘\n# Step 1: Cal…5496’, ‘metadata’: {}}}}, input_type=dict] │
│ For further information visit link │
│ │
│ │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
I encountered an error while trying to use the tool. This was the error: Arguments validation failed: 1 validation error for CodeInterpreterSchema
libraries_used
Field required [type=missing, input_value={‘code’: ‘\n# Step 1: Cal…5496’, ‘metadata’: {}}}}, input_type=dict]
For further information visit link.
Tool Code Interpreter accepts these inputs: Tool Name: Code Interpreter
Tool Arguments: {‘code’: {‘description’: ‘Python3 code used to be interpreted in the Docker container. ALWAYS PRINT the final result and the output of the code’, ‘type’: ‘str’}, ‘libraries_used’: {‘description’: ‘List of libraries used in the code with proper installing names separated by commas. Example: numpy,pandas,beautifulsoup4’, ‘type’: ‘list[str]’}}
Tool Description: Interprets Python3 code strings with a final print statement.
Agent: Python Code Specialist
Thought: To solve this task, I will follow the steps provided and implement them in Python code. The steps involve basic arithmetic operations: multiplication, division, subtraction, and addition. I will use the Code Interpreter tool to execute the Python code and obtain the final result.
Using tool: Code Interpreter
Tool Input:
“{"code": "\n# Step 1: Calculate 156\nresult1 = 15 * 6\nprint(f", "1": {"result1}": "Step 2: Divide the result by 5\nresult2 = result1 / 5\nprint(f", "2": {"result2}": "Step 3: Subtract 150 from the result\nresult3 = result2 - 150\nprint(f", "3": {"result3}": "Step 4: Calculate 1506\nresult4 = 150 * 6\nprint(f", "4": {"result4}": "Step 5: Add the result of step 4 to the result of step 3\nfinal_result = result3 + result4\nprint(f", "result": {"final_result}": "", "libraries_used": }}}}}}”
Tool Output:
I encountered an error while trying to use the tool. This was the error: Arguments validation failed: 1 validation error for CodeInterpreterSchema
libraries_used
Field required [type=missing, input_value={‘code’: ‘\n# Step 1: Cal…5496’, ‘metadata’: {}}}}, input_type=dict]
For further information visit link.
Tool Code Interpreter accepts these inputs: Tool Name: Code Interpreter
Tool Arguments: {‘code’: {‘description’: ‘Python3 code used to be interpreted in the Docker container. ALWAYS PRINT the final result and the output of the code’, ‘type’: ‘str’}, ‘libraries_used’: {‘description’: ‘List of libraries used in the code with proper installing names separated by commas. Example: numpy,pandas,beautifulsoup4’, ‘type’: ‘list[str]’}}
Tool Description: Interprets Python3 code strings with a final print statement..
Moving on then. I MUST either use a tool (use one at time) OR give my best final answer not both at the same time. When responding, I must use the following format:
Thought: you should always think about what to do
Action: the action to take, should be one of [Code Interpreter, File Writer Tool]
Action Input: the input to the action, dictionary enclosed in curly braces
Observation: the result of the action
This Thought/Action/Action Input/Result can repeat N times. Once I know the final answer, I must return the following format:
Thought: I now can give a great answer
Final Answer: Your final answer must be the great and the most complete as possible, it must be outcome described
Received None or empty response from LLM call.
An unknown error occurred. Please check the details below.
Error details: Invalid response from LLM call - None or empty.
An unknown error occurred. Please check the details below.
Error details: Invalid response from LLM call - None or empty.
2025-05-12 16:19:07,979 - 24704 - rag_storage.py-rag_storage:138 - ERROR: Error during short_term search: APIStatusError.init() missing 2 required keyword-only arguments: ‘response’ and ‘body’
2025-05-12 16:19:08,220 - 24704 - rag_storage.py-rag_storage:138 - ERROR: Error during entities search: APIStatusError.init() missing 2 required keyword-only arguments: ‘response’ and ‘body’
Crew: crew
├── Task: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead
│ Assigned to: Task Execution Planner
│ Status: Completed
│ └── Agent: Task Execution Planner
│ Status: Completed
└── Task: a4f1f8d5-27dc-46ee-a042-4bfd076b88a9
Status: Executing Task…
├── Agent: Crew Manager
│ Status: In Progress
├── Agent: Python Code Specialist
│
│ Status: In Progress
└── Agent: Python Code Specialist
Status: In Progress
Agent: Python Code Specialist
Task: Generate Python code for the following mathematical operations:
1. Calculate 15*6.
2. Divide the result by 5.
3. Subtract 150 from the result.
4. Calculate 150*6.
5. Add the result of step 4 to the result of step 3.
Agent: Python Code Specialist
Status: In Progress
Crew: crew
├── Task: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead
│ Assigned to: Task Execution Planner
│ Status: Completed
│ └── Agent: Task Execution Planner
│ Status: Completed
└── Task: a4f1f8d5-27dc-46ee-a042-4bfd076b88a9
Status: Executing Task…
├── Agent: Crew Manager
│ Status: In Progress
├── Agent: Python Code Specialist
│
│ Status: In Progress
└── Agent: Python Code Specialist
Status: In Progress
╭──────────────────────────────────────────────────────────────────────────────────────────────────── Tool Error ─────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Tool Usage Failed │
│ Name: Code Interpreter │
│ Error: Arguments validation failed: 1 validation error for CodeInterpreterSchema │
│ libraries_used │
│ Input should be a valid list [type=list_type, input_value=‘’, input_type=str] │
│ For further information visit link │
│ │
│ │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Agent: Python Code Specialist
Status: In Progress
Crew: crew
├── Task: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead
│ Assigned to: Task Execution Planner
│ Status: Completed
│ └── Agent: Task Execution Planner
│ Status: Completed
└── Task: a4f1f8d5-27dc-46ee-a042-4bfd076b88a9
Status: Executing Task…
├── Agent: Crew Manager
│ Status: In Progress
├── Agent: Python Code Specialist
│
│ Status: In Progress
└── Agent: Python Code Specialist
Status: In Progress
╭──────────────────────────────────────────────────────────────────────────────────────────────────── Tool Error ─────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Tool Usage Failed │
│ Name: Code Interpreter │
│ Error: Arguments validation failed: 1 validation error for CodeInterpreterSchema │
│ libraries_used │
│ Input should be a valid list [type=list_type, input_value=‘’, input_type=str] │
│ For further information visit link │
│ │
│ │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Agent: Python Code Specialist
Status: In Progress
Crew: crew
├── Task: 857d2e9f-e0c8-4aa5-a4a7-6192d0576ead
│ Assigned to: Task Execution Planner
│ Status: Completed
│ └── Agent: Task Execution Planner
│ Status: Completed
└── Task: a4f1f8d5-27dc-46ee-a042-4bfd076b88a9
Status: Executing Task…
├── Agent: Crew Manager
│ Status: In Progress
├── Agent: Python Code Specialist
│
│ Status: In Progress
└── Agent: Python Code Specialist
Status: In Progress
╭──────────────────────────────────────────────────────────────────────────────────────────────────── Tool Error ─────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Tool Usage Failed │
│ Name: Code Interpreter │
│ Error: Arguments validation failed: 1 validation error for CodeInterpreterSchema │
│ libraries_used │
│ Input should be a valid list [type=list_type, input_value=‘’, input_type=str] │
│ For further information visit link │
│ │
│ │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
I encountered an error while trying to use the tool. This was the error: Arguments validation failed: 1 validation error for CodeInterpreterSchema
libraries_used
Input should be a valid list [type=list_type, input_value=‘’, input_type=str]
For further information visit link.
Tool Code Interpreter accepts these inputs: Tool Name: Code Interpreter
Tool Arguments: {‘code’: {‘description’: ‘Python3 code used to be interpreted in the Docker container. ALWAYS PRINT the final result and the output of the code’, ‘type’: ‘str’}, ‘libraries_used’: {‘description’: ‘List of libraries used in the code with proper installing names separated by commas. Example: numpy,pandas,beautifulsoup4’, ‘type’: ‘list[str]’}}
Tool Description: Interprets Python3 code strings with a final print statement.
Code
import os
from crewai import Agent, Crew, Process, Task, LLM
from crewai.project import CrewBase, agent, crew, task
from agentic_rag.tools.weaviate_tool import WeaviateTool
from crewai_tools import CodeInterpreterTool, FileWriterTool
from dotenv import load_dotenv
load_dotenv()
@CrewBase
class AgenticCrew:
llm = LLM(model="groq/meta-llama/llama-4-scout-17b-16e-instruct", api_key=os.getenv("GROQ_API_KEY"))
code_tool = CodeInterpreterTool(unsafe_mode=True)
file_writer_tool = FileWriterTool()
@agent
def code_specialist(self) -> Agent:
return Agent(
config=self.agents_config["code_specialist"],
verbose=True,
llm=self.llm,
allow_code_execution=True,
allow_delegation=False,
tools=[
self.code_tool,
self.file_writer_tool,
],
)
@task
def code_creation_task(self) -> Task:
"""Task to create code"""
return Task(
config=self.tasks_config["code_creation_task"],
)
@task
def code_execution_task(self) -> Task:
"""Task to execute code"""
return Task(
config=self.tasks_config["code_execution_task"],
)
@crew
def crew(self) -> Crew:
return Crew(
agents=self.agents,
tasks=self.tasks,
process=Process.hierarchical,
verbose=True,
manager_llm=self.llm,
memory=True,
planning=True,
planning_llm=self.llm,
max_rpm=30,
)
I’ve tried restarting the setup, but the infinite loop persists. Has anyone else encountered similar behavior with this setup? Any guidance or tips on how to troubleshoot this would be greatly appreciated!
Thanks in advance!