Dynamics CRM 2013 throws SQL Timeout adding a user to a team - dynamics-crm

I have a simple but tough problem.
I am trying to add an user to a team through user interface, however I'm getting SQL Time Out for some users.
I got no plugins firing on association request. I also did not find any familiarity between the ones I am getting this error.
I have even turned the trace log on which did not give me much more details.
Following the error log generated by tracing tool.
Web Service Plug-in failed in SdkMessageProcessingStepId: {D3DE2F15-53FA-4A12-A286-346CC4BFD310}; EntityName: none; Stage: 30; MessageName: Associate; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
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 System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IServiceProvider serviceProvider)
at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
Inner Exception: Microsoft.Crm.CrmException: SQL timeout expired.
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.Pipeline.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.InternalMessageDispatcher.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.ManyToManyForwardEntityAssociationCommand.AssociateEntities(EntityReference entity1, EntityReference entity2, String relationshipName, Boolean associate, ExecutionContext context)
at Microsoft.Crm.Extensibility.ManyToManyForwardEntityAssociationCommand.Execute(RelationshipProcessor processor, EntityMetadata entityMetadata, Guid entityId, EntityReferenceCollection relatedEntities, Boolean associate, ExecutionContext context)
at Microsoft.Crm.Extensibility.RelationshipProcessor.ProcessAssociation(EntityMetadata entityMetadata, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities, Boolean associate, ExecutionContext context)
at Microsoft.Crm.Extensibility.RelationshipProcessor.Associate(EntityReference entityReference, Relationship relationship, EntityReferenceCollection relatedEntities, ExecutionContext context)
Inner Exception: Microsoft.Crm.CrmException: SQL timeout expired.
Inner Exception: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.Crm.ObjectModel.BusinessManagementUtility.LockSystemUserEntriesForTeamMembershipChange(Guid userId, ExecutionContext context)
at Microsoft.Crm.ObjectModel.TeamMembershipServiceInternal`1.Associate(BusinessEntityMoniker entityOneMoniker, BusinessEntityMoniker entityTwoMoniker, String associationRelationshipName, ExecutionContext context)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.HandleAssociationOperation(BusinessEntityMoniker entityOneMoniker, BusinessEntityMoniker entityTwoMoniker, String associationRelationshipName, Boolean createAssociation, ExecutionContext context)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.AssociateEntities(BusinessEntityMoniker entityOneMoniker, BusinessEntityMoniker entityTwoMoniker, String associationRelationshipName, ExecutionContext context)
Inner Exception: System.ComponentModel.Win32Exception: The wait operation timed out

Related

Dynamics 365 CE On Premises, Asynch Service is crashing with SQL Exception related to Datacenter object not found in DB

On one of Client we have Dynamics 365 CE On Premises V 9.0.4xxx.
Environment is Development, single CRM server installation having claim based authentication using ADFS. Database and Reporting Services is on another server.
We are facing some performance issues, when we investigated we found that CRM Async Service is getting crashed with the last message which says that
"The locator service failed to connect to the configuration database (MSCRM_CONFIG). The error was: System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'Datacenter'."
We enabled the CRM Trace Logs and found that Asynch Service is trying to query in the database against Datacenter object which is not to be found. We investigated on many other environments and this table, view or synonym is not to be found in any of the instances. Searched on Internet and though many users faced this issue but didn't found any solution. As a last resort from our end we are in process to move to latest release of Dynamics 365 CE which is 9.1.3.11 in hope if that is a product issue, it might already solved.
If anyone have faced the same issue and/or have a solution, it would be appreciated. Thanks
Complete error msg.
The locator service failed to connect to the configuration database (MSCRM_CONFIG). The error was: System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'Datacenter'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
at Microsoft.Crm.CrmDbConnection.<>c_DisplayClass104_0.<InternalExecuteReader>b_0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)
at Microsoft.Crm.CrmDbConnection.InternalExecuteReader(IDbCommand command, Nullable`1 commandBehavior, Int32 sourceLineNumber, String memberName, String sourceFilePath)
at Microsoft.Crm.CrmDbConnection.ExecuteReader(IDbCommand command, Boolean impersonate, Int32 sourceLineNumber, String memberName, String sourceFilePath)
at Microsoft.Crm.SharedDatabase.DatabaseService.ExecuteBaseReader(CrmDbConnection connection, IDbCommand command, String[] columns, IDictionary collectionToFill)
ClientConnectionId:ef125c05-864e-4598-8ba5-c3f71bad613e
Error Number:208,State:1,Class:16.
Error in Dynamics 365 CE Trace Log

