@mattab opened this issue on August 19th 2015

2015/08/17 02:43:27 [error] 22351#0: *55895498 FastCGI sent in stderr: "PHP message: Error in Piwik (tracker): Error query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '271372268-0-154289670' for key 'PRIMARY' In query: INSERT INTO piwik_log_conversion_item (idaction_sku, idaction_name, idaction_category, idaction_category2, idaction_category3, idaction_category4, idaction_category5, price, quantity, deleted, idorder, idsite, idvisitor, server_time, idvisit) VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) , ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) , ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) , ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) , ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) Parameters: array ( 0 => 154289670, 1 => 154289672, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => '10', 8 => 1, 9 => 0, 10 => 0, 11 => 174, 12 => '±2|÷?^Oó*', 13 => '2015-08-17 07:43:23', 14 => '271372268', 15 => 154289670, 16 => 154289672, 17 => 0, 18 => 0, 19 => 0, 20 => 0, 21 => 0, 22 => '18.99', 23 =>" while reading response header from upstream,

@tsteur commented on August 19th 2015

How often does this error occur? Which Piwik version? Can you send the tracking request and steps that were used originally to reproduce it?

@tsteur commented on August 19th 2015

Maybe it's an implementation problem on client side as there is PRIMARY KEY (idvisit,idorder,idaction_sku). So maybe the idorder is not increased correctly?

@mattab commented on August 19th 2015

fyi: IIRC idorder = 0 is used for an "abandoned cart"

@tsteur commented on August 19th 2015

So in this case I'm not sure how to fix it. Isn't it kinda by design then? Maybe the exception is okay... we could specify a "on duplicate update" but that wouldn't change much apart from getting rid of the exception?

@mattab commented on August 19th 2015

in general, for "expected" use cases, we should avoid trigger an error in Tracking API, as such error are caught by error monitoring and can cause confusion to Piwik server administrators.

Did you manage to reproduce the exception, if yes, what are the steps? it could be possible in this case that catching exception (not trigger error) + logging a debug or warning statement, is the most correct solution?

@tsteur commented on August 19th 2015

I'm waiting for someone to send me steps to reproduce. But probably if someone sends abandoned cart twice then it will very likely throw this exception I reckon. Not sure what best solution is

@tsteur commented on August 19th 2015

Here would be a way to catch exception but not sure how useful all this is: https://github.com/piwik/piwik/compare/8597 also currently many items are created at once. Ideally we would create each item separately but this might slow down tracker

@mattab commented on August 19th 2015

@tsteur looks good to me :+1:

@tsteur commented on August 19th 2015

What do you think re executing the items one by one? If first one fails, all items will fail. On the other side if first item is idorder=0 probably all items will be idorder=0 and it is maybe not important to execute any of them

@mattab commented on August 20th 2015

What do you think re executing the items one by one?

Not sure, I reckon you fixed issue nicely in your PR #8599. please close the issue if you agree

This issue was closed on August 21st 2015
Powered by GitHub Issue Mirror