zylon-ai/private-gpt · error · ValueError
Unsupported content block type: {type(block)}
Error message
Unsupported content block type: {type(block)} What it means
Raised by the GET /skills/{skill_id} route when SkillService.get_skill() returns None for the given skill_id and collection. Skills are namespaced per collection; querying an id that does not exist in that specific collection boundary yields this 404.
Source
Thrown at private_gpt/chat/input_models.py:480
MessageInput(
role=msg.role,
content=current_blocks,
)
)
current_blocks = []
result.append(
MessageInput(
role="assistant",
content=[block],
)
)
elif isinstance(block, ContentBlockType):
current_blocks.append(block)
elif isinstance(block, str):
current_blocks.append(TextBlock(text=block))
else:
raise ValueError(
f"Unsupported content block type: {type(block)}"
)
if current_blocks:
result.append(
MessageInput(
role=msg.role,
content=current_blocks,
)
)
else:
result.append(msg)
return result
@classmethod
def _validate_message_order(cls, messages: list[ChatMessage]) -> None:
"""Validates the order of the messages."""View on GitHub (pinned to 4a030776a3)
Solutions
- Verify the skill id exists in the exact collection via the list-skills endpoint for that collection.
- Re-fetch the skill list after collection changes and clear stale selections.
- Handle 404 by removing the skill from local cache and refreshing.
Example fix
// before
const skill = await skillsApi.get(selectedId, currentCollection);
// after
const skill = await skillsApi.get(selectedId, currentCollection).catch((e) => {
if (e.status === 404) { cache.remove(selectedId); return null; }
throw e;
}); Defensive patterns
Strategy: try-catch
Validate before calling
const list = await skillsApi.list(collection); if (!list.data.some((s) => s.id === skillId)) throw new NotFoundError(skillId);
Try / catch
try { return await skillsApi.get(skillId, collection); }
catch (e) {
if (e.status === 404) { cache.delete(skillId); return null; }
throw e;
} Prevention
- Invalidate cached skill ids when the active collection changes
- Refresh skill lists after delete operations in other sessions
- Always send the collection that the skill was created in
When it happens
Trigger: GET /skills/{skill_id}?collection=X where the skill lives in collection Y or was deleted; a freshly created skill read before eventual consistency; typo or URL-encoded id mismatch.
Common situations: Client switches collection context but keeps the previously selected skill id; skill deleted in another session; environment mismatch (dev id used against prod collection); pagination cursor pointing at removed entries.
Related errors
- Unknown message role {self.role}. Expected 'system', 'user',
- Invalid system item: {item}
- Invalid message order: expected {expected_roles} after {prev
- Audio size {audio_size} exceeds maximum allowed size of {set
- Invalid tool specification: {tool}
AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15).
Data as JSON: /api/errors/ebf70b125968f6cb.
Report an issue: GitHub.