1

I'm getting the error The definition manager is in read only mode in this environment when triggering "Deploy Marketing definitions" from control panel.

How do I enable "write mode?" on CM server? And how often are we supposed to deploy definitions? Shouldn't this happen automatically?

Config definition (from showconfig.aspx)

<goal definitionInterface="Sitecore.Marketing.Definitions.Goals.IGoalDefinition, Sitecore.Marketing">
<definitionManager type="Sitecore.Marketing.Definitions.Goals.GoalDefinitionManager, Sitecore.Marketing" singleInstance="true">
    <config>   
        <customTaxonomyFieldMappings patch:source="Sitecore.Marketing.config">                
            <mapping fieldId="{E7B5C821-A54C-4264-9C06-C6EBDBFCD6B8}" taxonomyRootId="{13D17E8A-FED4-4799-8DEF-05E9691A3E15}" />
            <mapping fieldId="{B3D6C41E-E37B-48AB-B8EC-13DCA18CE729}" taxonomyRootId="{7DE5CC49-D985-49E1-AC61-663A1411AE42}" />
            <mapping fieldId="{781346DF-7E91-42F1-BA62-A63572520850}" taxonomyRootId="{D7D814A0-294D-444C-BED0-EEAEA7CD5A27}" />
        </customTaxonomyFieldMappings>

        <knownTaxonomyFieldMappings patch:source="Sitecore.Marketing.config">            
            <mapping fieldId="{8B553339-088A-4CFA-AB21-B8D0B8C0B77D}" taxonomyRootId="{733CECC5-1A6D-4C81-8267-D52A80349EE4}" />
        </knownTaxonomyFieldMappings>
        <activationFeed patch:source="Sitecore.MarketingProcessingRole.config" />
    </config>
    <param desc="repository" ref="marketingDefinitions/goal/repositories/rdb" patch:source="Sitecore.Marketing.config" />
    <param desc="classificationResolver" type="Sitecore.Marketing.Definitions.DefaultClassificationResolver, Sitecore.Marketing" patch:source="Sitecore.Marketing.config" />
    <param desc="definitionFieldLabelResolver" type="Sitecore.Marketing.Definitions.ItemBasedDefinitionFieldLabelResolver, Sitecore.Marketing" patch:source="Sitecore.Marketing.config">
    <param desc="databaseName" ref="marketingDefinitions/itemRepositoriesDatabase" />
    </param>
    <param desc="searchProvider" patch:source="Sitecore.Marketing.config" ref="marketingDefinitions/goal/searchProviders/notSupported" />
    <param desc="isReadOnly" type="System.Boolean" factoryMethod="Parse" arg0="true" patch:source="Sitecore.Marketing.config" />
</definitionManager>
<repositories>
    <rdb type="Sitecore.Analytics.Reporting.DefinitionData.Marketing.GoalDefinitionRdbRepository, Sitecore.Analytics" singleInstance="true">
        <param desc="connectionStringName">reporting</param>
        <param desc="cache" type="Sitecore.Analytics.Reporting.DefinitionData.Marketing.RdbCache.DefinitionCache`1[[Sitecore.Marketing.Definitions.Goals.Data.GoalDefinitionRecord, Sitecore.Marketing]], Sitecore.Analytics">
        <param desc="name">marketing.rdb.goal</param>
        <param desc="maxSize">20MB</param>
        </param>
        <param desc="availableCulturesCache" type="Sitecore.Analytics.Reporting.DefinitionData.Marketing.RdbCache.Cache`2[[Sitecore.Data.ID, Sitecore.Kernel],[System.Collections.Generic.IReadOnlyList`1[[System.Globalization.CultureInfo]]]], Sitecore.Analytics">
        <param desc="name">marketing.rdb.goal.cultures</param>
        <param desc="maxSize">20MB</param>
        </param>
    </rdb>
    <item type="Sitecore.Marketing.Definitions.Goals.Data.ItemDb.GoalDefinitionItemRepository, Sitecore.Marketing" singleInstance="true" patch:source="Sitecore.Marketing.config">
        <param desc="databaseName" ref="marketingDefinitions/itemRepositoriesDatabase" />
        <param desc="assumeActive" type="System.Boolean" factoryMethod="Parse" arg0="false" />
    </item>
</repositories>
<searchProviders patch:source="Sitecore.Marketing.config">
    <notSupported type="Sitecore.Marketing.Search.NotSupportedSearchProvider`1[[Sitecore.Marketing.Definitions.Goals.IGoalDefinition, Sitecore.Marketing]], Sitecore.Marketing" />
