1

Since a couple of days while accessing both the admin interface or the frontend I'm randomly redirected to /index.php/install/ url that asks me to install a new instance of magento.

This is very annoying and also a security risk, since everybody could overwrite my install.

Any idea on how I can fix it?

The store is working fine and there are no other suspect signs.

TopperH
  • 209
  • 1
  • 2
  • 8

2 Answers2

2

To debug this you must first understand the flow when this issue occurs.

If you look at app/Mage.php run() method, you will see that magento will redirect you to the install if an exception is thrown in that method.

try {
                self::dispatchEvent('mage_run_exception', array('exception' => $e));
                if (!headers_sent()) {
                    header('Location:' . self::getUrl('install'));
                } else {
                    self::printException($e);
                }
            } catch (Exception $ne) {
                self::printException($ne, $e->getMessage());
            }

Leading up to that, a check in the method isInstalled will just print out an exception, if the application returns as installed.

if (self::isInstalled() || self::$_isDownloader) {
                self::printException($e);
                exit();
}

If you look at the method isInstalled(), you can see that magento will set the flag _isInstalled to false, if the local.xml config file in /app/etc/ does not exist, or if it does exists, and the date in the <install> section is not set, it will also result in false.

You should be able to solve the issue/find the reason, if you find what exception is thrown to cause the redirect to install.

The most likely issue (as mentioned in another answer) is file permissions. Another likely issue is that your are using shared / mapped filesystem resources, and the config.xml file is temporarily unavailable.

Since redirecting to the installer is a more serious issue, than printing out an exception message, I would temporarily adjust the redirect to simply output the exception.

ProxiBlue
  • 9,926
  • 3
  • 34
  • 60
  • @TopperH - Thanks for accepting the answer. It would be nice to know what the issue was - your reason may be helpful to another with the same issue. – ProxiBlue Dec 11 '13 at 02:48
  • I marked it as solved because it pointed me in the right direction, but since it happens very randomly I haven't yet been able to discover what caused the issue. local.xml exists and seems available, so I need further investigating – TopperH Dec 11 '13 at 10:06
1

Could be an issue with file permissions. Here's the latest guide on setting permissions: http://www.magentocommerce.com/knowledge-base/entry/install-privs-after

kiatng
  • 694
  • 3
  • 16