'.', hexadecimal value 0x00, is an invalid character. Line 1

hi, i got the following error . i don’t know how to fix it.
i found older articel about this issue. but nothing helps.

’ve suddenly started getting this error out of the blue.
Everything was working fine on Tuesday, but since yesterday, I’ve been receiving this error. I’ve already excluded the last two articles from the CMS and added a new one.
I’ve checked the applications and tree configuration.
However, I still can’t figure out where the error is coming from.
I also can’t make heads or tails of the error message—specifically “Line 1, position 508596”—to pinpoint exactly where the issue is located.

Server Error in ‘/’ Application.


‘.’, hexadecimal value 0x00, is an invalid character. Line 1, position 508596.

**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.Xml.XmlException: ‘.’, hexadecimal value 0x00, is an invalid character. Line 1, position 508596.

XmlException: ‘.’, hexadecimal value 0x00, is an invalid character. Line 1, position 508596.]
System.Xml.XmlTextReaderImpl.Throw(Exception e) +89
System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Char[] data, Int32 length, Int32 invCharPos) +55
System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type, Int32& outStartPos, Int32& outEndPos) +1103
System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type) +100
System.Xml.XmlTextReaderImpl.ParseElementContent() +318
System.Xml.XPath.XPathDocument.LoadFromReader(XmlReader reader, XmlSpace space) +1259
System.Xml.Xsl.Runtime.XmlQueryContext.ConstructDocument(Object dataSource, String uriRelative, Uri uriResolved) +305
System.Xml.Xsl.Runtime.XmlQueryContext..ctor(XmlQueryRuntime runtime, Object defaultDataSource, XmlResolver dataSources, XsltArgumentList argList, WhitespaceRuleLookup wsRules) +407
System.Xml.Xsl.Runtime.XmlQueryRuntime..ctor(XmlQueryStaticData data, Object defaultDataSource, XmlResolver dataSources, XsltArgumentList argList, XmlSequenceWriter seqWrt) +170
System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) +113
System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer) +227
System.Xml.Xsl.XslCompiledTransform.Transform(XmlReader input, XmlWriter results) +85
Infragistics.Web.UI.GridControls.GridRenderer.RenderContents(HtmlTextWriter writer) +1334
Infragistics.Web.UI.Framework.RunBot.HandleRenderContents(HtmlTextWriter writer, RendererBase renderer) +226
Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.Render(HtmlTextWriter writer) +24
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80

Hi @martinx

Welcome to the forum!

That 0x00 error means a NUL character has been written into an XML file - it’s illegal in XML, so the parser throws an exception the moment it hits position 508596. From the call stack, I assume your site is running Umbraco 7?

One thing though - your stack trace doesn’t point at Umbraco’s own rendering. It’s Infragistics.Web.UI.GridControls.GridRenderer running an XSLT transform, so the corrupt XML looks like it’s the data source for an Infragistics grid rather than umbraco.config. Is this on the public site or a custom backoffice page?

Quickest way to confirm is to open the suspect XML in Notepad++ (with the Hex-Editor plugin) or VS Code and search for a null byte. That tells you exactly which file is bad. You may be able to look at file modified times to see if anything correlates with the issue starting yesterday.

I hope that helps.

Justin

1 Like

Hi Justin, thanks—I was able to resolve the problem.
It really did turn out to be data records coming from a database and being displayed in the Infragistics grid.
I had been looking for the error in the CMS and in the specific article content.
However, the issue lay with corrupted data records. The error occurred at position 508,596.
That wasn’t particularly helpful, of course. Furthermore, I couldn’t inspect any XML, since the data records were bound directly to the grid.
Thanks a lot for helping me think through the possibilities!


1 Like

Hi @martinx

Glad you got to the bottom of it and my reply helped!

Justin