1

Upon saving the home item I see the following error:

Could not find configuration node: databases/database[@id='staging']

enter image description here

There are no files on the system (config, yml) that contain "staging".

What could be the possible cause?

3

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.

enter image description here

As you can see below, there is some validation on the database configured in the site definition.

enter image description here

Sitecore makes some assertions when the db doesn't exist.

enter image description here


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.

enter image description here

SELECT *
FROM [dbo].[SharedFields]
WHERE [Value] LIKE '%staging%'

SELECT *
FROM [dbo].[VersionedFields]
WHERE [Value] LIKE '%staging%'

SELECT *
FROM [dbo].[UnversionedFields]
WHERE [Value] LIKE '%staging%'

enter image description here


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....

enter image description here

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.