You are here:  » Cron not Properly Importing - Products 0


Cron not Properly Importing - Products 0

Submitted by mattwalker on Fri, 2013-10-04 12:56 in

Hi David

I've recently installed the latest version of Price Tapestry but I'm having problems getting CRON to work.

After running cron, I get no products showing in admin (Imported date updated, products 0). I've tried both cron options in Support Info, but neither seem to work. I've carried out a debug on cron.php and this is the result I'm getting (last few lines of the report):

`name`='NiQuitin Minis 1.5mg Orange - 60 pack',`description`='',`image_url`='',`buy_url`='http://www.awin1.com/pclick.php?p=3047788919&a=77425&m=2453',`price`='8.33',`postage`='2.95',`category`='',`brand`='',`original_name`='NiQuitin Minis 1.5mg Orange - 60 pack',`merchant`='Lloydspharmacy',

search_name='NiQuitinMinis15mgOrange60pack',
normalised_name='NiQuitin Minis 15mg Orange 60 pack',

dupe_hash='53dda61128f0c561092fcb3592f2f408'
][Table 'youcompa_pt005.pt_products_import' doesn't exist][SELECT COUNT(*) AS productCount FROM `pt_products_import` WHERE filename='lloydspharmacy.xml'][Table 'youcompa_pt005.pt_products_import' doesn't exist]
importing lloydspharmacy.xml...[done]
[ALTER TABLE `pt_products_import` ENABLE KEYS][Table 'youcompa_pt005.pt_products_import' doesn't exist][DROP TABLE `pt_products`][Unknown table 'pt_products'][RENAME TABLE `pt_products_import` TO `pt_products`][Can't find file: './youcompa_pt005/pt_products_import.frm' (errno: 2)]
backfilling reviews... [UPDATE `pt_products` SET rating='0',reviews='0'][Table 'youcompa_pt005.pt_products' doesn't exist]
backfilling reviews...[done]

Also, products would import fine manually before I set the cron job and let it run - though I now find they no longer import properly even through manual operation (again, date updated products 0). The database looks fine, though pt_product is empty.

Thanks in advance for your help,

Matt

Submitted by support on Fri, 2013-10-04 13:14

Hello Matt,

That implies that the database user may not have CREATE TABLE privileges, however if that was the case then it shouldn't have been possible to have run setup, but the error message indicate the the temporary import table `products_import` doesn't exist.

This is the "zero down time" feature, whereby thousands of products can be imported without the site being offline at all. To do this, when cron.php runs a temporary table `products_import` is created. The import takes place into this table, and once complete the original `products` table is dropped, and `products_import` renamed to `products`.

Do you have phpMyAdmin available, and would be able to check the database privileges of the username configured in $config_databaseUsername and ensure that CREATE TABLE is set? If that all looks in place, let me know and I'll help you investigate further...

Cheers,
David.
--
PriceTapestry.com

Submitted by mattwalker on Fri, 2013-10-04 14:07

Hello David,

Yes, I have phpMyAdmin available and all privileges are checked in database including CREATE and CREATE TEMPORARY TABLES. I have another PT installation (12/10B) operating with the same database username/password and it works fine.

Cheers,
Matt

Submitted by support on Fri, 2013-10-04 14:18

Thanks Matt,

I see you're able to capture the output of CRON with database debug mode on - could you perhaps see if you can capture the first few lines of the output as this would indicate if any error occurs in the DROP TABLE / CREATE TABLE LIKE process.... or if it's easier - just the following test script, run from the /scripts/ folder:

<?php
  
require("../includes/common.php");
  
$config_databaseDebugMode TRUE;
  
$sql "DROP TABLE IF EXISTS `".$config_databaseTablePrefix."products_import`";
  
database_queryModify($sql,$result);
  
$sql "CREATE TABLE `".$config_databaseTablePrefix."products_import` LIKE `".$config_databaseTablePrefix."products`";
  
database_queryModify($sql,$result);
  
$sql "ALTER TABLE `".$config_databaseTablePrefix."products_import` DISABLE KEYS";
  
database_queryModify($sql,$result);
  
$sql "ALTER TABLE `".$config_databaseTablePrefix."products_import` ENABLE KEYS";
  
database_queryModify($sql,$result);
  
$sql "DROP TABLE `".$config_databaseTablePrefix."products_import`";
  
database_queryModify($sql,$result);
?>

If you could let me know the debug output of either that should point towards the problem...

Thanks,
David.
--
PriceTapestry.com

Submitted by mattwalker on Fri, 2013-10-04 14:31

Hi David,

Here's the first few lines of the cron debug:

fetching boots.xml
fetching boots.xml...[OK]
fetching chemistdirect.xml
fetching chemistdirect.xml...[OK]
fetching gjwtitmuss.xml
fetching gjwtitmuss.xml...[OK]
fetching lloydspharmacy.xml
fetching lloydspharmacy.xml...[OK]
fetching petmeds.xml
fetching petmeds.xml...[OK]
fetching petplanet.xml
fetching petplanet.xml...[OK]
fetching petsupermarket.xml
fetching petsupermarket.xml...[OK]
[CREATE TABLE `pt_products_import` LIKE `pt_products`][Table 'youcompa_pt005.pt_products' doesn't exist][ALTER TABLE `pt_products_import` DISABLE KEYS][Table 'youcompa_pt005.pt_products_import' doesn't exist]

Thanks for your help,

Matt

Submitted by support on Fri, 2013-10-04 14:36

Thanks Matt,

I'd like to follow up by email - I know you've been a user for several years so in case the email address in your forum account is out of date please could you email me a note with the URL to the installation (no problem if it's not online) and I'll follow up to that for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by mattwalker on Fri, 2013-10-04 14:42

Yep email is still the same. I'll send the installation URL.

Cheers,Matt