API2 getasset mssql returns error

Setup: Razuna 1.7, Windows Server 2012, Separate MSSQL Server 2012, AWS Storage

For a potential integration piece, we are trying to return specific renditions of videos, audio, etc. Since we do not have the ability to return renditions within the searchassets api call, we would have to return search results, then upon selection of a result, use an api call to get the renditions and find the “web friendly” version or a specific type of rendition.

When trying this specific call (getrenditions) or even trying to use the getasset call, we are getting a generic sql error:

{“message”:“General SQL Error”,“errorcode”:“errorCode.sqlError”,“detail”:“Database reported: Conversion failed when converting the varchar value ‘http://mydomain.com//razuna/assets/’ to data type int.”}

Here is the call:

From what I could find, there are not associated integers with the assetid, just the guid style varchar string. I could not find anything in the bluedragon error logs or Razuna admin logs that show anything specific regarding this issue.

Any help that you can provide would be greatly appreciated, thank you.


I have been doing some testing and it appears that there are some casting issues with the host id when the mssql condition is detected. Example, when switching something like:

<cfelseif application.razuna.api.thedatabase EQ "mssql">
     '#application.razuna.api.thehttp##cgi.HTTP_HOST#/#application.razuna.api.dynpath#/assets/' + cast(v.host_id as varchar) + '/'+ v.path_to_asset + '/' + v.vid_name_org AS local_url_org,
     '#application.razuna.api.thehttp##cgi.HTTP_HOST#/#application.razuna.api.dynpath#/assets/' + cast(v.host_id as varchar) + '/'+ v.path_to_asset + '/' + v.vid_name_image AS local_url_thumb,

In the asset.cfc, if I change lines 164 & 165 of v1.7 release to have the cast(v.host_id as varchar), the getasset api method executes fine. I did the same for the getrenditions method throughout the code (block lines 701-959) and it also returns data.

Does this seem like an accurate fix?