Troubleshooting Guide¶
This guide helps you resolve common issues when using Plating.
Common Issues¶
1. "Module not found" Errors¶
Problem: ImportError when trying to import plating or pyvider packages.
Solutions:
# Ensure plating is installed
uv pip install -e .
# Install pyvider dependencies
uv pip install pyvider-cty provide-foundation
2. Async/Await Errors¶
Problem: "RuntimeWarning: coroutine was never awaited"
Solution: All Plating API methods are async and must be awaited:
# ❌ Wrong
api.adorn()
# ✅ Correct
await api.adorn()
# Or wrap in async function
import asyncio
asyncio.run(main())
3. No Components Found¶
Problem: Plating doesn't find any components to document.
Solutions:
-
Check package name:
-
Verify component discovery:
-
Check component structure:
- Ensure components are in correct directories (resources/, data_sources/, functions/)
- Verify components have proper naming (e.g.,
my_resource.py)
4. Template Rendering Fails¶
Problem: TemplateError during documentation generation.
Common Causes:
1. Syntax error in template:
- Check for unmatched {{ or }}
- Verify Jinja2 syntax
-
Missing example file:
-
Schema not available:
- Ensure component has
get_schema()method - Check schema extraction logs
5. File System Errors¶
Problem: FileSystemError when writing documentation.
Solutions:
# Check permissions
ls -la docs/
# Create output directory
mkdir -p docs/resources docs/data-sources docs/functions
# Use --force flag to overwrite
plating plate --force
6. Provider Name Not Detected¶
Problem: "Could not determine provider name"
Solutions:
-
Specify explicitly:
-
Configure in pyproject.toml:
-
Follow naming convention:
- Package name:
terraform-provider-myname - Or:
myname-provider
7. Validation Failures¶
Problem: Documentation validation fails.
Check: 1. Markdown syntax:
- Required sections:
- Ensure templates include required Terraform Registry sections
-
Check frontmatter format
-
Schema formatting:
- Verify schema tables are properly formatted
- Check for special characters in descriptions
8. Memory Issues with Large Providers¶
Problem: High memory usage or OOM errors.
Solutions: 1. Process in batches:
# Process component types separately
await api.adorn(component_types=[ComponentType.RESOURCE])
await api.adorn(component_types=[ComponentType.DATA_SOURCE])
- Increase memory limit:
9. Circuit Breaker Triggered¶
Problem: "Circuit breaker is open" errors.
Cause: Too many consecutive failures triggered the circuit breaker.
Solution:
# Wait for circuit to reset (typically 60 seconds)
import time
time.sleep(60)
# Or restart the process
10. Template Functions Not Working¶
Problem: {{ schema() }} or {{ example() }} showing empty or error.
Debug steps: 1. Check component has schema:
component = hub.get_component("resource", "my_resource")
schema = component.get_schema()
print(schema)
-
Verify example file exists:
-
Check template context:
11. Inconsistent Headers/Footers Across Pages¶
Problem: Global headers or footers appear on some pages but not others, or show different content than expected.
Symptoms: - Some component types have headers/footers while others don't - Different pages show different versions of the same global content - Expected global content is missing from generated documentation - Headers/footers only appear after regenerating specific components
Root Cause: Documentation files were generated at different times with different configurations, resulting in inconsistent global content injection.
Solution:
-
Verify global partials are configured:
-
Ensure plating receives the configuration:
-
Clean and regenerate ALL documentation:
-
Verify injection in logs:
-
Confirm complete coverage:
Important: Global headers and footers are applied uniformly to ALL component types (resources, data sources, functions). If you see inconsistencies, it means some documentation is stale and needs regeneration.
Best Practice: Always regenerate all documentation together when: - Updating global header/footer content - Adding or removing global partials configuration - Changing templates that affect page structure
Debug Mode¶
Enable verbose logging to troubleshoot issues:
# Python API
context = PlatingContext(
provider_name="my_provider",
log_level="DEBUG",
verbose=True
)
# CLI
plating plate --verbose --log-level DEBUG
Getting Help¶
If you encounter issues not covered here:
- Check the logs: Look for error messages and stack traces
- Review examples: Check the test files for usage patterns
- File an issue: https://github.com/provide-io/plating/issues
Issue Template¶
When reporting issues, include:
- Plating version (plating --version)
- Python version (python --version)
- Complete error message and stack trace
- Minimal reproducible example
- Operating system and environment
Performance Optimization¶
Slow Documentation Generation¶
Optimize with: 1. Parallel processing:
- Cache schemas:
- Schemas are cached per session automatically
-
Reuse the same Plating instance
-
Limit scope:
Foundation Integration Issues¶
Retry Policy Not Working¶
Verify retry configuration:
# Check retry policy is active
api.retry_policy.max_attempts # Should be 3
api.retry_policy.backoff # Should be BackoffStrategy.EXPONENTIAL
Metrics Not Collected¶
Enable metrics collection:
Environment Variables¶
Useful environment variables for debugging: