jellyfin / jellyfin-plugin-dlna

GNU General Public License v3.0
15 stars 12 forks source link

DLNA empty on iOS with VLC - Object reference not set to an instance of an object. #56

Open voltagex opened 3 months ago

voltagex commented 3 months ago

Docker container, host network, v1.0.9.3

POST /dlna/bc2a2f22-4ced-4393-9c6e-32404f5bf0dd/contentdirectory/control HTTP/1.1
HOST: 
CONTENT-LENGTH: 471
Accept-Ranges: bytes
CONTENT-TYPE: text/xml; charset="utf-8"
SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
USER-AGENT: Darwin/23.4.0, UPnP/1.0, Portable SDK for UPnP devices/1.14.13

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body><u:Browse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
<ObjectID>2b2bca16aacc8a14d53a11bb829eafa5</ObjectID>
<BrowseFlag>BrowseDirectChildren</BrowseFlag>
<Filter>*</Filter>
<StartingIndex>0</StartingIndex>
<RequestedCount>5000</RequestedCount>
<SortCriteria></SortCriteria>
</u:Browse>
</s:Body>
</s:Envelope>

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Date: Sat, 01 Jun 2024 05:07:17 GMT
Server: Kestrel
Transfer-Encoding: chunked
X-Response-Time-ms: 25.6628

<?xml version="1.0" encoding="utf-8" standalone="yes"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>500</faultcode><faultstring>Object reference not set to an instance of an object.</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>401</errorCode><errorDescription>Invalid Action</errorDescription></UPnPError></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

A matching log entry is:

System.NullReferenceException: Object reference not set to an instance of an object.
   at MediaBrowser.Model.Dlna.StreamBuilder.BuildVideoItem(MediaSourceInfo item, MediaOptions options)
   at MediaBrowser.Model.Dlna.StreamBuilder.GetOptimalVideoStream(MediaOptions options)
   at Jellyfin.Plugin.Dlna.Didl.DidlBuilder.AddVideoResource(XmlWriter writer, BaseItem video, String deviceId, Filter filter, StreamInfo streamInfo)
   at Jellyfin.Plugin.Dlna.Didl.DidlBuilder.WriteItemElement(XmlWriter writer, BaseItem item, User user, BaseItem context, Nullable`1 contextStubType, String deviceId, Filter filter, StreamInfo streamInfo)
   at Jellyfin.Plugin.Dlna.ContentDirectory.ControlHandler.HandleBrowse(XmlWriter xmlWriter, IReadOnlyDictionary`2 sparams, String deviceId)
   at Jellyfin.Plugin.Dlna.Service.BaseControlHandler.CreateControlResponse(ControlRequestInfo requestInfo)
   at Jellyfin.Plugin.Dlna.Service.BaseControlHandler.ProcessControlRequestInternalAsync(ControlRequest request)
   at Jellyfin.Plugin.Dlna.Service.BaseControlHandler.ProcessControlRequestAsync(ControlRequest request)

IMO you should log the request and response when this fails.

Happy to help debug, probably not via this Docker container though. It's on an Asustor NAS and updating to the latest version is a real pain.

ignisf commented 4 weeks ago

Seems to be happening whenever all metadata sources are disabled for a given library.