Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction
 
zep007
Sr. Member
 
Avatar
Total Posts:  131
Joined:  2008-05-15
Connecticut
 

I get the error :

SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

occasionally in the backend when I duplicate products or go to the manage products screen.

Any Idea what this may be?

I think it may have to do with duplicating a product, and not resaving it with a unique SKU, I noticed 2 in the Database without SKUs ( could have been partially loaded product page after duplicating )

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiaraweb
Guru
 
Avatar
Total Posts:  721
Joined:  2008-03-21
Aviano ~ Italy
 

Also me, when I update the inventory or change anything in the item description

 
Magento Community Magento Community
Magento Community
Magento Community
 
rvelton
Sr. Member
 
Total Posts:  82
Joined:  2007-09-07
 

Was there any update/fix with this issue? It is still happening with 1.1.8

Any information would be appreciated.

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
neuro
Sr. Member
 
Avatar
Total Posts:  104
Joined:  2008-09-29
France
 

We have this error approx. 1 time on 10 when save edited products :/ with 1.1.8 last Mysql & last apache on ubuntu server.

 
Magento Community Magento Community
Magento Community
Magento Community
 
emislive
Jr. Member
 
Total Posts:  3
Joined:  2009-04-03
 

Also seeing this error with CatalogSearch in 1.3.1. This is intermittent, but appears to be related to changing products, whether updating attributes, stock information or deleting products.

Digging into things a bit more, the error is arises from the search handling. Running

SHOW INNODB STATUS

from mysql gives you a bunch of info, including information on the last deadlock detected. The output is baroque, but the query that is causing the problems is this:

UPDATE `catalogsearch_query` SET `is_processed` = ‘0’

On our site this query had been running for 51 seconds before the deadlock was detected. Marking every query as not processed seems extreme. The other query involved in the deadlock doesn’t seem too much more intelligent:

REPLACE INTO `catalogsearch_result` (SELECT ‘107854’, `product_id`, MATCH (`data_index`) AGAINST (’tnpa 3758’ IN BOOLEAN MODE) FROM `catalogsearch_fulltext` WHERE ((`data_index` LIKE ‘&#xtn;pa%’ AND `data_index` LIKE ‘758%’)) AND `store_id`=’1’)

More debugging to do but I suspect changing even one product causes all search queries to be invalidated. Adding products individually doesn’t seem to pose a problem, but imports are horrible: the catalop_product_import_after event observers completely rebuild every catalog index for every product, not just those touched during the import. Bad, Magento, bad!

More debugging ahead…

 
Magento Community Magento Community
Magento Community
Magento Community
 
aaronce
Member
 
Avatar
Total Posts:  32
Joined:  2008-08-07
Brisbane
 

@emislive did you find the problem?

we are receiving the same problem, throws no exceptions in the logs. but can confirm that it breaks the search while updating, and gives an error “SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction” on the import screen.

seems to me that ‘catalogsearch_fulltext’ table is the problem perhaps..

 
Magento Community Magento Community
Magento Community
Magento Community
 
PunkLogic
Jr. Member
 
Total Posts:  23
Joined:  2009-03-24
 

Same issue here. Can anyone shed any light on this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jun266
Sr. Member
 
Total Posts:  104
Joined:  2008-07-16
 

same to me here, any body know how to fix??
1.4.0.1 ver

 
Magento Community Magento Community
Magento Community
Magento Community
 
Pro Digital
Sr. Member
 
Avatar
Total Posts:  110
Joined:  2007-12-05
Hungary
 

Try:

Truncate all tables begin with ‘log’

It solved for me.

TRUNCATE `log_customer`;
TRUNCATE `log_quote`;
TRUNCATE `log_summary`;
TRUNCATE `log_summary_type`;
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
TRUNCATE `log_visitor`;
TRUNCATE `log_visitor_info`;
 
Magento Community Magento Community
Magento Community
Magento Community
 
Paulus
Guru
 
Total Posts:  335
Joined:  2008-07-21
 
Pro Digital - 12 April 2010 03:21 AM

Try:

Truncate all tables begin with ‘log’

It solved for me.

TRUNCATE `log_customer`;
TRUNCATE `log_quote`;
TRUNCATE `log_summary`;
TRUNCATE `log_summary_type`;
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
TRUNCATE `log_visitor`;
TRUNCATE `log_visitor_info`;

This did not solve it for us. We get the error when relating products (cross/upsell/relate)

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dannyz1984
Sr. Member
 
Avatar
Total Posts:  153
Joined:  2009-04-12
 
Pro Digital - 12 April 2010 03:21 AM

Try:

Truncate all tables begin with ‘log’

It solved for me.

TRUNCATE `log_customer`;
TRUNCATE `log_quote`;
TRUNCATE `log_summary`;
TRUNCATE `log_summary_type`;
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
TRUNCATE `log_visitor`;
TRUNCATE `log_visitor_info`;

this fixed my problem.

thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lijith
Jr. Member
 
Total Posts:  7
Joined:  2009-06-28
Kochi
 

Check this thread.

http://www.magentocommerce.com/boards/viewthread/31666/

 
Magento Community Magento Community
Magento Community
Magento Community
 
hidonet
Member
 
Avatar
Total Posts:  52
Joined:  2008-03-25
Istanbul
 
Pro Digital - 12 April 2010 03:21 AM

Try:

Truncate all tables begin with ‘log’

It solved for me.

TRUNCATE `log_customer`;
TRUNCATE `log_quote`;
TRUNCATE `log_summary`;
TRUNCATE `log_summary_type`;
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
TRUNCATE `log_visitor`;
TRUNCATE `log_visitor_info`;

Worked for me too.

 
Magento Community Magento Community
Magento Community
Magento Community
 
samir_araujo
Jr. Member
 
Avatar
Total Posts:  1
Joined:  2012-06-22
 

Worked like a charm, thanks @Pro Digital

 
Magento Community Magento Community
Magento Community
Magento Community
 
davew123
Jr. Member
 
Total Posts:  10
Joined:  2010-09-03
 

We’ve been seeing errors backing up Magento System. Stops during the process and not able to backup site.

Used the SQL commands described:

TRUNCATE `log_customer`;
TRUNCATE `log_quote`;
TRUNCATE `log_summary`;
TRUNCATE `log_summary_type`;
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
TRUNCATE `log_visitor`;
TRUNCATE `log_visitor_info`;

Success backing up System.

Thanks for your info.

---------Update------------

Seems this wasn’t the issue after all.
I had moved the website to a test location. Different domain. Mistakenly thought the above fix was the solution.
At this new domain, username and group ownership were different and all consistent.

Issue: Permissions - Two folders were a “root” username and group. These wouldn’t allow the System backup to take place.

Once found, the folders and all file were reset using ssh commands.
Anything in the current folder will be reset using:

chown -R username *
chgrp -R group *

 
Magento Community Magento Community
Magento Community
Magento Community
 
dutchdeveloper
Jr. Member
 
Total Posts:  1
Joined:  2009-07-13
 

I had the same error when doing a lenghty operation on the database, renaming a bunch of categories to be exact. For me the solution was to temporarily disable the cronjob by commenting it out.

$~ crontab -e
Put a # sign in front of the ‘php magentodir/cron.php’ cronjob, then save and exit.

I assume reindexing by the cronjob put a deadlock which ended script execution. Hope this helps someone out = )

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top