</searchProviders>
</goal>

Full exception:

Message: An unhandled exception occurred.
Source: Sitecore.Mvc
   at Sitecore.Mvc.Pipelines.MvcEvents.Exception.ShowAspNetErrorMessage.ShowErrorMessage(ExceptionContext exceptionContext, ExceptionArgs args)
   at Sitecore.Mvc.Pipelines.MvcEvents.Exception.ShowAspNetErrorMessage.Process(ExceptionArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Mvc.Pipelines.PipelineService.RunPipeline[TArgs](String pipelineName, TArgs args)
   at Sitecore.Mvc.Filters.PipelineBasedRequestFilter.OnException(ExceptionContext exceptionContext)
   at System.Web.Mvc.ControllerActionInvoker.InvokeExceptionFilters(ControllerContext controllerContext, IList`1 filters, Exception exception)
   at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
   at Sitecore.Mvc.Controllers.SitecoreActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
   at System.Web.Mvc.Controller.<>c__DisplayClass22.<BeginExecuteCore>b__1e()
   at System.Web.Mvc.Async.AsyncResultWrapper.<.cctor>b__0(IAsyncResult asyncResult, Action action)
   at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
   at Sitecore.Mvc.Routing.RouteHttpHandler.EndProcessRequest(IAsyncResult result)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 

Nested Exception Exception: System.AggregateException
Message: One or more errors occurred.
Source: mscorlib
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Sitecore.Analytics.Reporting.DefinitionData.Marketing.Deployment.DeploymentManager.DeployAll[TDefinitionInterface](CultureInfo culture)
   at Sitecore.Shell.Client.Applications.Marketing.Utilities.DeployMarketingDefinitions.DeployMarketingDefinitionsController.DeployDefinitionTypes(String[] definitionTypes)
   at Sitecore.Shell.Client.Applications.Marketing.Utilities.DeployMarketingDefinitions.DeployMarketingDefinitionsController.DeployDefinitions(String definitionTypes, Boolean publishTaxonomies)
   at lambda_method(Closure , ControllerBase , Object[] )
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
> Nested Exception
Exception: System.NotSupportedException
Message: The definition manager is in read only mode in this environment.
Source: Sitecore.Marketing
   at Sitecore.Marketing.Definitions.DefinitionManagerBase`1.EnsureWriteIsEnabled()
   at Sitecore.Marketing.Definitions.DefinitionManagerBase`1.Save[TRecord](TDefinition definition, Boolean activate, IDefinitionRepository`1 repository, Action`2 setCustomFields)
   at Sitecore.Marketing.Definitions.Goals.GoalDefinitionManager.SaveAsync(IGoalDefinition definition, Boolean activate)
   at Sitecore.Analytics.Reporting.DefinitionData.Marketing.Deployment.DeploymentManager.<DeployAllAsync>d__d`1.MoveNext()
  • Could you find GoalDefinitionManager configuration in /sitecore/admin/ShowConfig.aspx and include it in your question? – Dmytro Shevchenko Nov 14 '16 at 11:29
6

Background

Under sitecore/marketingDefinitions/goal/definitionManager, you have the following parameter configured:

<param desc="isReadOnly" type="System.Boolean" factoryMethod="Parse" arg0="true" patch:source="Sitecore.Marketing.config" />

This means that the definition manager is configured to be read-only.

Here's the original text of this node in Sitecore.Marketing.config:

<param desc="isReadOnly" type="System.Boolean" factoryMethod="Parse" arg0="$(marketingDefinitions.isReadOnly)" />

As you can see, the value of this parameter is taken from marketingDefinitions.isReadOnly—a Sitecore configuration variable. This variable is defined in the same file and by default it's set to false:

<sc.variable name="marketingDefinitions.isReadOnly" value="false" />

This variable can be set to true in certain environments. Here's a list of predefined configs where this value is changed to true:

  • Sitecore.MarketingCD.config.disabled
  • Sitecore.MarketingProcessingRole.config.disabled
  • Sitecore.MarketingReportingRole.config.disabled
  • Sitecore.Xdb.Remote.Server.config.disabled

Solution

Make sure that the configuration of your CM server is correct. It shouldn't be configured as a processing or a CD server. The variable marketingDefinitions.isReadOnly needs to be set to false, the same as it is out of the box.

  • 1
    That was exactly the issue. In my case the setting was being overwritten by Sitecore.MarketingProcessingRole.config – josedbaez Nov 14 '16 at 13:45

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.