Errors & Fixes

[Fixed] #Sitecore – The marketing definition repositories have not been configured.

Posted on Updated on

Been fixing lots of issues with the client project lately, and one of those is the error I encountered in the media library wherein when you click a media item an error will pop up, as show below.

The_marketing_definition_repositories_have_not_been_configured_pop_up_more_details

Pasting the full error traces here.

 

Server Error in ‘/’ Application.

The marketing definition repositories have not been configured.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The marketing definition repositories have not been configured.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:
[InvalidOperationException: The marketing definition repositories have not been configured.]
Sitecore.Marketing.Definitions.Repository.NotConfiguredRepository.Sitecore.Marketing.Definitions.Repository.IDefinitionRepository<Sitecore.Marketing.Definitions.MarketingAssets.Data.MarketingAssetDefinitionRecord>.Get(ID definitionId, CultureInfo cultureInfo, Boolean includeInactiveVersion) +122
Sitecore.Marketing.Definitions.MarketingAssets.MarketingAssetDefinitionManager.Get(ID id, CultureInfo cultureInfo, Boolean includeInactiveVersion) +103
Sitecore.Marketing.Definitions.MarketingAssets.MarketingAssetDefinitionManager.Get(ID id, CultureInfo cultureInfo) +71
Sitecore.Marketing.Client.Shell.Framework.Commands.Marketing.Assets.DeployAsset.QueryState(CommandContext context) +139
Sitecore.Shell.Framework.Commands.CommandManager.QueryState(Command command, CommandContext context) +38
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.FillParamsFromCommand(CommandContext commandContext, RibbonCommandParams ribbonCommandParams) +284
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.GetCommandParameters(Item controlItem, CommandContext commandContext) +83
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderLargeButton(HtmlTextWriter output, Item button, CommandContext commandContext) +82
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderButton(HtmlTextWriter output, Item button, CommandContext commandContext) +462
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunk(HtmlTextWriter output, Item chunk, CommandContext commandContext) +331
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunk(HtmlTextWriter output, Item chunk, CommandContext commandContext, Boolean isContextual, String id) +205
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunk(HtmlTextWriter output, Item chunk, CommandContext commandContext, Boolean isContextual) +237
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunks(HtmlTextWriter output, Item strip, CommandContext commandContext, Boolean isContextual) +437
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderStrips(HtmlTextWriter output, Item ribbon, Boolean isContextual, ListString visibleStripList) +801
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderStrips(HtmlTextWriter output, Item defaultRibbon, Item contextualRibbon, ListString visibleStripList) +283
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.Render(HtmlTextWriter output) +626
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
Sitecore.Web.HtmlUtil.RenderControl(Control ctl) +75
Sitecore.Shell.Applications.ContentManager.ContentEditorForm.UpdateRibbon(Item folder, Boolean isCurrentItemChanged, Boolean showEditor) +462
Sitecore.Shell.Applications.ContentManager.ContentEditorForm.Update() +441
Sitecore.Shell.Applications.ContentManager.ContentEditorForm.OnPreRendered(EventArgs e) +212

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +211
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35
Sitecore.Reflection.ReflectionUtil.CallMethod(Type type, Object obj, String methodName, Boolean includeNonPublic, Boolean includeInherited, Object[] parameters) +37
Sitecore.Reflection.ReflectionUtil.CallMethod(Object obj, String methodName, Boolean includeNonPublic, Boolean includeInherited, Object[] parameters) +66
Sitecore.Shell.Applications.ContentManager.ContentEditorPage.OnPreRender(EventArgs e) +117
System.Web.UI.Control.PreRenderRecursiveInternal() +113
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4297

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34274

Solution:

Make sure that these configurations are existing and enabled.

  1. Sitecore.Marketing.Definitions.MarketingAssets.Repositories.config

Other related configurations you might want to check but they are not mandatory to be able to fix the issue, but still worth noting:

  1. Sitecore.Marketing.Solr.IndexConfiguration.config
  2. Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Web.config
  3. Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.IndexConfiguration.config
  4. Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Master.config
  5. Sitecore.Marketing.Search.config
  6. Sitecore.Marketing.Solr.Index.Master.config
  7. Sitecore.Marketing.Solr.Index.Web.config

[Fixed] HTTP Error 403.14 – Forbidden

Posted on Updated on

Issue: The Web server is configured to not list the contents of this directory.

HTTP_Error_403.14.png

 

Solution: Ensure that it is pointing to the correct website root. To check, In IIS, go to Sites > {YOUR_WEBSITE} > Actions pane > Basic settings > Physical path.

Eg.

D:\SITECORE_PRODCD_UPG\www

Personal note: I might forget the solution for this problem in the future. So by creating a note or a blog post for myself, I would be able to remember the steps to fix the issue which is the best thing to do.

[Custom Fixed] Sitecore WFFM: CheckboxListField.cshtml renders same NAME and ID attribute value on its checkboxes

Posted on Updated on

While we’re doing a regression testing for one of my project, we’ve noticed that the CheckboxListField field renders its checkboxes with the same value for the NAME and ID attributes on its checkboxes for the input HTML tags. Thus, creating a complication on the customization we’ve implemented on the styling of the form.

This is because we just upgraded from Sitecore v.8.1-U2, and started to experience the issue. So,  I did test the issue in a clean copy of v.8.1-U2 and I was able to reproduce the issue.

Describing the concern:

In SC v.8.0 the checkboxes value are incremented correctly.
eg.

Favorite food checkboxlist

In Input tag <input>

  • [ ] Pasta checkbox (id=”wffm6dac667f32104007a914e4628ce2a46d_Sections_0__Fields_0__Value” name=”wffm6dac667f32104007a914e4628ce2a46d.Sections[0].Fields[0].Value”)
  • [ ] Pizza checkbox (id=”wffm6dac667f32104007a914e4628ce2a46d_Sections_0__Fields_1__Value” name=”wffm6dac667f32104007a914e4628ce2a46d.Sections[0].Fields[1].Value”)
  • [ ] Chicken checkbox (id=”wffm6dac667f32104007a914e4628ce2a46d_Sections_0__Fields_2__Value” name=”wffm6dac667f32104007a914e4628ce2a46d.Sections[0].Fields[2].Value”)
BUT in v.8.1-U2

Favorite food checkboxlist

In Input tag <input>

  • [ ] Pasta checkbox (id=”wffm6dac667f32104007a914e4628ce2a46d_Sections_0__Fields_0__Value” name=”wffm6dac667f32104007a914e4628ce2a46d.Sections[0].Fields[0].Value”)
  • [ ] Pizza checkbox (id=”wffm6dac667f32104007a914e4628ce2a46d_Sections_0__Fields_0__Value” name=”wffm6dac667f32104007a914e4628ce2a46d.Sections[0].Fields[0].Value”)
  • [ ] Chicken checkbox (id=”wffm6dac667f32104007a914e4628ce2a46d_Sections_0__Fields_0__Value” name=”wffm6dac667f32104007a914e4628ce2a46d.Sections[0].Fields[0].Value”)

Note: I already raised this concern to Sitecore.

But since we love to play around with the implementation of Sitecore. I managed to find and amend the CheckboxListField.cshtml – \Website\Views\Form\EditorTemplates. 

This is just a workaround while Sitecore haven’t confirmed anything about the issue yet.

In CheckboxListField.cshtml

@using Sitecore.Forms.Mvc.ViewModels.Fields
@using Sitecore.WFFM.Abstractions.Data.Enums
@using Sitecore.Forms.Mvc.Html
@model CheckboxListField

@{
int z = 0;
}

@using (Html.BeginField())
{
var notInline = Model.FormType != FormType.Inline;
<div class="checkbox-wrap">
@foreach (var item in Model.Items)
{
using (Html.BeginTag("div", () => notInline, new { @class = "checkbox" }))
{
var htmlIdForVal = Html.IdFor(x => Model.Value);
var cId = htmlIdForVal.ToString().Replace("Fields_0__Value", "Fields_" + z + "__Value");

var htmlNameForVal = Html.NameFor(x => Model.Value);

using (Html.BeginTag("label", new { @class = notInline ? string.Empty : "checkbox-inline" }))
{

<input type="checkbox" value="@item.Value" id= "@cId" name ="@htmlNameForVal" @(item.Selected ? "checked" : string.Empty) />
@Html.DisplayFor(m => item.Text)
}
}
z++;
}
</div>
}

[Edited 08.04.2016] Important note: Do not update the name attribute, as it would create a complication on the email message when you included the checkbox list field. The problem is that only the first checkbox item (pasta) would show on the email even the 2nd (pizza), 3rd (chicken) checkboxes were checked.

Original value:


@using Sitecore.Forms.Mvc.ViewModels.Fields
@using Sitecore.WFFM.Abstractions.Data.Enums
@using Sitecore.Forms.Mvc.Html
@model CheckboxListField

@using (Html.BeginField())
{
var notInline = Model.FormType != FormType.Inline;
foreach (var item in Model.Items)
{
using (Html.BeginTag("div", () => notInline, new { @class = "checkbox" }))
{
using (Html.BeginTag("label", new { @class = notInline ? string.Empty : "checkbox-inline" }))
{
<input type="checkbox" value="@item.Value" id="@Html.IdFor(x => Model.Value)" name="@Html.NameFor(x => Model.Value)" @(item.Selected? "checked" : string.Empty)/>
@Html.DisplayFor(m => item.Text)
}
}
}
}

Sitecore Installation Wizard: An item name lenght should be less or equal to 100

Posted on

While installing a new package from production to UAT environment, to sync new content. I encountered the error.

An item name lenght should be less or equal to 100

An_Item_name_length_should_be_less_or_equal_to_100.png

 

Fix:

In Sitecore.config, adjust the settings MaxItemNameLength value to your desired length. So in my case 100 to 1000, then I would revert it back after the installation of the package.

<!-- MAX ITEM NAME
Specifies the maximum length of an item name.
Default value: 100
-->
<setting name="MaxItemNameLength" value="1000" />

 

Sitecore Installation Wizard: ItemNameValidation must satisfy the pattern error

Posted on

Background: We’re near for another production deployment, so the new features from the sprints must be deploy to the development (SIT) and UAT environment for testing before it gets to production env to ensure the quality of work.

Our SIT & UAT environments were quite outdated in terms of content. So in order to sync , I have these possible options:

  1. Get the database from Production environment, restore to lower environments
  2. Unicorn
  3. Package <- I choose this way, as this is the fastest route on my situation.

 

During the installation of the package, I encountered this error.

An item name must satisfy the pattern: ^[\w\*\$][\w\s\-\$]*(\(\d{1,}\)){0,1}$ (controlled by the setting ItemNameValidation)

So what I did is to disable the settings for the validation in App_Config\Sitecore.config

 <!-- <setting name="ItemNameValidation" value="^[\w\*\$][\w\s\-\$]*(\(\d{1,}\)){0,1}$" /> --> 

However, the issue still persist. So I tried my brute force to remove the value of the ItemNameValidation.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<setting name="ItemNameValidation">
<patch:attribute name="value"></patch:attribute>
</setting>
</settings>
</sitecore>
</configuration> 

Usage: Create a config file and deploy to App_Config\Include folder. Remove this setting after you finished installing all the packages.

Then the issue gone away.

 

 

[Fixed] Index_Update_IndexName=genericsearch_master_index|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation

Posted on Updated on

Issue:

 Job started: Index_Update_IndexName=genericsearch_master_index|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; SolrNet.Exceptions.SolrConnectionException: &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;response&gt;
