You are here:  » Import stops after 239 rows . . .

Support Forum



Import stops after 239 rows . . .

Submitted by Pidea on Tue, 2011-08-02 08:40 in

David, I've got a wierd problem with an XML import . .

I'm importing an XML file from TradeDoubler which contains 2746 items. However, when I import it just 239 items are imported with no error messages shown if I enable the debug variable.

Looking in the products table I can see that it's importing the products in sequence until it gets to the 240th one but then it stops. The thing is that the 240th item is nothing special . . . I'm not getting any error.log files generated either so it's a bit of a mystery . . .

Any ideas what might be causing this ? Is there a way to dump out to a log file what's going on during the import process ?

Phil

Submitted by support on Tue, 2011-08-02 15:47

Hi Phil,

When you run the import process for that feed from the /admin/ home page, does the page automatically refresh back to the /admin/ home page?

If so, that would indicate that the import process did complete successfully rather than aborting; which would imply that the number of products imported being less than expected is down to either;

a) Missing or invalid Product Name, Buy URL or Price fields (unlikely)

or

b) Duplicate prevention. The merchant+product name combination for every product must be unique. This scenario is most common with, for example, clothing feeds - where you might have a product name "Jumper", but another field in the feed, e.g. "COLOUR" provides further resolution. In this example, the Text After / Text Before filters can be used with placeholders to combine other fields from the feed with the product name to create more unique values. So you could combine the field "COLOUR" with the Product Name field by adding a new "Text After" filter and then in the text box on the configuration page, enter:

" %COLOUR%"

(without the quotes - but note the SPACE at the start - that is important otherwise you would end up with product names like JumperRed!)

If you're still not sure, please if you could email me a link to your installation, any password required for /admin/ and the filename of the feed that is not importing fully I'll take a further look for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by Pidea on Tue, 2011-08-02 16:21

Thanks for the reply David. The import process does redirect back as if it's completed successfully but it's not duplicate prevention nor is it down to errors in the feed (that I can see at least).

I'll email the info that you need shortly.

Thanks

Phil

Submitted by Pidea on Wed, 2011-08-03 19:46

Big thanks to David for finding the solution and helping me to fix it.

The problem was due to Tradedoublers iso encoded feeds causing a problem with the version of PHP that's installed on my server. It's a problem which affects certain PHP versions/configurations only so if anyone suffers the same problem, try changing the feed encoding to utf-8, downloading it again and then re-importing.

It worked for me !

Submitted by karolisgo on Thu, 2011-08-11 19:41

Hi David,

I have a feed with more then 23k products. I get duplicated hash error and feed import fails.
I have no unique field to add after/before the product name, because I see that xml has 1:1 duplicated products there with duplicated all fields.

Do you have an idea how to handle this? I prefer skipping duplicated names and that's all. Why import fails on errors and I have zero products imported from this feed?

Thanks for advice,
Karolis

Submitted by karolisgo on Thu, 2011-08-11 20:00

I forget to mention the error message I am getting.

At first I see tons of duplicated hash errors:

.... [Duplicate entry '111e65c02b73135141403bcccd8c34fb2' for key 'dupe_filter'] ...

and at the end I see php error:

Warning: Cannot modify header information - headers already sent by (output started at /home/myusername/public_html/mydomain.com/includes/database.php:55) in /home/myusername/public_html/mydomain.com/admin/feeds_import.php on line 31

Submitted by support on Fri, 2011-08-12 08:15

Hi Karolis,

In reverse order, the "Cannot modify..." error is simply because debug output was generated by the import (as you have database debug mode enabled) and the mechanism by which the import script returns to the admin home page using a PHP header only works if no output has been generated. Everything would have worked otherwise.

Regarding every product resulting in a duplicate; the most likely reason would be that the wrong field has been accidentally registered as the Product Name (for example Merchant Name if that is in the feed). One pointer towards this would be if the dupe_hash value is identical in each message so the first thing I would do is to re-register and double check all field mappings.

Another scenario that can occur is when using a mixture of merchant and category feeds from an affiliate network; and all of a merchant's products for which you are importing a new feed contains products that have all already been imported from a category feed that just happens to contain all their products...

Cheers,
David.
--
PriceTapestry.com