Marketing Definitions error deploying the definitions in Sitecore PaaS 9.0.2 and 9.1.0
If you are running Sitecore PaaS for versions 9.0.2 (Sitecore 9.0 Update 2) or 9.1.0 (Sitecore 9.1 Initial Release), you may run into the following error when deploying Marketing Definitions:
There was an error deploying the definitions. Consult the Sitecore logs for more information.
Assuming you don’t have certificate issues and can successfully populate and rebuild the Solr indexes, this has been noted by Sitecore as a bug.
They have provided a hotfix, but you will need to contact Sitecore Support to obtain it, as your environment could have other issues at play that would not be appropriate for this patch.
What is Causing This Error?
Definitions are in fact getting deployed, but the deployment process runs longer than Azure expects and requests are aborted (the deployment completes in the background) so the UI displays as an error when deploying the definitions.
How Does the Patch Fix This?
The patch includes a fresh .dll for the bin and a replacement DeployMarketingDefinitions.js file.
Per deep analysis by my colleague Grant Killian, the primay change is one instruction in the .js that engages the Sitecore API (C# instead of JavaScript) so the patched operation is performed on a different MVC Controller.
Original:
jQuery.ajax({
type: "POST",
url: "/api/sitecore/DeployMarketingDefinitions/DeployDefinitions",
data: { …
Patched:
Patched
jQuery.ajax({
type: "POST",
url: "/api/sitecore/SupportDeployMarketingDefinitions/DeployDefinitions",
data: { …
Note the differences in the MVC Controller of the .dll for the received call.
Original:
[HttpPost, ActionName("DeployDefinitions")]
public virtual ActionResult DeployDefinitions(string definitionTypes, bool publishTaxonomies)
{
if (Tracker.IsActive && !Tracker.Current.CurrentPage.IsCancelled)
{
Tracker.Current.CurrentPage.Cancel();
}
string[] strArray = JsonConvert.DeserializeObject<string[]>(definitionTypes);
this.DeployDefinitionTypes(strArray);
string name = string.Empty;
if (publishTaxonomies)
{
name = this.StartTaxonomiesDeploymentJob().Name;
}
return base.Json(new
{
success = true,
jobName = name
}, JsonRequestBehavior.AllowGet);
}
Patched:
[HttpPost, ActionName("DeployDefinitions")]
public virtual ActionResult DeployDefinitions(string definitionTypes, bool publishTaxonomies)
{
if (Tracker.IsActive && !Tracker.Current.CurrentPage.IsCancelled)
{
Tracker.Current.CurrentPage.Cancel();
}
string name = Client.Site.Name;
string str2 = this.StartDefinitionsDeploymentJob(JsonConvert.DeserializeObject<string[]>(definitionTypes), publishTaxonomies, name).Name;
return base.Json(new {
success = true,
jobName = str2
}, JsonRequestBehavior.AllowGet);
}
Thank you for this article, this is really helpful as we are also having similar issue. We contacted support and they are not aware of any support patch for this. Can you please provide provide public reference number or case number or anything that helps them look for it?
Thank you.
That is surprising. Here is the link: https://kb.sitecore.net/articles/322554