Uncaught XML parsing error #372

Closed
opened 2026-02-06 19:37:49 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @LeoVerto on GitHub (Feb 2, 2019).

My Sony Blu-Ray player seems to send some invalid XML as part of DLNA communications, causing this parsing error to clutter my logs.

Ideally this should be caught and a sensible error message displayed instead.

Logs

[20:21:33] [ERR] Unable to parse xml <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/"
                                                xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"
                                                xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"
                                                xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/"
                                                xmlns:arib="urn:schemas-arib-or-jp:elements-1-0/"
                                                xmlns:av="urn:schemas-sony-com:av">
  <item id="-1" parentID="-1" restricted="1"><dc:title>02 - The Big Empty</dc:title><upnp:class>object.item.audioItem</upnp:class><res  duration="00:43:05.5680512" nrAudioChannels="2" resolution="1920x1080" sampleFrequency="48000" bitrate="10528987" protocolInfo="http-get:*:video/x-matroska:DLNA.ORG_PN=MATROSKA;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01D00000000000000000000000000000">http://SERVER_IP:9003/videos/2672125e-b60b-039d-cd42-cfd2597a3811/stream.mkv?DeviceProfileId=4d609bcad22a8fba6946b24e31d9c8fe&DeviceId=test&MediaSourceId=2672125eb60b039dcd42cfd2597a3811&Static=true&AudioStreamIndex=1&Tag=ea5b108738444dc80fed3a4bc000165a&dlnaheaders=true</res></item></DIDL-Lite>

System.Xml.XmlException: '=' is an unexpected token. The expected token is ';'. Line 7, position 524.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1, String expectedToken2)
at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos)
at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
at System.Xml.XmlTextReaderImpl.FinishPartialValue()
at System.Xml.XmlTextReaderImpl.get_Value()
at System.Xml.Linq.XContainer.ContentReader.ReadContentFrom(XContainer rootContainer, XmlReader r)
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
at System.Xml.Linq.XElement.ReadElementFrom(XmlReader r, LoadOptions o)
at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XElement.Parse(String text, LoadOptions options)
at System.Xml.Linq.XElement.Parse(String text)
at Emby.Dlna.PlayTo.Device.GetPositionInfo(TransportCommands avCommands, CancellationToken cancellationToken) in /repo/Emby.Dlna/PlayTo/Device.cs:line 732

Cleaned up XML

<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns:arib="urn:schemas-arib-or-jp:elements-1-0/" xmlns:av="urn:schemas-sony-com:av">
  <item id="-1" parentID="-1" restricted="1">
    <dc:title>02 - The Big Empty</dc:title><upnp:class>object.item.audioItem</upnp:class>
    <res  duration="00:43:05.5680512" nrAudioChannels="2" resolution="1920x1080" sampleFrequency="48000" bitrate="10528987" protocolInfo="http-get:*:video/x-matroska:DLNA.ORG_PN=MATROSKA;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01D00000000000000000000000000000">http://SERVER_IP:9003/videos/2672125e-b60b-039d-cd42-cfd2597a3811/stream.mkv?DeviceProfileId=4d609bcad22a8fba6946b24e31d9c8fe&DeviceId=test&MediaSourceId=2672125eb60b039dcd42cfd2597a3811&Static=true&AudioStreamIndex=1&Tag=ea5b108738444dc80fed3a4bc000165a&dlnaheaders=true
    </res>
  </item>
</DIDL-Lite>

System (please complete the following information):

  • OS: Docker on Debian 9
  • Jellyfin Version: 10.1.0
Originally created by @LeoVerto on GitHub (Feb 2, 2019). My Sony Blu-Ray player seems to send some invalid XML as part of DLNA communications, causing this parsing error to clutter my logs. Ideally this should be caught and a sensible error message displayed instead. **Logs** ``` [20:21:33] [ERR] Unable to parse xml <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns:arib="urn:schemas-arib-or-jp:elements-1-0/" xmlns:av="urn:schemas-sony-com:av"> <item id="-1" parentID="-1" restricted="1"><dc:title>02 - The Big Empty</dc:title><upnp:class>object.item.audioItem</upnp:class><res duration="00:43:05.5680512" nrAudioChannels="2" resolution="1920x1080" sampleFrequency="48000" bitrate="10528987" protocolInfo="http-get:*:video/x-matroska:DLNA.ORG_PN=MATROSKA;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01D00000000000000000000000000000">http://SERVER_IP:9003/videos/2672125e-b60b-039d-cd42-cfd2597a3811/stream.mkv?DeviceProfileId=4d609bcad22a8fba6946b24e31d9c8fe&DeviceId=test&MediaSourceId=2672125eb60b039dcd42cfd2597a3811&Static=true&AudioStreamIndex=1&Tag=ea5b108738444dc80fed3a4bc000165a&dlnaheaders=true</res></item></DIDL-Lite> System.Xml.XmlException: '=' is an unexpected token. The expected token is ';'. Line 7, position 524. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1, String expectedToken2) at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos) at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars) at System.Xml.XmlTextReaderImpl.FinishPartialValue() at System.Xml.XmlTextReaderImpl.get_Value() at System.Xml.Linq.XContainer.ContentReader.ReadContentFrom(XContainer rootContainer, XmlReader r) at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r) at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o) at System.Xml.Linq.XElement.ReadElementFrom(XmlReader r, LoadOptions o) at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options) at System.Xml.Linq.XElement.Parse(String text, LoadOptions options) at System.Xml.Linq.XElement.Parse(String text) at Emby.Dlna.PlayTo.Device.GetPositionInfo(TransportCommands avCommands, CancellationToken cancellationToken) in /repo/Emby.Dlna/PlayTo/Device.cs:line 732 ``` Cleaned up XML ```xml <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" xmlns:arib="urn:schemas-arib-or-jp:elements-1-0/" xmlns:av="urn:schemas-sony-com:av"> <item id="-1" parentID="-1" restricted="1"> <dc:title>02 - The Big Empty</dc:title><upnp:class>object.item.audioItem</upnp:class> <res duration="00:43:05.5680512" nrAudioChannels="2" resolution="1920x1080" sampleFrequency="48000" bitrate="10528987" protocolInfo="http-get:*:video/x-matroska:DLNA.ORG_PN=MATROSKA;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01D00000000000000000000000000000">http://SERVER_IP:9003/videos/2672125e-b60b-039d-cd42-cfd2597a3811/stream.mkv?DeviceProfileId=4d609bcad22a8fba6946b24e31d9c8fe&DeviceId=test&MediaSourceId=2672125eb60b039dcd42cfd2597a3811&Static=true&AudioStreamIndex=1&Tag=ea5b108738444dc80fed3a4bc000165a&dlnaheaders=true </res> </item> </DIDL-Lite> ``` **System (please complete the following information):** - OS: Docker on Debian 9 - Jellyfin Version: 10.1.0
OVERLORD added the bug label 2026-02-06 19:37:49 +03:00
Author
Owner

@LeoVerto commented on GitHub (Feb 21, 2019):

I can confirm that this has been fixed by #889.

@LeoVerto commented on GitHub (Feb 21, 2019): I can confirm that this has been fixed by #889.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#372