Today I've had an absolute nightmare with a cache related issue. Somehow, not yet sure why, but the cache file got wiped out containing only the the list of elements in the head and the root node as follows:
<root id="-1" />
I removed the umbraco.config file and no matter how many times I ran umbraco/dialogs/republish.aspx?xml=true the cache file would not rebuild or create a new file and even now it still won't. I get no errors or feedback in the UI however in the log table it is flooded with errors like this:
Error Republishing: System.ArgumentException: An item with the same key has already been added. at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at umbraco.content.LoadContentFromDatabase()
Unfortunately not very descriptive or indicative of where the problem lies. I know what most people are thinking, it's permissions but I am confident it's not because permissions had not change, have since been reapplied and still no result.
One major side effect of this issue with the cache being wiped out is that the UI no now longer renders content nodes but instead replaces them all with a YSOD as follows:
[NullReferenceException: Object reference not set to an instance of an object.]
Umbraco.Web.DefaultPublishedContentStore.GetDocumentById(UmbracoContext umbracoContext, Int32 nodeId) +61
Umbraco.Web.Routing.NiceUrlProvider.GetNiceUrl(Int32 nodeId, Uri current, Boolean absolute) +195
umbraco.cms.presentation.editContent.UpdateNiceUrls() +251
System.Web.UI.Control.PreRenderRecursiveInternal() +112
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4200
I managed to bring the site back online by copying up a cache file from a few days ago however this does not solve the problem by any means as the cache file is outdated and will remain so until the client can publish again. This does however allow me to access content nodes in the UI again, publishing with this file now in place does update the umbraco.config in part however it still retains outdated content and a republish all does not refresh the umbraco.config in it's entirety leaving a mix of old and new content.
In my bid to find out more about the publishing problem I deleted the umbraco.config file and created a new clean on. I added a root node as above and also copied in from an old version all of the elements listed in the head of the file. I then got the UI back and now I get a new error, this time when I try to publish a single document:
[NullReferenceException: Object reference not set to an instance of an object.]
Umbraco.Web.DefaultPublishedContentStore.GetDocumentById(UmbracoContext umbracoContext, Int32 nodeId) +61
Umbraco.Web.Routing.NiceUrlProvider.GetNiceUrl(Int32 nodeId, Uri current, Boolean absolute) +195
umbraco.cms.presentation.editContent.UpdateNiceUrls() +251
System.Web.UI.Control.PreRenderRecursiveInternal() +112
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4200
Something has gone very wrong here and I'm starting to run out of ideas as to a) the cause and b) the solution to rebuilding the cache file in it's entirety.
1) Is this an upgrade to 4.11.4 from an older version? If so, do you have old ucomponents dll's still? As they gave me all sorts of problems until I upgraded ucomponents.
2) This isn't the Examine problem that Shannon posted a fix for is it? Do you have # in the backend for the page urls on the properties tab?
In case its relevant I'm also looking in the UmbracoTracelog.txt and finding a lot of this:
2013-04-08 20:44:56,781 [25] ERROR umbraco.DataLayer.SqlHelper`1[[System.Data.SqlClient.SqlParameter, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] - [Thread 19] Error executing query Select [value] from cmsDataTypeprevalues where id in ()
System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ')'.
at System.Data.SqlClient.SqlConnection.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.ExecuteReader(CommandBehavior behavior)
at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters)
at umbraco.DataLayer.SqlHelpers.SqlServer.SqlServerHelper.ExecuteReader(String commandText, SqlParameter[] parameters)
at umbraco.DataLayer.SqlHelper`1.ExecuteReader(String commandText, IParameter[] parameters)
2013-04-08 20:47:15,310 [25] ERROR Umbraco.Web.UmbracoApplication - [Thread 7] An unhandled exception occurred
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Umbraco.Web.DefaultPublishedContentStore.GetDocumentById(UmbracoContext umbracoContext, Int32 nodeId)
at Umbraco.Web.Routing.NiceUrlProvider.GetNiceUrl(Int32 nodeId, Uri current, Boolean absolute)
at umbraco.cms.presentation.editContent.UpdateNiceUrls()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
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.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
If I were you, I'd attach the umbraco v4.11.4 source to your w3wp process and republish the XML file. At some point an exception will occur, Visual Studio will break and you'll be able to 'see' what the problem is.
I am pulling down a copy of the site for local debugging now. I am finding I can correct the contents of the cache by unpublishing and republishing by section. It removes the old cache and then refreshes the cache for that part of the site. Still a mystery why this cannot happen for the entire site refresh.
I'm sure you'll be able to find the answer with debugging. Must be some exotic scenario, maybe a Node with special characters, a corrupted Node or something similar...?
Breaking into the Umbraco source I am finding that the exceptions are always thrown in the data layer with the following command text:
Select [value] from cmsDataTypeprevalues where id in ()
So, I'm hoping that this indicates the issues are potentially realated to a datatype prevalues somewhere in the system but now to try and track down what and why.
it didn't fix the problem, I'm now going to upgrade to 4.11.6 in a final attempt to sort this. I have found that unpublish/republish of sections of the site does sort some of the out of date cache issue but still not possible to regenerate the entire site cache.
Did you fix the problem, I have identical problem with the same errors, v4.11.4 I want to update to 4.11.8 but not sure if that fix the issue, I am thinking that is something wrong with the content or related to examine, because once it generate the cache when I was messing with the examine reindex and examine files but it never generate the cache again after that.
I can't say I fixed the problem but I did find a way around it which was not ideal but got the site back online and up to date. That said, the issue does still exist. To get around it I unpublished then republished all root nodes which generated the correct cache entries in the umbraco.config file.
That's certainly useful to know, I will have to see if I have the same success as upgrading to 4.11.6 didn't resolve it for me so will upgrade to 4.11.8.
Cache Problems in 4.11.4 - Won't Rebuild
Today I've had an absolute nightmare with a cache related issue. Somehow, not yet sure why, but the cache file got wiped out containing only the the list of elements in the head and the root node as follows:
I removed the umbraco.config file and no matter how many times I ran umbraco/dialogs/republish.aspx?xml=true the cache file would not rebuild or create a new file and even now it still won't. I get no errors or feedback in the UI however in the log table it is flooded with errors like this:
Unfortunately not very descriptive or indicative of where the problem lies. I know what most people are thinking, it's permissions but I am confident it's not because permissions had not change, have since been reapplied and still no result.
One major side effect of this issue with the cache being wiped out is that the UI no now longer renders content nodes but instead replaces them all with a YSOD as follows:
I managed to bring the site back online by copying up a cache file from a few days ago however this does not solve the problem by any means as the cache file is outdated and will remain so until the client can publish again. This does however allow me to access content nodes in the UI again, publishing with this file now in place does update the umbraco.config in part however it still retains outdated content and a republish all does not refresh the umbraco.config in it's entirety leaving a mix of old and new content.
In my bid to find out more about the publishing problem I deleted the umbraco.config file and created a new clean on. I added a root node as above and also copied in from an old version all of the elements listed in the head of the file. I then got the UI back and now I get a new error, this time when I try to publish a single document:
Something has gone very wrong here and I'm starting to run out of ideas as to a) the cause and b) the solution to rebuilding the cache file in it's entirety.
Any help would be much appreciated.
Thanks, Simon
Just two ideas...
1) Is this an upgrade to 4.11.4 from an older version? If so, do you have old ucomponents dll's still? As they gave me all sorts of problems until I upgraded ucomponents.
2) This isn't the Examine problem that Shannon posted a fix for is it? Do you have # in the backend for the page urls on the properties tab?
Hi Lee.
1) Yes from 4.11.3. Possibly have old uComponents binaries 5.0.0-alpha by the looks of it so will try and upgrade that
2) I've run PathFix many times now and it didn't seemt to help.
Will let you know how it goes.
Thanks, Simon
Unfortunately the uComponents upgrade didn't sort the issue but worth doing anyway.
Cheers
In case its relevant I'm also looking in the UmbracoTracelog.txt and finding a lot of this:
If I were you, I'd attach the umbraco v4.11.4 source to your w3wp process and republish the XML file.
At some point an exception will occur, Visual Studio will break and you'll be able to 'see' what the problem is.
I am pulling down a copy of the site for local debugging now. I am finding I can correct the contents of the cache by unpublishing and republishing by section. It removes the old cache and then refreshes the cache for that part of the site. Still a mystery why this cannot happen for the entire site refresh.
Simon
I'm sure you'll be able to find the answer with debugging. Must be some exotic scenario, maybe a Node with special characters, a corrupted Node or something similar...?
Good luck and let us know!
Breaking into the Umbraco source I am finding that the exceptions are always thrown in the data layer with the following command text:
So, I'm hoping that this indicates the issues are potentially realated to a datatype prevalues somewhere in the system but now to try and track down what and why.
Well you can use the call stack to move up in the stack and find out for which datatype this exception occurs.
I wasn't finding anything useful in there but Sebastiaan has pointed me towards this which looks like it could be related:
http://issues.umbraco.org/issue/U4-1802
Upgrading locally now to try.
Great that Sebastiaan has probably figured it out!
it didn't fix the problem, I'm now going to upgrade to 4.11.6 in a final attempt to sort this. I have found that unpublish/republish of sections of the site does sort some of the out of date cache issue but still not possible to regenerate the entire site cache.
Simon
Hey Simon,
Did you fix the problem, I have identical problem with the same errors, v4.11.4 I want to update to 4.11.8 but not sure if that fix the issue, I am thinking that is something wrong with the content or related to examine, because once it generate the cache when I was messing with the examine reindex and examine files but it never generate the cache again after that.
I can't say I fixed the problem but I did find a way around it which was not ideal but got the site back online and up to date. That said, the issue does still exist. To get around it I unpublished then republished all root nodes which generated the correct cache entries in the umbraco.config file.
I hope that is of some help?
Simon
Well I update to version 4.11.8 and that fix my problem. the cache regenerate itself. Simon thank you for answer and comments.
That's certainly useful to know, I will have to see if I have the same success as upgrading to 4.11.6 didn't resolve it for me so will upgrade to 4.11.8.
Simon
is working on a reply...