Strange umbraco media cache error happening randomly since 1 January

We are running umbraco 7.15.1
Sudenly we started getting cache error on our logo file and it is happenning randomly. On first occaccion it caused all our website down.
Despite it is the main image of the site - the logo - it does happen only in selected random places. For example the logo displays fine on the website header but fails in an email template or schema snippet.
When it first happened we did update dll on the server and the issue seemed to have been gone but it suddeny happened again yesterday - in a totally different place - in a scheduled task in this case.
Does anybody knows why this may be happening or how to permanently stop it happening again?
This is the example of the related stacktrace:
2020-01-01 00:02:59,398 [P20600/D2/T8] ERROR Umbraco.Core.UmbracoApplicationBase - An unhandled exception occurred
System.Exception: Exception while creating a value. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Lucene.Net.Util.BitVector.Get(Int32 bit)
at Lucene.Net.Index.SegmentTermDocs.Read(Int32[] docs, Int32[] freqs)
at Lucene.Net.Search.TermScorer.NextDoc()
at Lucene.Net.Search.ConjunctionScorer..ctor(Similarity similarity, Scorer[] scorers)
at Lucene.Net.Search.ConjunctionScorer..ctor(Similarity similarity, ICollection scorers)
at Lucene.Net.Search.BooleanScorer2.CountingConjunctionSumScorer(IList requiredScorers)
at Lucene.Net.Search.BooleanScorer2.MakeCountingSumScorerSomeReq()
at Lucene.Net.Search.BooleanScorer2.MakeCountingSumScorer()
at Lucene.Net.Search.BooleanScorer2..ctor(Similarity similarity, Int32 minNrShouldMatch, IList required, IList prohibited, IList optional)
at Lucene.Net.Search.BooleanQuery.BooleanWeight.Scorer(IndexReader reader, Boolean scoreDocsInOrder, Boolean topScorer)
at Lucene.Net.Search.BooleanQuery.BooleanWeight.Scorer(IndexReader reader, Boolean scoreDocsInOrder, Boolean topScorer)
at Lucene.Net.Search.IndexSearcher.Search(Weight weight, Filter filter, Collector collector)
at Lucene.Net.Search.Searcher.Search(Query query, Collector results)
at Examine.LuceneEngine.SearchResults.DoSearch(Query query, IEnumerable`1 sortField, Int32 maxResults) in C:\projects\examine-qvx04\src\Examine\LuceneEngine\SearchResults.cs:line 110
at Examine.LuceneEngine.Providers.BaseLuceneSearcher.Search(ISearchCriteria searchParams, Int32 maxResults) in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\BaseLuceneSearcher.cs:line 182
at Examine.LuceneEngine.Providers.BaseLuceneSearcher.Search(ISearchCriteria searchParams) in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\BaseLuceneSearcher.cs:line 163
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.GetUmbracoMediaCacheValues(Int32 id)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.<>c__DisplayClass38_0.<GetCacheValues>b__0()
at Umbraco.Core.Cache.DictionaryCacheProviderBase.<>c__DisplayClass10_0.<GetSafeLazy>b__0()
--- End of inner exception stack trace ---
at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, CacheDependency dependency)
at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles)
at Umbraco.Core.Cache.DeepCloneRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.GetCacheValues(Int32 id, Func`2 func)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.GetUmbracoMedia(Int32 id)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.GetById(UmbracoContext umbracoContext, Boolean preview, Int32 nodeId)
at Umbraco.Web.PublishedCache.ContextualPublishedCache`1.GetById(Boolean preview, Int32 contentId)
at Umbraco.Web.PropertyEditors.ValueConverters.LegacyMediaPickerPropertyConverter.ConvertSourceToObject(PublishedPropertyType propertyType, Object source, Boolean preview)
at Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedProperty.get_Value()
at Umbraco.Web.PublishedPropertyExtension.GetValue[T](IPublishedProperty property, Boolean withDefaultValue, T defaultValue)
at Umbraco.Web.PublishedContentExtensions.GetPropertyValue[T](IPublishedContent content, String alias, Boolean recurse, Boolean withDefaultValue, T defaultValue)
at Umbraco.Web.PublishedContentExtensions.GetPropertyValue[T](IPublishedContent content, String alias)
at MySite.PublishedModels.Settings.get_Logo()
at MySite.PublishedModels.AppSettings.ContentSettings.get_Logo()
at ASP._Page_Views_Master_cshtml.Execute() in D:\Inetpub\vhosts\MySite.com\httpdocs\Views\Master.cshtml:line 36
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.WebPages.WebPageBase.<>c__DisplayClass40_0.<RenderPageCore>b__0(TextWriter writer)
at System.Web.WebPages.HelperResult.WriteTo(TextWriter writer)
at System.Web.WebPages.WebPageBase.Write(HelperResult result)
at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)
at System.Web.WebPages.WebPageBase.PopContext()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_6.<BeginInvokeAction>b__4()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.<>c.<BeginExecute>b__151_2(IAsyncResult asyncResult, Controller controller)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
And another example from yesterday:
2020-01-05 16:01:17,255 [P20288/D2/T55] ERROR MySite.TaskScheduler.Controllers.ReviewApiController - ** EX ** ***** Review request has failed sending for booking 8XGS1T
System.Exception: Exception while creating a value. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Lucene.Net.Index.SegmentReader.Norm.Clone()
at Lucene.Net.Index.SegmentReader.ReopenSegment(SegmentInfo si, Boolean doClone, Boolean openReadOnly)
at Lucene.Net.Index.SegmentReader.Clone(Boolean openReadOnly)
at Lucene.Net.Index.IndexWriter.ReaderPool.GetReadOnlyClone(SegmentInfo info, Boolean doOpenStores, Int32 termInfosIndexDivisor)
at Lucene.Net.Index.DirectoryReader..ctor(IndexWriter writer, SegmentInfos infos, Int32 termInfosIndexDivisor)
at Lucene.Net.Index.IndexWriter.GetReader(Int32 termInfosIndexDivisor)
at Lucene.Net.Index.IndexWriter.GetReader()
at Lucene.Net.Index.DirectoryReader.DoReopenFromWriter(Boolean openReadOnly, IndexCommit commit)
at Lucene.Net.Index.DirectoryReader.DoReopen(Boolean openReadOnly, IndexCommit commit)
at Lucene.Net.Index.DirectoryReader.Reopen()
at Examine.LuceneEngine.Providers.LuceneSearcher.ReaderReopener.MaybeReopen() in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\LuceneSearcher.cs:line 610
at Examine.LuceneEngine.Providers.LuceneSearcher.ReaderReopener.ScheduleReopen() in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\LuceneSearcher.cs:line 441
at Examine.LuceneEngine.Providers.LuceneSearcher.ValidateSearcher() in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\LuceneSearcher.cs:line 368
at Examine.LuceneEngine.Providers.LuceneSearcher.GetSearchFields() in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\LuceneSearcher.cs:line 245
at UmbracoExamine.UmbracoExamineSearcher.GetSearchFields()
at Examine.LuceneEngine.Providers.BaseLuceneSearcher.CreateSearchCriteria(String type, BooleanOperation defaultOperation) in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\BaseLuceneSearcher.cs:line 117
at UmbracoExamine.UmbracoExamineSearcher.CreateSearchCriteria(String type, BooleanOperation defaultOperation)
at Examine.LuceneEngine.Providers.BaseLuceneSearcher.CreateSearchCriteria(String type) in C:\projects\examine-qvx04\src\Examine\LuceneEngine\Providers\BaseLuceneSearcher.cs:line 273
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.GetUmbracoMediaCacheValues(Int32 id)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.<>c__DisplayClass38_0.<GetCacheValues>b__0()
at Umbraco.Core.Cache.DictionaryCacheProviderBase.<>c__DisplayClass10_0.<GetSafeLazy>b__0()
--- End of inner exception stack trace ---
at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, CacheDependency dependency)
at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles)
at Umbraco.Core.Cache.DeepCloneRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.GetCacheValues(Int32 id, Func`2 func)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.GetUmbracoMedia(Int32 id)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedMediaCache.GetById(UmbracoContext umbracoContext, Boolean preview, Int32 nodeId)
at Umbraco.Web.PublishedCache.ContextualPublishedCache`1.GetById(Boolean preview, Int32 contentId)
at Umbraco.Web.PropertyEditors.ValueConverters.LegacyMediaPickerPropertyConverter.ConvertSourceToObject(PublishedPropertyType propertyType, Object source, Boolean preview)
at Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedProperty.get_Value()
at Umbraco.Web.PublishedPropertyExtension.GetValue[T](IPublishedProperty property, Boolean withDefaultValue, T defaultValue)
at Umbraco.Web.PublishedContentExtensions.GetPropertyValue[T](IPublishedContent content, String alias, Boolean recurse, Boolean withDefaultValue, T defaultValue)
at Umbraco.Web.PublishedContentExtensions.GetPropertyValue[T](IPublishedContent content, String alias)
at MySite.PublishedModels.Settings.get_Logo()
at MySite.PublishedModels.AppSettings.ContentSettings.get_Logo()
at MySite.Umbraco.Settings.Branding.get_Logo()
at CompiledRazorTemplates.Dynamic.RazorEngine_e33f29a961664c7c858a7440f88c8a18.Execute()
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
at MySite.Services.Notification.Emailer`1..ctor(T model, String subject, String messageTemplate, Dictionary`2 replacements, String pathToEmailTemplates)
at MySite.TaskScheduler.Controllers.ReviewApiController.<SendReviewRequest>d__9.MoveNext()
EDIT
get_Logo()
is a get accessor of Logo property.
The property sits under Settings doc type in our umbraco. The namespace for this is MySite.PublishedModels. Logo is of media picket type.
It simply can't get the Logo media file for some reason.

Hangfire dashboard: SqlException: Invalid column name 'Key'

I have Hangfire installed on my web server.
And it works. And i was able to access hangfire dashboard.
But suddenly today i tried to open dashboard and when trying to access http://localhost/hangfire
i get the following error:
An unhandled exception occurred while processing the request.
SqlException: Invalid column name 'Key'.
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, bool breakConnection, Action<Action> wrapCloseInAction)
Stack Query Cookies Headers
SqlException: Invalid column name 'Key'.
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, bool breakConnection, Action<Action> wrapCloseInAction)
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, bool breakConnection, Action<Action> wrapCloseInAction)
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, bool callerHasConnectionLock, bool asyncClose)
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, out bool dataReady)
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
System.Data.SqlClient.SqlDataReader.get_MetaData()
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, string resetOptionsString)
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, bool returnStream, bool async, int timeout, out Task task, bool asyncWrite, SqlDataReader ds)
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, bool returnStream, TaskCompletionSource<object> completion, int timeout, out Task task, bool asyncWrite, string method)
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, bool wasClosed, CommandBehavior behavior)
Dapper.SqlMapper.QueryMultipleImpl(IDbConnection cnn, ref CommandDefinition command)
Dapper.SqlMapper.QueryMultiple(IDbConnection cnn, string sql, object param, IDbTransaction transaction, Nullable<int> commandTimeout, Nullable<CommandType> commandType)
Hangfire.SqlServer.SqlServerMonitoringApi+<>c__DisplayClass24_0.<GetStatistics>b__0(DbConnection connection)
Hangfire.SqlServer.SqlServerStorage.UseConnection<T>(DbConnection dedicatedConnection, Func<DbConnection, T> func)
Hangfire.SqlServer.SqlServerMonitoringApi.GetStatistics()
System.Lazy<T>.ViaFactory(LazyThreadSafetyMode mode)
System.Lazy<T>.ExecutionAndPublication(LazyHelper executionAndPublication, bool useDefaultConstructor)
System.Lazy<T>.CreateValue()
Hangfire.Dashboard.Pages.HomePage.Execute()
Hangfire.Dashboard.RazorPage.TransformText(string body)
Hangfire.Dashboard.RazorPageDispatcher.Dispatch(DashboardContext context)
Hangfire.Dashboard.AspNetCoreDashboardMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext)
Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
Since Dashboard is some internal Hangfire tool - i just don't have an idea here how is it possible to fix the issue.
As the sql is installed by Hangfire
And Hangfire is installed from nuget.
Did anyone experienced this issue?
Any idea how to make hangfire dashboard appear?
Thank you.
Sorry.
I just realized someone renamed [Key] column in one of hangfire tables.
Is all working.

How to prevent this dling/sql error - or is it because bad network?

Step 1)
I check that i can acess server:
(because i have offline handling to)
public static bool dbOnline(string timeOut="3")
{
bool online = false;
try
{
var testConn = new SqlConnection(Utils.ConnectionStr(timeOut));
testConn.Open();
online = true;
testConn.Close();
}
catch (Exception)
{
online = false;
}
return online;
}
2) It returns ok, then i Create dlinq instance !
_DataContext = new DataContext(Utils.ConnectionStr);//System.Data.Linq.DataContext
//then i point out a customer in DB
var customer = _DataContext.Customers.TableQuery().FirstOrDefault(c => c.ID == custid);
//Check its not null
if (customer != null)
{
customer.points+= _points;
customer.LastUpdated = DateTime.Now;
customer.SubmitChanges();
}
3) And sometimes i get this error, is it anything i can do to prevent this, or is it to
fix the network? (i know there is some trouble with the network), but can i do anything
different? - Thanks
Error:
*System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.*
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader()
at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
at System.Data.Linq.ChangeDirector.StandardChangeDirector.DynamicUpdate(TrackedObject item)
at System.Data.Linq.ChangeDirector.StandardChangeDirector.Update(TrackedObject item)
at System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode)
at System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
A timeout is impossible to identify in isolation, however I would usually expect a network error to have a different error. The things I'd look at first:
is the data indexed correctly
was there blocking at the time, most likely by a long-running transaction that has a lock on the data
was there anything like a db grow happening at the time
was the server exceptionally busy at the time
My money would be on the second
Also, we can't see what TableQuery() is; if that returns IEnumerable<Customer>, then it could be related to pulling too much data (in your context, it should probably be returning IQueryable<Customer> at the minumum, but we can't see).
The real thing to do here is to run a SQL trace and try to catch it in the act - see what was happening.

Dynamics CRM error: "The object cannot be updated because it is read-only"

I've got an instance of Dynamics CRM 4.0 with some weird errors. If I close a Case and then try to reactivate it I get the error "The object cannot be updated because it is read-only". This is simple, built-in CRM functionality that works fine on other instances. I get the same error if I try to convert a Quote to an Order - I believe it's trying to update the Quote, which has been "closed" by then. What's wrong and how do I fix it?
MSCRM Error Report:
--------------------------------------------------------------------------------------------------------
Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Error Number: 0x8004022E
Error Message: The object cannot be updated because it is read-only.
Error Details: The object cannot be updated because it is read-only.
Source File: Not available
Line Number: Not available
Request URL: http://jupiter:5555/EN/cs/cases/edit.aspx?id={C75704E2-3B82-DE11-BFAD-00188B2CB446}
Stack Trace Info: [CrmException: The object cannot be updated because it is read-only.]
at Microsoft.Crm.ObjectModel.IncidentService.Update(IBusinessEntity incident, ExecutionContext context)
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IPluginExecutionContext context)
at Microsoft.Crm.Extensibility.PluginStep.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.Pipeline.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.InternalMessageDispatcher.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.ExternalMessageDispatcher.Execute(String messageName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, PropertyBag fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
at Microsoft.Crm.Sdk.RequestBase.Process(Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
at Microsoft.Crm.Sdk.RequestBase.Process(CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
at Microsoft.Crm.Sdk.CrmServiceInternal.Execute(RequestBase request, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
at Microsoft.Crm.Sdk.InProcessCrmService.Execute(Object request)
at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.ExecuteInternal()
at Microsoft.Crm.Application.Platform.ServiceCommands.UpdateCommand.Execute()
at Microsoft.Crm.Application.Platform.EntityProxy.Update(Boolean performDuplicateCheck)
at Microsoft.Crm.Application.Platform.EntityProxy.Update()
at Microsoft.Crm.Web.CS.CaseDetailPage.Open(Object sender, DataEventArgs e)
at Microsoft.Crm.Application.Forms.DataEventProcessor.Raise(FormEventId eventId, FormState state, IUser user, String objectId, Entity entity)
at Microsoft.Crm.Application.Forms.AppForm.RaiseDataEvent(FormEventId eventId)
at Microsoft.Crm.Application.Forms.EndUserForm.Initialize(Entity entity)
at Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity, String formType)
at Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity)
at Microsoft.Crm.Web.CS.CaseDetailPage.ConfigureForm()
at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
[HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.]
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.en_cs_cases_edit_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Try disabling your onload and onsave code to see if that is causing any problems. To quickly and temporarily disable the events, open the dialog box where you paste in your onload/onsave code and uncheck 'Event is enabled'. Then save the form and publish the entity. Does the error still occur?

Resources