#25 SQL ERROR (receve: ContentDirectory:1#Search)

closed-fixed
None
5
2014-08-23
2009-12-17
inyai
No

When "ContentDirectory:1#Search" is received,
"Unsupported or invalid search criteria" is generated.

So, SQL ERROR is generated.

Receved XML:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:Search xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
<ContainerID>0</ContainerID>
<SearchCriteria>upnp:class derivedfrom &quot;object.item.imageItem&quot; and @refID exists false and res exists true</SearchCriteria>
<Filter>res,res@protocolInfo,res@resolution,res@size,dc:date,upnp:album,upnp:icon</Filter>
<StartingIndex>0</StartingIndex>
<RequestedCount>100</RequestedCount>
<SortCriteria></SortCriteria>
</u:Search>
</s:Body>
</s:Envelope>

Select SQL:
SELECT (select count(distinct DETAIL_ID) from OBJECTS o left join DETAILS d on (o.DETAIL_ID = d.ID) where (OBJECT_ID glob '*$*') and (o.CLASS like "item.videoItem*" and REF_ID is NULL and res is not NULL)) + (select count(*) from OBJECTS o left join DETAILS d on (o.DETAIL_ID = d.ID) where (OBJECT_ID = '*') and (o.CLASS like "item.videoItem*" and REF_ID is NULL and res is not NULL))

SQL Error:
SQL ERROR 1 [no such column: res]

# Then, sqlite3 of wild card will not be "*", and be "%"?

Discussion

  • Justin Maggard
    Justin Maggard
    2009-12-17

    That's not a bug in minidlna, that's a bug in the client. What client are you using? MiniDLNA never claims to support "res" in SearchCapabilities, but the client tries to search using "res exists true" anyway.

     
  • inyai
    inyai
    2009-12-18

     
    Attachments
  • inyai
    inyai
    2009-12-18

     
    Attachments
  • inyai
    inyai
    2009-12-18

    Thank you for the comment.
    I used "DiXiM Media Client Version 1.0.0".

    So, a normal response returns when DiXiM Server is used.
    (Look at "DiXiM_Client.xml" & "DiXiM_Server.xml".)

    But, I tried by using Buffalo LinkStation for Server.
    The same error code as MiniDLNA is transmitted to Client.
    May be, res exists true might be SearchCapabilities only for DiXiM.

    LinkStation Response:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <s:Body>
    <s:Fault>
    <faultcode>s:Client</faultcode>
    <faultstring>UPnPError</faultstring>
    <detail>
    <UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
    <errorCode>708</errorCode>
    <errorDescription>Invalid search criteria</errorDescription>
    </UPnPError>
    </detail>
    </s:Fault>
    </s:Body>
    </s:Envelope>

    Thanks.

     
  • Justin Maggard
    Justin Maggard
    2009-12-18

    • assigned_to: nobody --> jmaggard
    • status: open --> open-fixed
     
  • Justin Maggard
    Justin Maggard
    2009-12-18

    I've gone ahead and checked code into CVS to handle "res exists" search queries. So if you grab the latest code from CVS and rebuild MiniDLNA, your DiXiM client software should work now.

     
  • inyai
    inyai
    2009-12-18

    I confirmed operation with DiXiM Client.
    It was able to be confirmed not to become SQL error for "res exists true".
    But, it becomes SQL error in another search condition.(albumArtURI)

    It is recognized that I am a problem of DiXiM Client.
    If the column that doesn't exist in SQL Table is specified for a search condition if "SearchCriteria" changes by Client, you might return errCode 708.
    So, I think that I only have to check SQL sentence before executing SQL.

    [DiXiM Client Request]
    POST /ctl/ContentDir HTTP/1.1
    CONTENT-LENGTH: 932
    CONTENT-TYPE: text/xml; charset="utf-8"
    SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#Search"
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
    s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <s:Body>
    <u:Search xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
    <ContainerID>0</ContainerID>
    <SearchCriteria>(upnp:class derivedfrom &quot;object.item.audioItem&quot; and @refID exists false and res exists true) or (upnp:class derivedfrom &quot;object.container.album.musicAlbum&quot; and upnp:albumArtURI exists true) or upnp:class derivedfrom &quot;object.container.playlistContainer&quot;</SearchCriteria>
    <Filter>res,res@protocolInfo,res@size,res@duration,res@bitrate,res@sampleFrequency,res@bitsPerSample,res@nrAudioChannels,dc:date,dc:creator,upnp:artist,upnp:genre,upnp:album,upnp:originalTrackNumber,upnp:albumArtURI,upnp:icon</Filter>
    <StartingIndex>0</StartingIndex>
    <RequestedCount>100</RequestedCount>
    <SortCriteria></SortCriteria>
    </u:Search>
    </s:Body>
    </s:Envelope>

    [SQL SELECT]
    SELECT (select count(distinct DETAIL_ID) from OBJECTS o left join DETAILS d on (o.DETAIL_ID = d.ID) where (OBJECT_ID glob '*$*') and ((o.CLASS like "item.audioItem*" and REF_ID is NULL and MIME is not NULL) or (o.CLASS like "container.album.musicAlbum*" and d.ALBUMArtURI is not NULL) or o.CLASS like "container.playlistContainer*")) + (select count(*) from OBJECTS o left join DETAILS d on (o.DETAIL_ID = d.ID) where (OBJECT_ID = '*') and ((o.CLASS like "item.audioItem*" and REF_ID is NULL and MIME is not NULL) or (o.CLASS like "container.album.musicAlbum*" and d.ALBUMArtURI is not NULL) or o.CLASS like "container.playlistContainer*"))

    [SQL ERROR]
    SQL ERROR 1 [no such column: d.ALBUMArtURI]

    [MiniDLNA Response]
    HTTP/1.1 500 Internal Server Error
    Content-Type: text/xml; charset="utf-8"
    Connection: close
    Content-Length: 422
    Server: Linux/2.6.18.8 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.0
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>708</errorCode><errorDescription>Unsupported or invalid search criteria</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>

     
  • inyai
    inyai
    2009-12-25

    • status: open-fixed --> closed-fixed
     
  • inyai
    inyai
    2009-12-25

    Hi,

    Thank you for the comment.
    I understood there was a feature of Request and Response by Client each.

    Regards