1

In Sitecore 7.2 we're having some trouble getting a value from Sitecore.Context.Domain.GetRoles() on our content delivery servers. It works fine in development and locally but when we deploy to a load balanced environment (e.g, production) it's not returning any roles.

Does anybody have any pointers to resolve?

Thanks in advance

  • Is this on the CD server? Are you sharing a core database with your CM? – Dan Sinclair Feb 25 '19 at 16:25
  • Yep on CD where we're having the issue. Just checked and we have separate instances of core on both CD and CM. – Sean T Feb 25 '19 at 16:34
  • 1
    For the record, a non-shared core database is a recipe for annoyance down the road. Various things are stored there, including the links database. Sure, most of those things can be customized, but be aware that this may cause future problems. We just encountered one where the Sitecore Rewrite Module didn't work, for instance, because it depends on the links database. – Matthew FitzGerald-Chamberlain Feb 25 '19 at 16:42
2

Since membership data is stored in the core database and you have separate core databases between CM and CD, it's likely that the CDs' core does not contain the role memberships you expect.

You will need to either:

  1. Share a core database between CM and CD or
  2. Configure replication of the core database between CM and CD

For more information, consult the Scaling Guide for your version of Sitecore.

Relevant sections, depending on how your environment is configured (emphases mine):

2.1. Configuring a Standard Multi-Instance Environment

The standard multi-instance Sitecore setup uses the same three databases, shares the Core and Web databases between all the CM and CD instances, and shares the Master database between all the CM instances.

3.2. Isolating the CM and CD Environments

The CM and CD environments typically need to be isolated to meet security or infrastructure requirements. You can also use the information in this section when you configure geographically distributed CM and CD environments.

3.2.2 Addressing Security Synchronization

In an isolated CM and CD environment, security data and caches are automatically synchronized within every instance of the CM environment, as well as within every instance of the CD environment. This happens because every instance within the environment shares the same databases, and therefore shares the same security data and system event queue. However, security data and caches are not automatically synchronized between the isolated CM and CD environments.

There are different ways to address security synchronization in an isolated CM and CD setup depending on the implementation requirements.

  • If your solution does not require synchronization of security data and caches, you do not need to perform any of the modifications described in this section. For example, if the CD instances do not use any extranet security, synchronization may be not required.

  • If your solution requires live synchronization of the security data and caches between the CM and CD environments from the default SQL membership, role, and profile providers, plus security caches from additional security providers (Active Directory, CRM, or custom providers), we recommend that you configure database replication to synchronize the CM Core database with the CD Core database.

    This will ensure that the security account data that is stored in these two databases, as well as related security events that are required for synchronizing security caches are replicated between the environments.

    For more information about configuring database replication, see the section How to: Configure SQL Server Replication.

  • If your solution does not require live synchronization of security data between the CM and CD environments from the default SQL membership, role, and profile providers, but requires synchronization of security caches from additional security providers (Active Directory, CRM, custom providers), it is enough to only address security cache clearing rather than replicating the Core database.

    For more information about addressing security cache clearing, see the section How to: Address Security Caching Clearing.

| improve this answer | |
  • Thanks, will try this tomorrow. Is there a way to publish the core from cm to cd within sitecore? or do we need to have a sql job scheduled? – Sean T Feb 25 '19 at 17:25
  • No, there is not a way to publish the security content of the core database to another core database, so it will need to be a SQL-level configuration. See my updated answer for more context. – Dan Sinclair Feb 25 '19 at 18:18

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.