Copied to clipboard

Flag this post as spam?

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


  • Bill 81 posts 83 karma points
    Jul 30, 2010 @ 02:15
    Bill
    0

    Unable to publish

     

    So, this is what happened...

     

    I did some R&D with the API and I added a method in my XSLT Extension, just to test the Publish method

     

            public static string testPublish(string nodeName)

            {

                try

                {

                    DocumentType dt = DocumentType.GetByAlias("textpage");

                    User author = User.GetUser(0);

                    Document doc = Document.MakeNew(nodeName, dt, author, 1049);

                    doc.Publish(author);

                    umbraco.library.UpdateDocumentCache(doc.Id);

                }

                catch (Exception e)

                {

     

                    return "something went wrong with the node! Exeption thrown" + "<br/>" + e.Message.ToString();

                }

                return "Document Published!";

            }

    The thing is that after I created some nodes that were working just fine (I could see them in my menu, etc) I went back to the backend and suddenly I could't publish any nodes. And I got this error

     

     

    Object reference not set to an instance of an object.

    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.NullReferenceException: Object reference not set to an instance of an object.

     

    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: 

     

    [NullReferenceException: Object reference not set to an instance of an object.]

       umbraco.content.ValidateSchema(String docTypeAlias, XmlDocument xmlDoc) +51

       umbraco.content.AppendDocumentXml(Int32 id, Int32 level, Int32 parentId, XmlNode docXml, XmlDocument xmlContentCopy) +120

       umbraco.content.PublishNodeDo(Document d, XmlDocument xmlContentCopy, Boolean updateSitemapProvider) +217

       umbraco.content.UpdateDocumentCache(Document d) +407

       umbraco.content.UpdateDocumentCache(Int32 pageId) +75

       umbraco.library.UpdateDocumentCache(Int32 DocumentId) +150

       umbraco.cms.presentation.editContent.Publish(Object sender, EventArgs e) +462

       System.EventHandler.Invoke(Object sender, EventArgs e) +0

       umbraco.controls.ContentControl.savePublish(Object Sender, ImageClickEventArgs e) +96

       System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115

       System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +120

       System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10

       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13

       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36

       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

     

     

     

    I edited the web.config to restart the application, I did the whole iisreset routine and still I couldn't publish. So I went to the umbracoLog to check things out. So there are my findings:

     

    Entry 2992: Loading content from database...

     

    Entry: 2993: NodeId: -1

     

    Error Republishing: System.Xml.XmlException: '>' is an unexpected token. Expecting white space. Line 13, position 15.

       at System.Xml.XmlTextReaderImpl.Throw(Exception e)

       at System.Xml.XmlTextReaderImpl.DtdParserProxy.System.Xml.IDtdParserAdapter.Throw(Exception e)

       at System.Xml.DtdParser.Throw(Int32 curPos, String res, String arg)

       at System.Xml.DtdParser.GetToken(Boolean needWhiteSpace)

       at System.Xml.DtdParser.ParseElementDecl()

       at System.Xml.DtdParser.ParseSubset()

       at System.Xml.DtdParser.ParseInDocumentDtd(Boolean saveInternalSubset)

       at System.Xml.DtdParser.Parse(Boolean saveInternalSubset)

       at System.Xml.DtdParser.System.Xml.IDtdParser.ParseInternalDtd(IDtdParserAdapter adapter, Boolean saveInternalSubset)

       at System.Xml.XmlTextReaderImpl.ParseDtd()

       at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl()

       at System.Xml.XmlTextReaderImpl.ParseDocumentContent()

       at System.Xml.XmlTextReaderImpl.Read()

       at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)

       at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)

       at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)

       at System.Xml.XmlDocument.Load(XmlReader reader)

       at System.Xml.XmlDocument.LoadXml(String xml)

       at umbraco.content.InitContentDocumentBase(XmlDocument xmlDoc)

       at umbraco.content.LoadContentFromDatabase()

    Xml wasn't saved: System.Xml.XmlException: Invalid XML document. The document does not have a root element.

       at System.Xml.XmlDocument.Save(String filename)

       at umbraco.content.PersistXmlToFile(XmlDocument xmlDoc)

    When I try to open the homepage node (ID 1049), I can see the contents but I can't publish it. I get this log entry at the node -1 after the publish of the node 1049

     

    At /umbraco/editContent.aspx?id=1049 (Referred by: http://localhost/umbraco/editContent.aspx?id=1049): System.NullReferenceException: Object reference not set to an instance of an object.

       at umbraco.content.ValidateSchema(String docTypeAlias, XmlDocument xmlDoc)

       at umbraco.content.AppendDocumentXml(Int32 id, Int32 level, Int32 parentId, XmlNode docXml, XmlDocument xmlContentCopy)

       at umbraco.content.PublishNodeDo(Document d, XmlDocument xmlContentCopy, Boolean updateSitemapProvider)

       at umbraco.content.UpdateDocumentCache(Document d)

       at umbraco.content.UpdateDocumentCache(Int32 pageId)

       at umbraco.library.UpdateDocumentCache(Int32 DocumentId)

       at umbraco.cms.presentation.editContent.Publish(Object sender, EventArgs e)

       at System.EventHandler.Invoke(Object sender, EventArgs e)

       at umbraco.controls.ContentControl.savePublish(Object Sender, ImageClickEventArgs e)

       at System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)

       at System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)

       at System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)

       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)

       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)

       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    Please help me to understand what happened...

     

    Thank you,

    Bill

     

  • Bill 81 posts 83 karma points
    Jul 30, 2010 @ 12:52
    Bill
    0

    anyone ? please?

    this problem is getting on my nerves ! :(

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jul 30, 2010 @ 13:53
    Sebastiaan Janssen
    0

    This blog post may or may not be of help. :-)

  • Bill 81 posts 83 karma points
    Jul 30, 2010 @ 16:15
    Bill
    0

    After a search in the API and careful reading of the umbracoLog here is the entry which I believe shows where the problem is

    Xml wasn't saved: System.Xml.XmlException: Invalid XML document. The document does not have a root element.
       at System.Xml.XmlDocument.Save(String filename)
       at umbraco.content.PersistXmlToFile(XmlDocument xmlDoc)

    Just noticed that the umbraco.config file keeps disappearing when I try to republish the entire site or just a node. As a result I get the /config/splashes/noNodes.aspx when I run the site.

    Did I say that today I updated to 4.5.1 ? Then the problems started. Everyone else has downloaded and tested 4.5.1 ? Maybe it's a general problem. Or not... :(

  • Bill 81 posts 83 karma points
    Jul 30, 2010 @ 20:20
    Bill
    0

    SOLVED IT!

    After a lot of hours under the umbraco hood I found the problem...

    oh... and the problem was so insignificant that I might be a little dumb. because it was right in front of me.

    Well, apparently I created a document type with a greek name and forgot to change the alias to an english one, as a result, an empty alias for the document type. That messed up the DTD of the umbraco.config xml... and all hell broke loose.

    I guess umbraco shouldn't let you save a doctype with an empty alias... and I guess I should report the bug to the team.

  • Kim Løwert 130 posts 116 karma points
    Oct 08, 2010 @ 17:50
    Kim Løwert
    0

    Hi Bill

    I have run into the same error as you it seems. I have imported some 1000 documents programatically and after they have been imported it seems this issue has occured whenever I try to publish a node or restart the app and so forth. I have checked all my doctypes and they all have an english alias - no funny characters!

    I'm running 4.5.1 as I guess you did. Any other findings you might want to share from your issue-solving actions?

    Thanks a lot in advance :)

    Kim

  • Alex Campbell 47 posts 69 karma points
    Apr 20, 2011 @ 15:02
    Alex Campbell
    0

    Hi Kim

    Did you find a fix for this issue?

    Cheers,

    Alex

Please Sign in or register to post replies

Write your reply to:

Draft