Sitecore Troubleshooting Overview
Common issues you may encounter with your Sitecore website and how to diagnose and fix them.
Performance Issues
Sitecore performance impacts user experience, SEO, and conversion rates. Core Web Vitals are critical metrics for Sitecore sites.
Largest Contentful Paint (LCP)
LCP measures loading performance. Sitecore-specific LCP issues include:
- .NET server-side rendering time
- Uncached Sitecore pages
- Heavy ASPX/Razor view processing
- Unoptimized images in Media Library
- Experience Editor overhead
- xDB tracking initialization delays
Target: LCP under 2.5 seconds
Cumulative Layout Shift (CLS)
CLS measures visual stability. Sitecore-specific CLS issues include:
- Images without dimensions in Razor views
- Personalized content loading late
- Experience Editor placeholders shifting
- Dynamic component rendering
- Web fonts loading late
Target: CLS under 0.1
General Performance Best Practices
Caching:
- Enable HTML cache in Sitecore
- Configure output caching for renderings
- Use Sitecore's caching API effectively
- Implement Redis or SQL Server for cache storage
Image Optimization:
- Use Media Library image processing
- Configure proper image dimensions
- Implement responsive images
- Enable lazy loading
Code Optimization:
- Minimize Sitecore API calls
- Avoid expensive LINQ queries
- Cache component output
- Use asynchronous processing where possible
Database Performance:
- Optimize indexes (rebuild regularly)
- Configure connection pooling
- Use Content Search API efficiently
- Monitor SQL Server performance
For general performance concepts, see the global performance hub.
Tracking & Analytics Issues
Events Not Firing
Common causes of tracking failures on Sitecore:
- Experience Editor blocking scripts
- HTML cache including outdated tracking
- Cookie consent blocking scripts
- Rendering cache conflicts
- xDB tracking disabled
- Content Security Policy restrictions
Tracking Best Practices
Verify Installation:
- Check tracking code in Razor views
- Verify scripts load in normal mode only
- Test with cleared HTML cache
- Confirm not in Experience Editor
Cookie Consent Integration:
- Ensure tracking respects consent
- Test consent flow thoroughly
- Verify tracking fires after consent
Sitecore Analytics Integration:
- Verify xDB is enabled
- Check Tracker is active
- Confirm contact identification
- Monitor session state
For general tracking concepts, see the global tracking issues hub.
Common Sitecore-Specific Issues
HTML Caching Conflicts
Problem: Cached pages showing wrong tracking data or outdated content.
Fix:
// Clear HTML cache
Sitecore.Caching.CacheManager.GetHtmlCache(Sitecore.Context.Site).Clear();
// Or via Sitecore UI:
// Control Panel → Database → Clean up databases → HTML cache
Prevent:
- Move dynamic data to client-side JavaScript
- Disable caching for tracking renderings
- Use VaryByData or VaryByUser for personalized content
Experience Editor Loading Issues
Problem: Tracking scripts breaking Experience Editor.
Fix:
@if (!Sitecore.Context.PageMode.IsExperienceEditorEditing)
{
@* Tracking code here *@
}
Rendering Performance Issues
Problem: Slow page loads due to heavy rendering processing.
Diagnosis:
- Enable Sitecore debugging
- Check rendering times in logs
- Profile with Application Insights or New Relic
Fix:
<!-- Enable output caching for rendering -->
<renderingId cacheable="true" varyByData="true">
<cacheKeyIndexing>true</cacheKeyIndexing>
</renderingId>
Publishing Delays
Problem: Content changes not reflecting on site.
Fix:
- Check publish status in Publishing tab
- Verify publishing target is "web" database
- Clear caches after publish
- Check if incremental publish failed (use republish)
// Programmatically clear caches
Sitecore.Caching.CacheManager.ClearAllCaches();
Media Library Image Issues
Problem: Images not loading or slow to render.
Causes:
- Image processing errors
- Missing media cache
- Incorrect media URL generation
Fix:
<!-- Configure media settings -->
<setting name="Media.CacheEnabled" value="true"/>
<setting name="Media.MediaLinkServerUrl" value=""/>
<setting name="Media.RequestProtection.Enabled" value="true"/>
Clear media cache:
/sitecore/admin/cache.aspx
xDB Tracking Not Working
Problem: Analytics not being tracked in xDB.
Diagnosis:
// Check if Tracker is active
var isActive = Sitecore.Analytics.Tracker.Current?.IsActive ?? false;
// Check if session is initialized
var hasSession = Sitecore.Analytics.Tracker.Current?.Session != null;
Fix:
<!-- Ensure xDB is enabled -->
<setting name="Xdb.Enabled" value="true"/>
<setting name="Xdb.Tracking.Enabled" value="true"/>
Content Search Issues
Problem: Search results outdated or missing.
Fix:
- Rebuild search indexes
- Check index configuration
- Verify indexing strategy
// Rebuild index programmatically
var index = Sitecore.ContentSearch.ContentSearchManager.GetIndex("sitecore_web_index");
index.Rebuild();
Multi-Site Configuration Issues
Problem: Wrong site context or incorrect content loading.
Diagnosis:
// Check current site
var siteName = Sitecore.Context.Site?.Name;
var rootPath = Sitecore.Context.Site?.RootPath;
Sitecore.Diagnostics.Log.Info($"Site: {siteName}, Root: {rootPath}", this);
Fix:
- Verify site definitions in web.config
- Check hostName mappings
- Ensure rootPath and startItem are correct
License Expiration
Problem: Site showing license errors or limited functionality.
Fix:
- Check license.xml file
- Verify expiration date
- Contact Sitecore support for renewal
- Restart application after updating license
Debugging Tools
Sitecore Tools
Sitecore Logs:
/App_Data/logs/
Monitor logs for errors:
Sitecore.Diagnostics.Log.Info("Custom log message", this);
Sitecore.Diagnostics.Log.Error("Error occurred", exception, this);
Administration Pages:
/sitecore/admin/cache.aspx- Cache management/sitecore/admin/stats.aspx- Performance statistics/sitecore/admin/showconfig.aspx- View merged configuration/sitecore/admin/dbbrowser.aspx- Database browser
Sitecore Debugger: Enable in web.config:
<setting name="Debugging.Enabled" value="true"/>
Experience Editor: Use Experience Editor to test:
- Component rendering
- Personalization rules
- Dynamic content
- Preview mode vs. normal mode
Browser Developer Tools
- Console: Check for JavaScript errors
- Network: Verify tracking requests
- Application: Check cookies and storage
- Performance: Profile page load
Application Monitoring
Application Insights:
- Track server-side performance
- Monitor exceptions
- Analyze dependencies
New Relic:
- APM for .NET applications
- Real user monitoring
- Transaction tracing
Sitecore Experience Accelerator (SXA): Built-in diagnostics and debugging tools
Performance Testing
- Google PageSpeed Insights
- GTmetrix
- WebPageTest
- Sitecore Performance Analyzer
Sitecore-Specific Debugging
View Rendering Debug
Enable rendering diagnostics:
<setting name="Rendering.Diagnostics" value="true"/>
This adds HTML comments showing:
- Rendering name
- Data source
- Caching status
- Rendering time
Database Query Debugging
Enable SQL profiling:
<setting name="Counters.Enabled" value="true"/>
API Call Tracing
Monitor Sitecore API calls:
using (new Sitecore.Diagnostics.ProfileSection("My Operation"))
{
// Your code here
}
Results appear in Sitecore logs.
Common Error Messages
"Item Not Found"
Cause: Missing content item or incorrect path
Fix:
- Verify item exists in Content Editor
- Check item path/ID
- Ensure correct database (master vs. web)
- Publish missing items
"Layout Not Found"
Cause: Layout definition missing or incorrect
Fix:
- Check presentation details
- Verify layout exists
- Ensure layout is published
- Reset layout to default
"Could not resolve host name"
Cause: Site definition misconfiguration
Fix:
- Check site definitions in web.config
- Verify hosts file (for local development)
- Confirm DNS settings (for production)
"Access Denied"
Cause: Insufficient user permissions
Fix:
- Check user roles and permissions
- Verify item security
- Grant appropriate access in Security Editor
Getting Help
Sitecore Resources
- Sitecore Documentation
- Sitecore Knowledge Base
- Sitecore Stack Exchange
- Sitecore Community
- Sitecore Slack Community
Support Channels
- Sitecore Support Portal: Official support tickets
- Partner Support: Through your Sitecore partner
- Community Forums: Community-driven help
- Training: Sitecore learning paths and certification
Best Practices
- Check Sitecore logs first - Most issues leave traces
- Clear caches - Many issues are cache-related
- Test in different modes - Preview, normal, Experience Editor
- Verify publishing - Ensure content is published to web
- Monitor performance - Use Application Insights or New Relic
- Keep updated - Apply Sitecore updates and patches