Upon saving the home item I see the following error:
Could not find configuration node: databases/database[@id='staging']
There are no files on the system (config, yml) that contain "staging".
What could be the possible cause?
Sitecore Stack Exchange is a question and answer site for developers and end users of the Sitecore CMS and multichannel marketing software. It only takes a minute to sign up.Sign up to join this community
I'm glad you asked! Turns out that there is very interesting explanation for this.
When using the Caching.CacheKeyIndexingEnabled.ItemCache setting a call to retrieve all the sites is performed. This is needed to clear the filter cache for each site.
As you can see below, there is some validation on the database configured in the site definition.
Sitecore makes some assertions when the db doesn't exist.
Once the file system is ruled out as a possible cause, you can explore the database.
I ran the following query to see if there are any fields which contain the incorrect value.
SELECT * FROM [dbo].[SharedFields] WHERE [Value] LIKE '%staging%' SELECT * FROM [dbo].[VersionedFields] WHERE [Value] LIKE '%staging%' SELECT * FROM [dbo].[UnversionedFields] WHERE [Value] LIKE '%staging%'
Let's say you have an item containing an invalid database name. Perhaps this was done by accident with a copy of content from another environment....
Upon editing and saving of an item, you should see this error appear. Fixing the value fixes the issue.
Note: In certain conditions you may find it impossible to correct this value. Your best course of action is to either disable the setting and then make the change and save, or write SQL to edit the field data.
Credit: After figuring out that it was a caused by the site configuration and triggerd by the ItemCache setting I had an idea of someone that might know what's going on. Big thanks to Nikolay Mitikov for helping me understand what's happening in the code that triggered the error. I assumed he knew something about the subject since he wrote a related article on the AccessResultCache here.