microsoft/autogen · error · Error
Failed to create team
Error message
Failed to create team
What it means
Thrown by TeamAPI.createTeam when POST /teams/ returns falsy status. It force-injects user_id and POSTs the team JSON; failure means backend validation of the team component graph (agents, model configs, termination conditions) or persistence failed.
Source
Thrown at python/packages/autogen-studio/frontend/src/components/views/teambuilder/api.ts:60
);
const data = await response.json();
if (!data.status) throw new Error(data.message || "Failed to fetch team");
return data.data;
}
async createTeam(teamData: Partial<Team>, userId: string): Promise<Team> {
const team = {
...teamData,
user_id: userId,
};
const response = await fetch(`${this.getBaseUrl()}/teams/`, {
method: "POST",
headers: this.getHeaders(),
body: JSON.stringify(team),
});
const data = await response.json();
if (!data.status) throw new Error(data.message || "Failed to create team");
return data.data;
}
async deleteTeam(teamId: number, userId: string): Promise<void> {
const response = await fetch(
`${this.getBaseUrl()}/teams/${teamId}?user_id=${userId}`,
{
method: "DELETE",
headers: this.getHeaders(),
}
);
const data = await response.json();
if (!data.status) throw new Error(data.message || "Failed to delete team");
}
}
// move validationapi to its own class
View on GitHub (pinned to 027ecf0a37)
Solutions
- Read data.message — component validation errors are relayed from the backend
- Complete required team fields: every agent needs a model component; termination must be set
- Test the exact payload with curl against /teams/ to see raw validation output
- If schema drift, rebuild the team in the UI against the current backend version rather than re-POSTing an old export
Defensive patterns
Strategy: validation
Validate before calling
// require every agent to reference a model before saving
function isTeamComplete(team: Partial<Team>): boolean {
const agents = team?.component?.components?.agents ?? [];
return agents.length > 0 && agents.every(a => a?.component?.components?.model != null);
} Try / catch
try {
return await teamAPI.createTeam(teamData, userId);
} catch (e) {
notify(`Team not saved: ${e instanceof Error ? e.message : e}`);
return null;
} Prevention
- Gate the Save button on required team structure (agents have models, termination set)
- Keep exported team JSON versioned; re-validate against the current backend schema on import
- Send only fields defined by the backend Team model
When it happens
Trigger: POST /teams/ with a partially built team (agent missing its model reference, invalid component type strings), user_id unknown, or DB write failure — all surface as {status:false}.
Common situations: Saving a team straight from the builder with an incomplete agent (no model attached), component schema drift after backend upgrade rejecting the serialized team, saving before required fields are filled.
Related errors
- Failed to create session
- Failed to update settings
- Failed to fetch teams
- Failed to fetch team
- Failed to call MCP tool
AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15).
Data as JSON: /api/errors/20714d39dcb4618b.
Report an issue: GitHub.