Common Issues & Troubleshooting Guide¶
This comprehensive troubleshooting guide covers common issues you may encounter with your MkDocs Material production website hosted on Netlify.
Quick Reference¶
Issue Type | Severity | Typical Resolution Time |
---|---|---|
Build Failures | High | 5-30 minutes |
Deployment Issues | High | 10-60 minutes |
DNS/Domain Problems | Medium | 15 minutes - 24 hours |
Performance Issues | Medium | 30-120 minutes |
Content Problems | Low | 5-20 minutes |
1. Build Failures¶
1.1 MkDocs Build Errors¶
Symptoms¶
- Build fails in Netlify or local environment
- Error messages in build logs
- Site fails to generate
Common Causes¶
- Invalid
mkdocs.yml
configuration - Missing dependencies in
requirements.txt
- Corrupted Python environment
- Plugin incompatibilities
Diagnostic Steps¶
# Check MkDocs configuration locally
mkdocs build --strict
# Validate YAML syntax
python -c "import yaml; yaml.safe_load(open('mkdocs.yml'))"
# Check dependencies
pip list | grep mkdocs
Solutions¶
Invalid Configuration:
Missing Dependencies:
# Update requirements.txt
pip freeze > requirements.txt
git add requirements.txt
git commit -m "Update dependencies"
Plugin Conflicts:
Prevention¶
- Always test builds locally before pushing
- Use
--strict
mode in development - Pin specific plugin versions in requirements.txt
- Regular dependency updates with testing
When to Escalate¶
- Persistent build failures after following all steps
- Plugin-specific errors that require developer intervention
1.2 Jupyter Plugin Errors¶
Symptoms¶
- Notebook files not rendering
- Kernel execution errors
- Missing notebook outputs
Common Causes¶
- Missing Jupyter dependencies
- Kernel not available
- Large notebook files causing timeouts
Solutions¶
# Install missing Jupyter dependencies
pip install jupyter nbconvert ipykernel
# Check available kernels
jupyter kernelspec list
# For large notebooks, split into smaller files
# Or disable execution in mkdocs.yml:
plugins:
- mkdocs-jupyter:
execute: false
2. Deployment Issues¶
2.1 Netlify Deployment Failures¶
Symptoms¶
- Deployment fails in Netlify dashboard
- Build logs show errors
- Site not updating after push
Common Causes¶
- Build command misconfiguration
- Environment variables missing
- Node.js/Python version conflicts
- Build time limits exceeded
Diagnostic Steps¶
# Check Netlify build settings
# Build command: mkdocs build
# Publish directory: site
# Python version: 3.11.10
# Check build logs in Netlify dashboard
# Look for specific error messages
Solutions¶
Build Command Issues:
# In netlify.toml
[build]
command = "pip install -r requirements.txt && mkdocs build"
publish = "site"
[build.environment]
PYTHON_VERSION = "3.11.10"
Environment Variables:
- Set in Netlify dashboard under Site settings > Environment variables
- Common variables: PYTHON_VERSION
, NODE_VERSION
Build Timeout:
Prevention¶
- Test deployments on feature branches
- Monitor build times and optimize heavy plugins
- Use Netlify's deploy previews
When to Escalate¶
- Netlify platform issues
- Persistent timeouts despite optimization
2.2 GitHub Integration Problems¶
Symptoms¶
- Pushes not triggering builds
- Deploy hooks not working
- Branch protection conflicts
Solutions¶
# Check webhook configuration in GitHub
# Repository > Settings > Webhooks
# Verify Netlify webhook is active
# Re-link repository in Netlify
# Site settings > Git repository > Change site's repository
3. DNS and Domain Problems¶
3.1 Domain Resolution Issues¶
Symptoms¶
- Site not accessible via custom domain
- DNS propagation delays
- Certificate errors
Common Causes¶
- Incorrect DNS records
- Propagation delays (up to 48 hours)
- Cloudflare proxy settings
Diagnostic Steps¶
# Check DNS resolution
nslookup www.albrittonanalytics.com
dig www.albrittonanalytics.com
# Check DNS propagation globally
# Use online tools like whatsmydns.net
Solutions¶
DNS Configuration:
# Correct DNS records for Netlify
Type: CNAME
Name: www
Value: your-site-name.netlify.app
# For apex domain
Type: A
Name: @
Value: 75.2.60.5
SSL Certificate Issues: - Wait 24 hours for automatic certificate provisioning - Force certificate renewal in Netlify dashboard - Check for mixed content warnings
Prevention¶
- Use DNS providers with fast propagation
- Monitor certificate expiration dates
- Set up monitoring alerts
When to Escalate¶
- DNS provider configuration issues
- SSL certificate problems after 48 hours
4. Performance Issues¶
4.1 Slow Loading Times¶
Symptoms¶
- Page load times > 3 seconds
- Poor Core Web Vitals scores
- User complaints about speed
Common Causes¶
- Large image files
- Unoptimized CSS/JS
- Too many plugins
- Missing CDN configuration
Diagnostic Steps¶
# Test site performance
lighthouse https://www.albrittonanalytics.com
# Check image sizes
find docs/assets/images -name "*.png" -o -name "*.jpg" | xargs ls -lh
# Analyze bundle size
mkdocs build --verbose
Solutions¶
Image Optimization:
# Compress images
for img in docs/assets/images/*.png; do
pngcrush -reduce "$img" "${img%.png}_compressed.png"
done
CSS/JS Optimization:
Plugin Optimization:
# Disable unnecessary plugins in production
plugins:
- search
- blog
# Remove development-only plugins
Prevention¶
- Regular performance audits
- Automated image optimization in CI/CD
- Performance budgets
When to Escalate¶
- Persistent performance issues after optimization
- CDN configuration problems
5. Content Problems¶
5.1 Markdown Rendering Issues¶
Symptoms¶
- Content not displaying correctly
- Broken formatting
- Missing elements
Common Causes¶
- Invalid Markdown syntax
- Extension conflicts
- Special character encoding
Solutions¶
5.2 Broken Links¶
Symptoms¶
- 404 errors on internal links
- External links not working
- Navigation problems
Diagnostic Steps¶
# Check for broken links
mkdocs build --strict
# This will fail on broken internal links
# Use link checker
pip install linkchecker
linkchecker http://localhost:8000
Solutions¶
# Fix relative links
# Use absolute paths from docs root
[Link text](../other-section/page.md)
# Update navigation in mkdocs.yml
nav:
- Home: index.md
- Getting Started:
- Installation: getting-started/installation.md
6. Plugin Conflicts¶
6.1 Version Incompatibilities¶
Symptoms¶
- Plugin import errors
- Conflicting functionality
- Build failures after updates
Solutions¶
# Pin specific versions
echo "mkdocs-material==9.5.3" >> requirements.txt
echo "mkdocs-jupyter==0.24.6" >> requirements.txt
# Create virtual environment for testing
python -m venv test-env
source test-env/bin/activate
pip install -r requirements.txt
mkdocs build
6.2 Configuration Conflicts¶
Symptoms¶
- Plugins not working as expected
- Overlapping functionality issues
Solutions¶
# Order plugins correctly in mkdocs.yml
plugins:
- search
- blog
- rss:
match_path: blog/posts/**
- social
7. Form and Interaction Issues¶
7.1 Netlify Forms Not Working¶
Symptoms¶
- Form submissions not received
- Spam protection blocking legitimate submissions
- JavaScript form validation errors
Solutions¶
<!-- Ensure proper Netlify form attributes -->
<form name="contact" method="POST" data-netlify="true" netlify-honeypot="bot-field">
<input type="hidden" name="form-name" value="contact" />
<!-- Form fields -->
</form>
7.2 PWA Issues¶
Symptoms¶
- Service worker not updating
- Offline functionality broken
- Install prompts not showing
Solutions¶
// Force service worker update
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/service-worker.js', {
updateViaCache: 'none'
});
}
8. Search Functionality¶
8.1 Search Index Problems¶
Symptoms¶
- Search returns no results
- Incomplete search index
- Search suggestions not working
Solutions¶
# Configure search plugin properly
plugins:
- search:
lang: en
separator: '[\s\-\.]+'
indexing: 'full'
9. Security Issues¶
9.1 SSL Certificate Problems¶
Symptoms¶
- Browser security warnings
- Mixed content errors
- Certificate expiration notices
Solutions¶
<!-- Ensure all resources use HTTPS -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto">
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
9.2 Content Security Policy Violations¶
Symptoms¶
- JavaScript errors in console
- Blocked resources
- Third-party integrations failing
Solutions¶
# Configure CSP in mkdocs.yml
extra:
csp:
script-src: "'self' 'unsafe-inline' https://cdn.jsdelivr.net"
style-src: "'self' 'unsafe-inline' https://fonts.googleapis.com"
10. Mobile and Accessibility¶
10.1 Responsive Design Issues¶
Symptoms¶
- Layout breaks on mobile devices
- Touch targets too small
- Horizontal scrolling
Solutions¶
/* Custom responsive fixes */
@media (max-width: 768px) {
.md-content__inner {
padding: 1rem;
}
.md-typeset table {
font-size: 0.8rem;
}
}
10.2 Accessibility Problems¶
Symptoms¶
- Screen reader compatibility issues
- Keyboard navigation problems
- Color contrast failures
Solutions¶
# Enable accessibility features
theme:
features:
- navigation.tabs.sticky
- navigation.sections
- toc.follow
- content.code.copy
11. Browser Compatibility¶
11.1 JavaScript Compatibility¶
Symptoms¶
- Features not working in older browsers
- Console errors in specific browsers
- Polyfill issues
Solutions¶
// Add feature detection
if (!('IntersectionObserver' in window)) {
// Load polyfill
loadScript('https://cdn.jsdelivr.net/npm/intersection-observer@0.12.0/intersection-observer.js');
}
12. Emergency Procedures¶
12.1 Site Down Scenarios¶
Immediate Actions (0-15 minutes)¶
- Check Netlify status dashboard
- Verify last deployment status
- Check DNS resolution
- Review recent commits for issues
Emergency Rollback¶
# Rollback to previous working deployment
git revert HEAD
git push origin main
# Or use Netlify dashboard:
# Deploys > Previous deploy > Publish deploy
12.2 Critical Error Recovery¶
Data Loss Prevention¶
# Create emergency backup
git clone https://github.com/your-username/your-repo.git backup-$(date +%Y%m%d)
Contact Information¶
- Netlify Support: support@netlify.com
- Domain Provider: [Your DNS provider support]
- Emergency Contact: [Technical lead contact]
Monitoring and Prevention¶
Automated Monitoring¶
# Set up monitoring in Netlify
# Site settings > Build hooks > Add build hook
# Use with monitoring services like:
# - UptimeRobot
# - Pingdom
# - StatusCake
Regular Maintenance Checklist¶
Weekly: - [ ] Check site performance metrics - [ ] Review error logs - [ ] Test critical user journeys
Monthly: - [ ] Update dependencies - [ ] Review SSL certificate status - [ ] Backup configuration files - [ ] Test disaster recovery procedures
Quarterly: - [ ] Full security audit - [ ] Performance optimization review - [ ] Documentation updates - [ ] Team training on new procedures
Additional Resources¶
- MkDocs Material Documentation
- Netlify Documentation
- GitHub Actions for MkDocs
- Web Performance Best Practices
Last updated: {{ build.date.strftime('%B %d, %Y') }}
For issues not covered in this guide, please contact the technical team or create an issue in the GitHub repository.