Where is var/lock in Magento 1.9?

by richard   Last Updated January 13, 2018 10:09 AM

I get the error "Stock Status Index process is working now. Please try run this process later." when trying to reindex. Other answers say to clear var/lock/.

where is var/lock in 1.9?

Answers 4

The var/locks/ (note the "s") directory is created whenever you start an indexing process. Magento writes out a lock file to this directory. Removing the lock files may resolve issues with reindexing.

Like in previous Magento versions, in Magento 1.9 you can find this directory here:

[your Magento install dir]/var/

If the directory isn't there, Magento hasn't created it. If this is the case, then you should look for other solutions for fixing the reindexing issue.

Maybe your var directory doesn't have the right permissions. Magento needs sufficient permissions to be able to create the var/locks directory and write out the lock files. Try setting permissions for var to (at least) 755.

If this doesn't help, maybe you can reindex via SSH or try restarting your webserver.

December 08, 2014 18:47 PM

It was quite difficult to find out where is these locks are saving.

By default Magento saving the locks in the database, in these case you may not find any /var/locks folder in your server.

Debugging further I reached in the file app\code\core\Mage\Index\Model\Resource\Helper\Mysql4.php

Run these queries in your mysql console

 SELECT IS_USED_LOCK('dev_toystore_magento.index_process_3') //this is for catalog url rewrite

The same way you can release, lock from here.

Find a impressive blog out there



Rinto George
Rinto George
March 27, 2016 07:42 AM

in magento 1.9 the index lock in database is

select IS_USED_LOCK('database.index_process_7');

to release a lock

SELECT RELEASE_LOCK('database.index_process_7');

there are different number index_process_number for different index process. the process id number can be found from admin area.

May 16, 2016 07:04 AM

Direct access in DB is the "index_process" table. I had to delete one that was still running from a removed plug-in

DANG designs Inc
DANG designs Inc
February 16, 2017 15:21 PM

Related Questions

Magento 1 Product out of stock

Updated May 16, 2017 08:09 AM


Updated June 05, 2017 18:09 PM

Product stock status reset to 0 after reindex

Updated September 05, 2017 15:09 PM