System.ArgumentException: Empty strings are not allowed. Parameter name: connectionString at Sitecore.Analytics.Data.DataAccess.DataAdapters.Sql.SqlServer.SqlServerDataAdapterProvider..ctor()

Recently one of my developers ran in to the following error when previewing a field of the type "Mutlilist with Search"  in content editor in Sitecore 7.2:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.---> System.ArgumentException: Empty strings are not allowed. Parameter name: connectionString at Sitecore.Data.SqlServer.SqlServerDataApi..ctor(String connectionString) at Sitecore.Analytics.Data.DataAccess.DataAdapters.Sql.SqlServer.SqlServerDataAdapterProvider..ctor() --- End of inner exception stack trace-- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters) at Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) at Sitecore.Configuration.Factory.GetProviders[TProvider,TCollection](List`1 nodes) at Sitecore.Configuration.Factory.GetProviders[TProvider,TCollection](String rootPath, TProvider& defaultProvider) at Sitecore.Configuration.ProviderHelper`2.ReadProviders() at Sitecore.Configuration.ProviderHelper`2.get_Provider() at Sitecore.Analytics.Data.DataAccess.DataAdapters.DataAdapterManager.LoadVisitor(VisitorDataSet dataSet, VisitorLoadOptions visitorLoadOptions) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Analytics.Data.DataAccess.DataSets.VisitorDataSet.Load(VisitorLoadOptions visitorLoadOptions) at Sitecore.Analytics.Data.DataAccess.Visitor.Load() at Sitecore.Analytics.Data.DataAccess.Visitor.GetCurrentVisit() at Sitecore.Analytics.Data.DataAccess.Visitor.GetOrCreateCurrentVisit() at Sitecore.ContentSearch.Pipelines.TranslateQuery.AnalyticsContextResolver.Search(TranslateQueryArgs args) at Sitecore.ContentSearch.Pipelines.TranslateQuery.AnalyticsContextResolver.Process(TranslateQueryArgs args) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.ContentSearch.Pipelines.TranslateQuery.TranslateQueryPipeline.Run(ICorePipeline pipeline, TranslateQueryArgs args) at Sitecore.ContentSearch.Utilities.LinqHelper.CreateQuery[T](IProviderSearchContext context, IEnumerable`1 searchStringModel, Item startLocationItem, IEnumerable`1 additionalContexts) at Sitecore.ContentSearch.Utilities.LinqHelper.CreateQuery[T](IProviderSearchContext context, IEnumerable`1 searchStringModel) at Sitecore.Buckets.FieldTypes.SearchList.GetItems(Item current) at Sitecore.Buckets.FieldTypes.SearchList.DoRender(HtmlTextWriter output) at Sitecore.Web.UI.WebControl.Render(HtmlTextWriter output) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 
The issue was caused by an empty connection string for Analytics DB. So we simpy removed the connection string and ran into the following error:
Exception: System.InvalidOperationException
Message: 'analytics' connection string is not defined
Source: Sitecore.Kernel
   at Sitecore.Diagnostics.Assert.IsNotNull(Object value, String message)
   at Sitecore.Diagnostics.Assert.ResultNotNull[T](T result, String message)
   at Sitecore.Analytics.Data.DataAccess.DataAdapters.DataAdapterManager.ConnectionStrings. get_AnalyticsSettings()
   at Sitecore.Analytics.Data.DataAccess.DataAdapters.DataAdapterManager.ConnectionStrings. get_Analytics()
   at Sitecore.Analytics.Data.DataAccess.DataAdapters.Sql.SqlServer.SqlServerDataAdapterProvider. .ctor()

So what happened here was that Analytics for Sitecore had been enabled on the DEV environment and the changes to the Sitecore.Anaytlics.config were checked into source control. The local developer sandboxes were never configured with Analytics. The two settings that trigger Sitecore to look for Analytics DB are:

<!--  ANALYTICS DISABLE DATABASE
            Disables the database so that no reading or writing to the database occurs.
            Default: false
      -->
      <setting name="Analytics.DisableDatabase" value="false" />
<!--  ANALYTICS ENABLED
            Determines whether analytics is enabled or not.
            Default: true
      -->
      <setting name="Analytics.Enabled" value="true" />

 Simply disabling the Analytics DB by setting the Analytics.DisableDatabase to "true" solved the problem.

Now, what I am yet to figure out is what did that "Multilist with Search" field check for Analytics DB when none of the other field types did. Please feel free to post any comments or suggestions.

Comments

Popular posts from this blog

RESOLVED: Sitecore Solr provider error: Value cannot be null. Parameter name: fieldNameTranslator.

TDS Build Error Unable to copy file "\bin\**\*.*" to "\Website\*.*". Illegal characters in path. C:\Program Files (x86)\MSBuild\HedgehogDevelopment\SitecoreProject\v9.0\HedgehogDevelopment.SitecoreProject.targets