cancel
Showing results for 
Search instead for 
Did you mean: 

Lock wait timeout exceeded; try restarting transaction

Lock wait timeout exceeded; try restarting transaction

Team,

 

 

We are using magento 1.7 and when we are adding any classess then we are getting this error.

 

Gernal 1205 :- Lock wait timeout exceeded; try restarting transaction

 

Please help

 

Thanks

Ashok

4 REPLIES 4

Re: Lock wait timeout exceeded; try restarting transaction

What did you do to resolve this issue? I am unable to log in when i go to Magento  Connect. 

Re: Lock wait timeout exceeded; try restarting transaction

Hi THERE,

I'm a brand new magento developper ( since 1 month / 10 years php )


I did implement Aoe_dbretry, which solved most of these errors,

then even sleeping for n seconds, retrying 10 times the request, it won't really help into successfully sastisfing some requests ..

I just wanna identify which mysql request / process, file && original line from backtrace causes this lock, and if it's safe to kill it .. probably not ..

I think that's probably caused the re-indexing cron, in case I surely won't kill this process is there any way of bypassing those locks errors or somehow inject some previous sql which won't lock those tables ??

So, basically .. shall I lower or raise mysql's lock wait timeout ??

If I raise it, more request might be fulfilled expecting some long time ..

Would it also use more and more connexions to mysql as soon as pages/ requests might take as much time as this value ?

 

Thanks for any clue, note, comments, idea, enlightment Smiley Wink

Re: Lock wait timeout exceeded; try restarting transaction

I don't think there's clear culprit. People are discussing the matter here and even though it's not Magento specific, it gives pretty good idea what do do about it and what causes it.

 

http://stackoverflow.com/questions/6000336/how-to-debug-lock-wait-timeout-exceeded

Tanel Raja

Re: Lock wait timeout exceeded; try restarting transaction

I have face the same issue. the following solution worked for me.

 

The reason behind this issue is if you are running a lot of custom scripts and killing the scripts before the database connection gets chance to close.

Something is blocking the execution of the query. Most likely another query updating, inserting or deleting from one of the tables in your query. You have to find out what that is:

If you can login to MySQL from CLI and run the following command

SHOW PROCESSLIST;

Once you locate the blocking/sleep process, find it's id and run :

KILL {id};

Re-run your initial query.

For more details you can check this : SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction Magento