microsoft/semantic-kernel · error · ValueError
No properties found in the schema.
Error message
No properties found in the schema.
What it means
Raised by Artifact when, after cleaning the schema properties against the failed_fields exclusion list, no properties remain (_clean_properties returns an empty '{}'). This means every property was filtered out or the schema itself had no usable properties, so the artifact cannot present a schema to the model.
Source
Thrown at python/samples/demos/guided_conversations/guided_conversation/plugins/artifact.py:230
clean_properties_str = clean_properties_str.replace("#/$defs/", "")
return clean_properties_str
# If filter_one_field is provided, only get the schema for that one field
if filter_one_field:
if not self._is_valid_field(filter_one_field):
self.logger.error(f'Field "{filter_one_field}" is not a valid field in the artifact.')
raise ValueError(f'Field "{filter_one_field}" is not a valid field in the artifact.')
filtered_schema = {"properties": {filter_one_field: self.original_schema["properties"][filter_one_field]}}
filtered_schema.update((k, v) for k, v in self.original_schema.items() if k != "properties")
schema = filtered_schema
else:
schema = self.original_schema
failed_fields = self.get_failed_fields()
properties = _clean_properties(schema, failed_fields)
if not properties:
self.logger.error("No properties found in the schema.")
raise ValueError("No properties found in the schema.")
types_schema = schema.get("$defs", {})
custom_types = []
for type_name, type_info in types_schema.items():
if f"'type': '{type_name}'" in properties:
clean_schema = _clean_properties(type_info, [])
if clean_schema != "{}":
custom_types.append(f"{type_name} = {clean_schema}")
if custom_types:
explanation = f"If you wanted to create a {type_name} object, for example, you would make a JSON object \
with the following keys: {', '.join(types_schema[type_name]['properties'].keys())}."
custom_types_str = "\n".join(custom_types)
return f"""{properties}
Here are the definitions for the custom types referenced in the artifact schema:
{custom_types_str}
View on GitHub (pinned to c028a0c7dc)
Solutions
- Inspect failed_fields and original_schema['properties'] to see why all properties were filtered.
- Reset/trim failed_fields so at least one valid field remains.
- Ensure original_schema actually defines a non-empty properties map.
- Re-derive the schema from a known-good artifact definition.
Example fix
// before artifact.failed_fields = list(artifact.original_schema['properties'].keys()) # all fail artifact.get_schema() // after artifact.failed_fields = ['only_one_bad_field'] artifact.get_schema()
Defensive patterns
Strategy: validation
Validate before calling
props = set(artifact.original_schema.get('properties', {}).keys())
failed = set(artifact.failed_fields)
if not (props - failed):
# nothing would survive cleaning; reset or raise informatively
artifact.failed_fields = list(failed - (failed - {next(iter(props))})) if props else []
raise ValueError('All fields are failed; cannot produce schema') Type guard
def schema_has_surviving_properties(artifact) -> bool:
props = set(artifact.original_schema.get('properties', {}))
failed = set(artifact.failed_fields)
return bool(props - failed) Try / catch
try:
schema = artifact.get_schema()
except ValueError as ex:
if 'No properties' in str(ex):
artifact.failed_fields.clear()
schema = artifact.get_schema() Prevention
- Cap failed_fields so at least one property survives.
- Reset failed_fields when starting a new conversation turn.
- Validate the schema source has non-empty properties.
When it happens
Trigger: Every field in the schema is listed in failed_fields; original_schema has no 'properties' key or an empty properties dict; the cleaning logic strips all keys due to $ref handling.
Common situations: All fields failed validation on a previous turn and were added to failed_fields; a malformed artifact schema; schema produced by a different code path that omits properties.
Related errors
- Field "{filter_one_field}" is not a valid field in the artif
- A complete then action is required for orchestration steps.
- " ".join(violations)
- Resource constraint is not set. Do not try to call this meth
- Unsupported scalar field type: {field_type_str}
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/d6cca5d2fb7a398d.
Report an issue: GitHub.