First time here? Check out the FAQ!

Getting Object Unavailable when pulling images

Using Librets



On both Sandicor and Neren we are getting the following error when pulling some photos: Here is the code that is executed, using LibRETS and PHP. We use the AddAllObjects method to the GetObjectRequest to query RETS for a list of all possible objects of the type defined, then iterate over them.

$object_descriptor->GetDataAsString() is returning the error code below, rather than the actual binary data of the photo.

$request = new GetObjectRequest($resourceid, $myconf->Config->PhotoType); $photosListingID = $propArr['ListingId']; if (!empty($propArr['FeedKey'])) { $photosListingID = $propArr['FeedKey']; } $request->AddAllObjects($photosListingID); $results = $rets->GetObject($request); $photoObj = $photoObjTemplate; while ($object_descriptor = $results->NextObject()) { // ObjectKey is usually the ListingID, and ObjectId is the order of the photos $photoObj['Order'] = $object_descriptor->GetObjectId(); $photoObj['Descr'] = $object_descriptor->GetDescription();

$file_name = sprintf('%s/%s-%s.jpg', $saveLocation, $propArr['ListingId'], $photoObj['Order']);

if ($live) { $file = fopen ($file_name, "wb") or die ("Unable to create file " . $file_name); fwrite ($file, $object_descriptor->GetDataAsString()); fclose ($file); } $photoObj['URL'] = 'file://' . $file_name; $photoObj['FetchTimestamp'] = new MongoDB\BSON\UTCDateTime(floor(microtime(true) * 1000));

$bulk->insert( $photoObj ); $photoCountRets++; $count['loop']['photo']++; } unset($request, $results, $object_descriptor);

Pretty consistently we are seeing our first call to GetOjbect return this response:

<rets replycode="20409" replytext="Object Unavailable [170050779:1]." &gt;="" <="" rets="">

In one case, 170050957, we got that same failure response for the first three photos. We requested those photos from Sandicor at 2017-09-30T19:41:41.185Z UTC -- feel free to check your logs. Use the PhotosFetchTimestamp below for each of the 4 properties to check your logs for why we might have gotten the above "Object Unavailable" message rather than the binary data itself.

170050779 RETS FetchTimestamp UpdatedTimestamp 2017-09-28T21:52:27.405Z LastPhotoDate 2017-09-28T21:42:00Z PhotosFetchTimestamp 2017-09-28T21:59:50.105Z Default was another failed attempt when calling rets for the first photo. 170051089 RETS FetchTimestamp UpdatedTimestamp 2017-10-03T02:57:17.105Z LastPhotoDate 2017-09-30T01:25:00Z PhotosFetchTimestamp 2017-09-30T01:35:18.428Z Default was another failed attempt when calling rets for the first photo. 170050957 RETS FetchTimestamp UpdatedTimestamp 2017-09-30T19:32:09.661Z LastPhotoDate 2017-09-29T18:15:00Z PhotosFetchTimestamp 2017-09-30T19:41:41.185Z Default was another failed attempt when calling rets for the FIRST THREE photos. 170051174 RETS FetchTimestamp UpdatedTimestamp 2017-10-03T02:57:17.254Z LastPhotoDate 2017-09-30T23:31:00Z PhotosFetchTimestamp 2017-09-30T23:39:49.748Z Default was another failed attempt when calling rets for the first photo.

We also received the following errors from NEREN.

10-04-2017 12:25:04.50716|1ac49|sr/local/app/api/bin/util/photos-fetch:|474 |info|neren3::RE_1::4661754 Photo Order:4 Bytes:80 File:/usr/local/tmp/neren3/RE_1/4661754-4.jpg 10-04-2017 12:25:04.51820|1ac49|sr/local/app/api/bin/util/photos-fetch:|474 |info|neren3::RE_1::4661754 Photo Order:29 Bytes:81 File:/usr/local/tmp/neren3/RE_1/4661754-29.jpg

RETSMAN's avatar
asked 2017-10-04 16:12:24 -0500
edit flag offensive 0 remove flag close merge delete


I'm also having the same problem. For most of the images, I get this error:

<rets replycode="20409" replytext="Object Unavailable [52175096:90]."> </rets>

Hope this gets resolved.

libragopi's avatar libragopi (2018-11-29 06:40:40 -0500) edit
add a comment see more comments

1 Answer


Are you pulling the actual image binary or by URL with Location=1?
If we don't host the image in Paragon, we only store the URL.
The image binary is unavailable in this case.
If you pull images with Location=1, you can use the URL to download the image binary.
Then it should work no matter whether Paragon hosts the image or not.

You can also run into issues where a user is updating images at the time of the pull which can also cause this to happen.

bwolven's avatar
answered 2018-11-29 08:27:56 -0500, updated 2018-11-29 08:32:02 -0500
edit flag offensive 0 remove flag delete link


add a comment see more comments

Your Answer

Login/Signup to Answer