Copied to clipboard

Flag this post as spam?

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


  • Ryan 14 posts 35 karma points
    Dec 08, 2010 @ 19:05
    Ryan
    0

    umbraco.config disappears when I publish the entire site

    I am using Umbraco 4.0.2.1.

    When I do certain things in the backend, it deletes the umbraco.config file and takes down my entire site. When I look at the umbracoLog table, I can see these errors:

    id userId NodeId Datestamp logHeader logComment

    207859 0 -1 2010-12-08 10:50:54.710 Error 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.SaveContentToDisk(XmlDocument xmlDoc)

    207856 0 -1 2010-12-08 10:50:54.697 Error Error Republishing: System.Xml.XmlException: '', hexadecimal value 0x01, is an invalid character. Line 6, position 287.     at System.Xml.XmlTextReaderImpl.Throw(Exception e)     at System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Int32 pos, Char invChar)     at System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type, Int32& outStartPos, Int32& outEndPos)     at System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type)     at System.Xml.XmlTextReaderImpl.ParseElementContent()     at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)     at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)     at System.Xml.XmlDocument.Load(XmlReader reader)     at System.Xml.XmlDocument.LoadXml(String xml)     at umbraco.content.LoadContentFromDatabase()

    I believe this is a data problem. To test, I pointed my staging site at my live site's database, and it breaks. When I point it back to it's own database it works. So the database is the variable.

    Any ideas or ways I can troubleshoot what would cause this problem? My site is too big to recreate from scratch.

    Thanks!

  • Petr Snobelt 923 posts 1535 karma points
    Dec 08, 2010 @ 19:19
    Petr Snobelt
    0

    I have same problem, some time ago. And it is caused by invalid character inserted in content section. In my case, it was introduced when editor copy texts from word.

    Try look at last edited content for special characters in content.

  • Ryan 14 posts 35 karma points
    Dec 08, 2010 @ 19:22
    Ryan
    0

    Petr,

    I think I saw your forum post about it. I have no idea what the last edited content is because there are lots of people who edit content. Did you see a log entry or anything that gave a clue about what content was responsible? Thanks for the suggestion!

  • Petr Snobelt 923 posts 1535 karma points
    Dec 08, 2010 @ 19:33
    Petr Snobelt
    0

    Maybe you can try look into log for last published nodes, or you can try select from content table all content, which contains "hexadecimal value 0x01".

    And of course umbraco publish code should be updated using method from this article

    http://weblogs.asp.net/rajbk/archive/2009/10/04/xmlserializer-and-invalid-xml.aspx#comments

  • Ryan 14 posts 35 karma points
    Dec 08, 2010 @ 20:25
    Ryan
    0

    It does say that the offending data is on line 6, col 287 of the xml. Is there any way to just write the output of umbraco.content.LoadContentFromDatabase() to a file or view it somehow so that I can open it in my own xml editor and nail it down that way?

  • Petr Snobelt 923 posts 1535 karma points
    Dec 09, 2010 @ 18:19
    Petr Snobelt
    0

    You should corect data in content section or db, otherwise after node with broken data is published it broke your xml again.

  • Ryan 14 posts 35 karma points
    Dec 09, 2010 @ 21:08
    Ryan
    0

    Right, but if I can capture the text it's trying to put into the XmlDocument object then I will be able to see where the bad character is.

Please Sign in or register to post replies

Write your reply to:

Draft