Staging roles in Kentico 9 is only syncing Module permissions, not Page Type or Custom Table ones

Tom Troughton asked on May 20, 2016 15:17

I hope someone can help me with a really frustrating issue. I have a local single-server multi-site (2 sites) Kentico 9 instance. I also have a another environment set up as a web farm with 2 servers. The former is configured to synchronize with the latter via the Staging module.

Everything works fine except for Roles. I'm finding that when a role is changed and synchronized, it's copying any permissions set against modules, but any changes made to permissions for page types or custom tables are not synced. In fact, if I add these permissions on the target then re-sync I see this permissions are actually wiped out. So the sync task is behaving as though I've removed all these permissions at source.

I'm sure I've set staging up correct. As I say, it's working for all other objects. My source has 2 staging servers configured, once for each site, and I've added the following web.config keys to ensure global objects are staged correctly:

<add key="CMSStagingTreatServerNamesAsInstances" value="true" />
<add key="CMSStagingLogGlobalObjectsOnlyForAssignedSites" value="true" />

Originally I had a series of objects excluded from staging in a CMSModuleLoader Init method, but I've completely removed all these and still observing the same behaviour. I've also tried with the above web.config keys removed. So as far as I'm concerned this has been tested in a vanilla staging setup.

Any advice you have would be appreciated. FYI, I've also raised this issue over on SO.


I've discovered that the same thing happens when I export roles to the target using the import/export feature. So right now I have no means of deploying roles. I should also point out that there are no errors or warnings in the event log. Also, it might be worth mentioning that I have staging configured for all changes except content.

Update 2

Having investigated further, I'm now seeing that the same role is being created on both sites by the staging task, so I'm ending up with 2 roles on the target both with the same code name. I'm guessing this might be the cause of the problem. Is this a Kentico bug? The role in question is a site-level role, not a global role. When synchronizing I'm choosing 'all' servers but my understanding from this post was that global objects would only be synced once in this case. Although I'm not sure if site-level roles are even technically global objects. In any case there should not be the possibility of syncing a site's role to a different target site.

Correct Answer

Tom Troughton answered on May 23, 2016 10:42

UPDATE: Kentico have now managed to replicate this and have confirmed it's a bug in Kentico 9. They have committed to fixing within 7 days so presumably a hotfix will be coming soon.

1 votesVote for this answer Unmark Correct answer

Recent Answers

Trevor Fayas answered on May 20, 2016 16:00


Couple questions, what Hotfix of version 9? There were some bugs that may address yours, not specifically but a couple Staging issues with pages were fixed in some of the hotfixes.

Next, was this an upgraded instance or a fresh install of 9? If it's an upgrade, one way to rule out code issues possibly is to create a new instance of 9, get it to the same hotfix as your current site, then just try 'swapping' out the file system (just point the new fresh install to your existing database) and see if things work better, that at least will eliminate or show it's something with code.

The next thing to look at is to make sure the roles and permissions are set to the multiple sites, i'm not sure if this would have an affect but it may...

Check your settings as well to make sure these items are logged for staging, there are settings to tell it what to log and what not to log.

Hope that at least helps a little.

0 votesVote for this answer Mark as a Correct answer

Tom Troughton answered on May 20, 2016 16:11

Thanks Trevor. It's a fresh Kentico 9 install. Please see my second update in my OP for more detail. Kentico is copying the role to both my target sites even though the role only belongs to one site. I think this might be the source of my issue. Settings are fine. As I say, staging is otherwise working fine.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.