7 Tips To Help You Trouble Shoot Sitecore Issues
As developers, I would guess we spend a good chunk of our working week trying to debug and fix issues. Sitting in front of a computer tippy-tapping away, without knowing why something is broken can make you want to scream, or throw your computer out of a Window. In today's tutorial, I'm going to cover some of my go-to checklist that I follow when I'm trying to resolve a Sitecore issue. If you have any that are not included, feel free to add them as comments.
Check The Error LogsThis is usually the first thing you will need to do.
- Check the Sitecore logs in, '\Data\logs'
- Check the System logs, open the Windows Event Viewer, by opening 'Control Panel' -> 'Administrative Tools' -> 'Event Viewer'. Look in the 'Windows Logs' usually in 'Application'. Anything flagged with a red icon in the timeframe you ran your application may be related.
Start From A Clean SlateTurn it off and on is now the world's go to IT joke but it still holds true in CMS development world. Usually, the first
- Open your command prompt and type IISRESET
- Try to clean your Sitecore cache, by typing the following into your browser, http://www.website.com/sitecore/admin/cache.aspx
- Clean your temporary .NET file. In Windows Explorer, go to : 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files' and use unlocker to delete the files (do an IISRESET afterwards)
- Check that your post .config build contains everything you think it should do, by typing 'http://www.website.com/sitecore/admin/showconfig.aspx' into a browser.
- Is everything published that you think should be? I normally implement an unpublished gutter icon in my project to help troubleshoot what items are not published, reading How To Display The Published Status Of An Item In Sitecore
- Uninstall Sitecore packages. Check that Sitecore packages have been installed/removed recently. If you don't know how to remove a Sitecore package, I would recommend reading 'How To Uninstall A Sitecore Package'.
- As Sitecore is yet to work with Nuget, there can often be times when certain files aren't deployed correctly, wrong assembly versions exist on different servers. To make sure my files and config settings match, I use 'Beyond Compare' (if I can get the company to pay for it, otherwise I use 'Total Commander'
SQL ProfilingIn some instances, when working with custom API's and databases, you may want to double check that the data coming in.going out of SQL is what you expect it to be. I had an example recently where I needed to figure out what database table an API call was making. Using SQL profiler allowed me to see the stored procedure being called and the parameters being passed in. It was this insight that helped me troubleshoot the issue. If you have the enterprise version of SQL, you get MS Profiler included (although you have to specifically include it when you install SQL). If you do not have the enterprise version of SQL there is also a free tool called Express Profiler. Simply point it at your database, instantly start recording, perform the web request and sort through the logs to see what's relevant to your issue.
- Using Chromes, inspect element -> 'Network' taband make sure all CSS, JS and web API requests are being loaded correctly
- See if the issue is browser specific by using different browsers
- Clear your browsers temp files