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 Logs
This 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 Slate
Turn 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‘
In 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
Taking a look inside third-party assemblies
If you get any form of error about not being able to find a method call, or an interface in one of your custom assemblies, then open up the assembly on the server and look what’s inside it. You can use Dotpeek for free to open up .dll files and see what code has been compiled inside it.
Figuring out what files Windows is calling
Sometimes you may need to check if Windows is calling specific files, for example, you may have a scheduled task that needs to import images in a folder. In this situation, you can use Sysmon. Sysmon provides detailed information about what processes, network connections, and changes to the windows file system are being made in real time.