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:
iduserIdNodeIdDatestamplogHeaderlogComment
2078590-12010-12-08 10:50:54.710ErrorXml 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)
2078560-12010-12-08 10:50:54.697ErrorError 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.
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.
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!
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
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?
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!
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.
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!
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
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?
You should corect data in content section or db, otherwise after node with broken data is published it broke your xml again.
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.
is working on a reply...