Sitecore / Habitat

Sitecore Modular Architecture Example
Other
413 stars 397 forks source link

Database "core" not found on UserProfileProvider #485

Open dsimoes opened 4 years ago

dsimoes commented 4 years ago

Describe the bug The UserProfileProvider code relies on opening the UserProfile Template, which is created on the "core" database. Sitecore, from version 9.1 has disabled access from CD servers to core database: see https://doc.sitecore.com/developers/91/platform-administration-and-architecture/en/content-delivery--cd-.html

An exception is thrown opening the user edit profile page:

 ---> System.Web.HttpUnhandledException: An unhandled exception occurred. ---> System.InvalidOperationException: Could not find configuration node: databases/database[@id='core']

at Sitecore.Configuration.DefaultFactory.GetConfigNode(String xpath, Boolean assert) at Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) at Sitecore.Configuration.DefaultFactory.GetDatabase(String name, Boolean assert) at Sitecore.Configuration.DefaultFactory.GetDatabase(String name) at xxxFeature.Accounts.Services.UserProfileProvider.GetProfileTemplate(String profileItemId) at xxx.Feature.Accounts.Services.UserProfileProvider.GetCustomProperties(UserProfile userProfile) at xxx.Feature.Accounts.Services.UserProfileService.GetProfile(User user)

Sitecore Version 9.1.1

To Reproduce Open / try to update user profile Expected behavior No errors