Irritating CONFIG change shutdown reason - mitikov/KeepSitecoreSimple GitHub Wiki

Agenda

Server restarts randomly saying Shutdown message: CONFIG change while you are confident files were not changed:

config_change

Technical aspects

ASP.NET monitors configuration files to restart application whenever anything changes.

It uses set of file changes monitors under the hood.

The code leaving CONFIG change is subscribed to ASP.NET file modification event - ASP.NET quite confident change indeed took place.

Logging file system write operations

We'll use Process Monitor to subscribe to the Windows file-system events, and will log only writes taking place in configuration files under the website folder:

  1. Start Process Monitor under admin
  2. Stop capturing if enabled (either from UI or CTRL+E hotkey)
  3. Filter menu -> select Drop Filtered Events not to consume clog RAM with useless events
  4. File -> Backing Files -> use named file (will accumulate all write occurrences)
  5. Leave only File System Activity selected in icons on top
  6. Tools -> Filter -> Add new rules:

Category is not Write then Exclude

Path excludes C:\inetpub\wwwroot\sc82u7\Website then Exclude

Path ends with config Include

proc_mon_configuration

Start capturing (CTRL+E) to start the hunt.

Demo

  • Launch Sitecore instance
  • Start the collection
  • Change configuration file

write_sample

If an event is logged - all good, can be moved to faulting environment.

Double-click on the event to see the stack trace causing the change.

Further steps

Once your application restarted for no good reason, you can locate the offensive process from backing file picked in the fourth step.

Chances are it could be OS itself bringing you down, or global configuration changes...

Troubleshooting with the Windows Sysinternals Tools book is much recommended to be read as shows great techniques to investigate unexpected behaviors.