Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Martin Rud 232 posts 902 karma points c-trib
    Nov 26, 2011 @ 01:06
    Martin Rud
    0

    Nodes that are unpublished in backend are still visible in frontend

    More and more often it occurs that pages that editors have unpublished are not removed from the frontend (and not removed from /App_Data/umbraco.config). When I look in the cmsContentXml table the nodes of which I am speeking are not there (which I guess is right?).

    To my client it is a big problem since they can´t trust the CMS anymore. When they wan´t tho remove content from the website it doesn´t happen. 

    The setup is:

    • umbraco v 4.7.1 (Assembly version: 1.0.4281.20201)
    • .Net Version  4.0.30319.239
    • Microsoft-IIS/7.5
    • MS SQL 2008

    Frequent error log entries are:

    • Couldn't find any page with the nodeId = 2365. This is most likely caused by the page isn't published!  Parameter name: nodeId
    • Error adding node with url 'Tøj og accessories' to SiteMapProvider: System.InvalidOperationException: Multiple nodes with the same URL '/toej-og-accessories/' were found. XmlSiteMapProvider requires that sitemap nodes have unique URLs.     at System.Web.StaticSiteMapProvider.AddNode(SiteMapNode node, SiteMapNode parentNode)     at umbraco.presentation.nodeFactory.UmbracoSiteMapProvider.UpdateNode(Node node)
    • Error adding to SiteMapProvider in loadNodes(): System.InvalidOperationException: Multiple nodes with the same URL '/' were found. XmlSiteMapProvider requires that sitemap nodes have unique URLs.     at System.Web.StaticSiteMapProvider.AddNode(SiteMapNode node, SiteMapNode parentNode)     at umbraco.presentation.nodeFactory.UmbracoSiteMapProvider.loadNodes(String parentId, SiteMapNode parentNode)
    • Error adding to SiteMapProvider: System.InvalidOperationException: Multiple nodes with the same URL '/' were found. XmlSiteMapProvider requires that sitemap nodes have unique URLs.     at System.Web.StaticSiteMapProvider.AddNode(SiteMapNode node, SiteMapNode parentNode)     at umbraco.presentation.nodeFactory.UmbracoSiteMapProvider.loadNodes(String parentId, SiteMapNode parentNode)
    • Error in Execute SQL Package action for package 301 URL Tracker error:umbraco.DataLayer.SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery ---> System.Data.SqlClient.SqlException: There is already an object named 'infocaster301' in the database.     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.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)     at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)     at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()     at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters)     at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters)     at umbraco.DataLayer.SqlHelpers.SqlServer.SqlServerHelper.ExecuteNonQuery(String commandText, SqlParameter[] parameters)     at umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters)     --- End of inner exception stack trace ---     at umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters)     at PackageActionsContrib.ExecuteSql.Execute(String packageName, XmlNode xmlData) 
    • Error loading package action 'addApplicationTree' for package 301 URL Tracker: umbraco.DataLayer.SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery ---> System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'PK_umbracoAppTree'. Cannot insert duplicate key in object 'dbo.umbracoAppTree'. The duplicate key value is (settings, 301URLTracker).  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.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.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)     at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()     at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters)     at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters)     at umbraco.DataLayer.SqlHelpers.SqlServer.SqlServerHelper.ExecuteNonQuery(String commandText, SqlParameter[] parameters)     at umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters)     --- End of inner exception stack trace ---     at umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters)     at umbraco.BusinessLogic.ApplicationTree.MakeNew(Boolean silent, Boolean initialize, Byte sortOrder, String applicationAlias, String alias, String title, String iconClosed, String iconOpened, String assemblyName, String type, String action)     at umbraco.cms.businesslogic.packager.standardPackageActions.addApplicationTree.Execute(String packageName, XmlNode xmlData)     at umbraco.cms.businesslogic.packager.PackageAction.RunPackageAction(String packageName, String actionAlias, XmlNode actionXml)
    • Error publishing node: System.NullReferenceException: Object reference not set to an instance of an object.     at umbraco.presentation.UmbracoContext.get_Current()     at umbraco.library.GetXmlNodeById(String id)     at umbraco.presentation.nodeFactory.Node..ctor(Int32 NodeId)     at InfoCaster.Umbraco._301UrlTracker.Base301URLTracker.Document_BeforePublish(Document doc, PublishEventArgs e)     at umbraco.cms.businesslogic.web.Document.FireBeforePublish(PublishEventArgs e)     at umbraco.cms.businesslogic.web.Document.PublishWithResult(User u)     at umbraco.presentation.publishingService.CheckPublishing(Object sender)

    (BTW: It´s somehow the opposite problem of this one: http://our.umbraco.org/forum/ourumb-dev-forum/bugs/26083-Page-unpublish-after-publish (which I also encounter on my site))

     

    Best regards, Martin                       

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Nov 26, 2011 @ 08:49
    Jan Skovgaard
    0

    Hi Martin

    It should not be neccesary to do this when nodes have been unpublished, but maybe it can be a workaround untill the main problem is detected - what happens if you go to the "Content" node and right click to select "Republish entire site"? Are the unpublished nodes then still visible?

    /Jan

  • Martin Rud 232 posts 902 karma points c-trib
    Nov 26, 2011 @ 13:10
    Martin Rud
    0

    Hi Jan,

    Thanks for your tip. I did actually do that yesterday ("Republish entire site" via the "Content" node), but it didn´t make the node go unpublished as I hoped. 

    But then - today 12 hours later - I see that the page is now indeed unpublished the way it should be. Can it be some kind of caching problem? (it is no longer represented in the App_Data/umbraco.config file).

    /Martin

  • Vincent Lui 11 posts 31 karma points
    Nov 30, 2011 @ 01:25
    Vincent Lui
    0

    I am getting the exact same problems. Unpublished nodes are appearing in umbraco.config file. The client is also not trusting the CMS because of this problem as they did not want media sensitive information to be available at all. I am running on 4.5.2 with .Net 3.5.

  • Martin Rud 232 posts 902 karma points c-trib
    Dec 03, 2011 @ 14:59
    Martin Rud
    0

    Hi list,

    Since no answer has come up yet I have now created a usercontrol that I call 4 times a day in order to republish the Umbraco-solution via the API. I don´t know yet if it works, but I hope. I will use the next week or two to see if it helps.

    My usercontrol is:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    using umbraco.BusinessLogic;
    
    namespace expAutoRepublish
    {
        public partial class autoRepublish : System.Web.UI.UserControl
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
                try {
                    Log.Add(LogTypes.Debug, 0, "expAutoRepublish started.");
    
                    Server.ScriptTimeout = 100000;
                    umbraco.cms.businesslogic.web.Document.RePublishAll();
                    umbraco.library.RefreshContent();
    
                    Log.Add(LogTypes.Debug, 0, "expAutoRepublish succeeded.");
                    Label1.Text = "expAutoRepublish succeeded";
                }
    
                catch (Exception ex)
                {
                    Log.Add(LogTypes.Error, 0, "expAutoRepublish failed: " + ex.ToString());
                    Label1.Text = "expAutoRepublish failed: " + ex.ToString();
                }
    
            }
        }
    }
    
    

     I have inserted it on a template called expAutoRepublish and via UmbracoSettings.config I call it 4 times a day:

     

         
          <scheduledTasks>
                    <task log="true" alias="expAutoRepublish" interval="21600" url="http://www.mydomain.com/expAutoRepublish"/>
        </scheduledTasks>          
        

     

    Maybe som others wan´t to try the code.... :)

    Regards,

    Martin 

     

     

     

     

  • Martin Rud 232 posts 902 karma points c-trib
    Dec 03, 2011 @ 23:30
    Martin Rud
    0

    Hi again,

    Forgot to explain my thoughts behind the above possible solution:

    Observation: There was a mismatch between publish status of some nodes in backend and their status in frontend. This mismatch was also observed in the database "cmsContentXml" (corresponds to the backend) and the XML-file App_Data/umbraco.config.

    Possible solution: My possible solution stems from this article: http://our.umbraco.org/wiki/reference/api-cheatsheet/publishing-and-republishing. Se section "Republishing an entire site" > "Advanced republishing". It says "If the umbraco.library.RefreshContent() call is not enough to get your site cache in order, due to either past errors or the xml not being generated properly, there are several ways to force parts of a website xml to be regerated from scratch."

     

  • Martin Rud 232 posts 902 karma points c-trib
    Dec 21, 2011 @ 19:50
    Martin Rud
    0

    Hi all, 

    I owe You a status: The above solution (user control) has solved my  problem. :)

     

    /Martin

Please Sign in or register to post replies

Write your reply to:

Draft