Getting Object Unavailable when pulling images
Using Librets
"https://rets-paragon.sandicor.com/rets/fnisrets.aspx/sandicor/login?rets-version=RETS/1.7.2"
"http://neren.rets.paragonrels.com/rets/fnisrets.aspx/NEREN/login?rets-version=rets/1.7.2"
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]." >="" <="" 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
Comments
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.