Ask Your Question

No longer getting new image data

asked 2015-06-26 17:26:31 -0600

updated 2015-10-30 15:22:06 -0600

Hello. We were getting image data up until recently using the code below. As of Wednesday June 24, 6:00am, our import started failing. We are getting other listing data but have been unable to retrieve image data since Wednesday. We have our script email us when it fails. Whatever error is taking place doesn't generate a failure state.

The code we're using is below. I'd appreciate any thoughts or leads on things we should check.

Thank you, David

if (count($mls_ids) > 0) {
    $today = date('Y-m-d H:i:s', time());
    foreach ($mls_ids as $mls) {
        //get photos
        $photos_array = array();
        $photos_array = $rets->GetObject("Property", "Photo", $mls, "*", 1);
        if (count($photos_array) > 0) {
            $count = 1;
            //delete current images
            $temp_record_delete_sql = "DELETE FROM `imgsDocs` WHERE `L_ListingID` = ".$mls." AND `type` = 'image'";
            if($connection->query($temp_record_delete_sql) === false) {
                echo 'Error on line 531';
                sendErrorEmail($connection->error, E_USER_ERROR, $temp_record_delete_sql);
                trigger_error('Wrong SQL: ' . $temp_record_delete_sql . ' Error: ' . $connection->error, E_USER_ERROR);
            //insert photo information into table
            foreach ($photos_array as $photo) {
                if ($photo['Location'] != '') {
                    $photos_insert_sql = "INSERT INTO `imgsDocs` (`L_ListingID`,`resource`,`type`,`url`,`order`,`import_date`) VALUES (".$mls.",'Property','image','".$photo['Location']."',".$count.",'".$today."')";
                    if($connection->query($photos_insert_sql) === false) {
                        echo 'Error on line 540';
                        sendErrorEmail($connection->error, E_USER_ERROR, $photos_insert_sql);
                        trigger_error('Wrong SQL: ' . $photos_insert_sql . ' Error: ' . $connection->error, E_USER_ERROR);
edit retag flag offensive close merge delete


David, based on our off-line conversations, I believe this issue has been resolved. If that is the case, can you provide some technical details of how you solved it, if it was code based?

vendorsupport gravatar imagevendorsupport ( 2015-07-01 15:23:30 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-07-07 10:29:01 -0600

We tracked the problem back to a log file which was being added to during import for debugging. The log file became very large and was slowing down the import process, to the point that it apparently stalled out. Prior to the error, we noticed that the import was taking longer than expected, but we saw no errors being triggered. We turned off the logging and had immediate success.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-06-26 17:26:31 -0600

Seen: 455 times

Last updated: Jul 07 '15