New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ecommerce Tracker may fail with "Integrity constraint violation: 1062 Duplicate entry" #8597
Comments
How often does this error occur? Which Piwik version? Can you send the tracking request and steps that were used originally to reproduce it? |
Maybe it's an implementation problem on client side as there is |
fyi: IIRC |
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? |
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? |
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 |
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 |
@tsteur looks good to me 👍 |
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 |
Not sure, I reckon you fixed issue nicely in your PR #8599. please close the issue if you agree |
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,
The text was updated successfully, but these errors were encountered: