17

I have a problem with index management inside my Magento 1.6.2.0 store. Basically I can't get them to update. The status says Processing but it says like that for over a 3 weeks now.

And when I try to reindex I am getting this message Stock Status Index process is working now. Please try run this process later but later is 3 weeks now? So it looks like the process is frozen but I don't know how to restart.

Any ideas?

cheers

Marcin
  • 5,469
  • 15
  • 55
  • 69
  • have you seen this? http://stackoverflow.com/questions/5315684/magento-catalog-url-rewrites-stuck-on-processing – pzirkind Jan 02 '13 at 19:19
  • Possible duplicate of [How to debug Lock wait timeout exceeded on MySQL?](http://stackoverflow.com/questions/6000336/how-to-debug-lock-wait-timeout-exceeded-on-mysql) – Max Alexander Hanna Mar 02 '17 at 16:48

5 Answers5

31

Whenever you start an indexing process, Magento writes out a lock file to the var/locks folder.

$ cd /path/to/magento
$ ls var/locks
index_process_1.lock    index_process_4.lock    index_process_7.lock
index_process_2.lock    index_process_5.lock    index_process_8.lock
index_process_3.lock    index_process_6.lock    index_process_9.lock

The lock file prevents another user from starting an indexing process. However, if the indexing request times out or fails before it can complete, the lock file will be left in a lock state. That's probably what happened to you. I'd recommend you check the last modified dates on the lock files to make sure someone else isn't running the re-indexer right now, and then remove the lock files. This will clear up your

Stock Status Index process is working now. Please try run this process later

error. After that, run the indexers one at a time to make sure each one completes.

Alana Storm
  • 164,128
  • 91
  • 395
  • 599
3

Hello Did you call script manually if not then create one file in your root folder and write this code in it

require_once 'app/Mage.php';
umask( 0 );
Mage :: app( "default" );
$process = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_flat');
$process->reindexAll();

this code do indexing of your magento manually some times it's happen that if your magento store contain large number of products then it will required lot's of time to reindexing of products so when you can go to your index management from admin it will show some indexing in processing stage so may be this code will help you to remove processing stage to ready stage of your indexes.

or you can also do indexing with SSH if you have rights of it. it's faster too for indexing

drsndodiya
  • 1,685
  • 1
  • 17
  • 36
2

For newer versions of magento , ie 2.1.3 I had to use this solution: http://www.elevateweb.co.uk/magento-ecommerce/magento-error-sqlstatehy000-general-error-1205-lock-wait-timeout-exceeded

This might happen if you are running a lot of custom scripts and killing the scripts before the database connection gets chance to close

If you login to MySQL from CLI and run the command

SHOW PROCESSLIST;

you will get the following output

+———+—————–+——————-+—————–+———+——+——-+——————+———–+—————+———–+

| Id | User | Host | db | Command | Time | State | Info | Rows_sent | Rows_examined | Rows_read |

+———+—————–+——————-+—————–+———+——+——-+——————+———–+—————+———–+

| | 6794372 | db_user| 111.11.0.65:21532 | db_name| Sleep | 3800 | | NULL | 0 | 0 | 0
| | 6794475 | db_user| 111.11.0.65:27488 | db_name| Sleep | 3757 | | NULL | 0 | 0 | 0
| | 6794550 | db_user| 111.11.0.65:32670 | db_name| Sleep | 3731 | | NULL | 0 | 0 | 0
| | 6794797 | db_user| 111.11.0.65:47424 | db_name | Sleep | 3639 | | NULL | 0 | 0 | 0
| | 6794909 | db_user| 111.11.0.65:56029 | db_name| Sleep | 3591 | | NULL | 0 | 0 | 0
| | 6794981 | db_user| 111.11.0.65:59201 | db_name| Sleep | 3567 | | NULL | 0 | 0 | 0
| | 6795096 | db_user| 111.11.0.65:2390 | db_name| Sleep | 3529 | | NULL | 0 | 0 | 0
| | 6795270 | db_user| 111.11.0.65:10125 | db_name | Sleep | 3473 | | NULL | 0 | 0 | 0
| | 6795402 | db_user| 111.11.0.65:18407 | db_name| Sleep | 3424 | | NULL | 0 | 0 | 0
| | 6795701 | db_user| 111.11.0.65:35679 | db_name| Sleep | 3330 | | NULL | 0 | 0 | 0
| | 6800436 | db_user| 111.11.0.65:57815 | db_name| Sleep | 1860 | | NULL | 0 | 0 | 0
| | 6806227 | db_user| 111.11.0.67:20650 | db_name| Sleep | 188 | | NULL | 1 | 0 | 0
+———+—————–+——————-+—————–+———+——+——-+——————+———–+—————+———–+

15 rows in set (0.00 sec)

You can see as an example 6794372 the command is sleep and time is 3800. This is preventing other operations These processes should be killed 1 by 1 using the command.

KILL 6794372; Once you have killed all the sleeping connections, things should start working as normal again

Max Alexander Hanna
  • 3,388
  • 1
  • 25
  • 35
1

You need to do two steps:

  1. give 777 permition to var/locks folders
  2. delete all file of var/locks folder
Andrea
  • 11,801
  • 17
  • 65
  • 72
Ashwani Panwar
  • 3,819
  • 3
  • 46
  • 66
0

Whenever you start an indexing process, Magento writes out a lock file to the var/locks folder. So uou need to do two steps:

  1. Give 777 permission to var/locks folders
  2. Delete all file of var/locks folder.

Now refresh the index management page in admin panel. Enjoy!!