&lt;lst name=&quot;responseHeader&quot;&gt;&lt;int name=&quot;status&quot;&gt;400&lt;/int&gt;&lt;int name=&quot;QTime&quot;&gt;0&lt;/int&gt;&lt;/lst&gt;&lt;lst name=&quot;error&quot;&gt;&lt;lst name=&quot;metadata&quot;&gt;&lt;str name=&quot;error-class&quot;&gt;org.apache.solr.common.SolrException&lt;/str&gt;&lt;str name=&quot;root-error-class&quot;&gt;org.apache.solr.common.SolrException&lt;/str&gt;&lt;/lst&gt;&lt;str name=&quot;msg&quot;&gt;ERROR: [doc=sitecore://master/{5ff1f382-cae2-4c69-907a-06410e3afb9f}?lang=en&amp;amp;ver=1&amp;amp;ndx=genericsearch_master_index] unknown field 'searchfacet_computed'&lt;/str&gt;&lt;int name=&quot;code&quot;&gt;400&lt;/int&gt;&lt;/lst&gt;
&lt;/response&gt;
---&gt; System.Net.WebException: The remote server returned an error: (400) Bad Request.
at System.Net.HttpWebRequest.GetResponse()
at HttpWebAdapters.Adapters.HttpWebRequestAdapter.GetResponse()
at SolrNet.Impl.SolrConnection.GetResponse(IHttpWebRequest request)
at SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String contentType, Stream content, IEnumerable`1 parameters)
--- End of inner exception stack trace ---
at SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String contentType, Stream content, IEnumerable`1 parameters)
at SolrNet.Impl.SolrConnection.Post(String relativeUrl, String s)
at SolrNet.Impl.SolrBasicServer`1.SendAndParseHeader(ISolrCommand cmd)
at Sitecore.ContentSearch.SolrProvider.SolrBatchUpdateContext.AddRange(IEnumerable`1 group, Int32 groupSize)
at Sitecore.ContentSearch.SolrProvider.SolrBatchUpdateContext.Commit()
at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.PerformRebuild(Boolean resetIndex, Boolean optimizeOnComplete, IndexingOptions indexingOptions, CancellationToken cancellationToken)
at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Rebuild(Boolean resetIndex, Boolean optimizeOnComplete)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Jobs.Job.ThreadEntry(Object state)

Solution:

Head to SOLR admin page – http://127.0.0.1:8983/solr, and refresh index that’s throwing an error exception; so in my case genericsearch_master_index.

reload_solr_index

Test again, it should work now.

rebuilding_index_using_indexing_manager

 

Update 14.08.2016 : If the above steps failed. Double check the schema, and see if it’s the latest version and/or has the right settings on it.

[Fixed] Job started: RebuildSearchIndex|System.IO.IOException: Cannot overwrite.

Posted on

Issue:

Job started: RebuildSearchIndex|System.IO.IOException: Cannot overwrite: D:\Instances\8.0-U3\Data\indexes\__system\_655.fdt
at Lucene.Net.Store.FSDirectory.InitOutput(String name)
at Lucene.Net.Store.SimpleFSDirectory.CreateOutput(String name)
at Lucene.Net.Index.FieldsWriter..ctor(Directory d, String segment, FieldInfos fn)
at Lucene.Net.Index.StoredFieldsWriter.InitFieldsWriter()
at Lucene.Net.Index.StoredFieldsWriter.FinishDocument(PerDoc perDoc)
at Lucene.Net.Index.DocumentsWriter.WaitQueue.WriteDocument(DocWriter doc)
at Lucene.Net.Index.DocumentsWriter.WaitQueue.Add(DocWriter doc)
at Lucene.Net.Index.DocumentsWriter.FinishDocument(DocumentsWriterThreadState perThread, DocWriter docWriter)
at Lucene.Net.Index.DocumentsWriter.UpdateDocument(Document doc, Analyzer analyzer, Term delTerm)
at Lucene.Net.Index.IndexWriter.AddDocument(Document doc, Analyzer analyzer)
at Sitecore.Search.IndexUpdateContext.AddDocument(Document document)
at Sitecore.Search.Crawlers.DatabaseCrawler.IndexVersion(Item item, Item latestVersion, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddItem(Item item, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context)
at Sitecore.Search.Index.Rebuild()
at Sitecore.Shell.Applications.Search.RebuildSearchIndex.RebuildSearchIndexForm.Builder.Build()|Job ended: RebuildSearchIndex (units processed: )

Solution:

Unchecked the Read-only option under the Data folder

until_the_readonly

Test again. hooray!

rebuilding_search_indexes