0

Any idea why my reindex page and magento connect page in admin is displaying a 404 message? I have changed permissions on both downloader and shell folders and all files to 755. Changed ownership back to server. Does not recognize command when reindexing via ssh.

2
  • Which 404 page are you seeing? Magento has many (or is the your web server's 404 page), and each is triggered for a different reason. alanstorm.com/magentos_many_404_pages Commented Jul 29, 2013 at 20:48
  • I think it was an admin module that I built... but then I accidentally changed permissions on the entire server and we have to fix that... so... my answer for reference to follow. It shows the admin toolbar but has the 404 message in the body. Commented Jul 29, 2013 at 20:55

2 Answers 2

2

There's too many possibilities for a simple answer here, but here's the two lines of debugging I'd take (apologies in advance for the complexity here, but I don't know of a simpler way to debug this)

  1. You have a module that's attempting to rewrite an admin URL, and it has accidentally swallowed the URLs for the downloader and the index page

  2. Something about your permissions and/or server setup prevents the router from validating your controller file

Regarding number two, try adding some temporary debugging code to the following method

#File: app/code/core/Mage/Core/Controller/Varien/Router/Standard.php    
protected function _validateControllerClassName($realModule, $controller)
{
    $controllerFileName = $this->getControllerFileName($realModule, $controller);

    if (!$this->validateControllerFileName($controllerFileName)) {  
        return false;
    }

    $controllerClassName = $this->getControllerClassName($realModule, $controller);
    if (!$controllerClassName) {
        return false;
    }

    // include controller file if needed
    if (!$this->_includeControllerClass($controllerFileName, $controllerClassName)) {
        return false;
    }

    return $controllerClassName;
}

Specifically, add some var_dumps above each return false

if (!$controllerClassName) {
    var_dump($controllerClassName);
    return false;
}

// include controller file if needed
if (!$this->_includeControllerClass($controllerFileName, $controllerClassName)) {
    var_dump($controllerFileName);
    return false;
}

This will let you know the specific controller names and files the Magento admin can't find, which may shed some light on the problem.

For the case of number one, I'd also add some debugging in the match method, right here

#File: app/code/core/Mage/Core/Controller/Varien/Router/Standard.php    
$controllerInstance = Mage::getControllerInstance($controllerClassName, $request, $front->getResponse());                

if (!$controllerInstance->hasAction($action)) {
    continue;
}

Specifically, above the continue

if (!$controllerInstance->hasAction($action)) {
    var_dump(get_class($controllerInstance));
    continue;
}

This will let you know if a module has incorrectly "claimed" your index processing page and downloader page.

4
  • I've edited the code in that core file, reindexed, and cleared cache... not seeing any var dump anywhere. Commented Jul 30, 2013 at 16:44
  • @CaitlinHavener That seems — unlikely. Maybe you have compilation on so it's using the file in src/? Commented Jul 30, 2013 at 17:08
  • It's not on. Tried it on our live and staging versions as well. I know its the module becuase I don't have issues when I remove it. Perhaps you can look at my code? :) magento.stackexchange.com/questions/6235/… Commented Jul 30, 2013 at 20:59
  • @CaitlinHavener Try dropping a var_dump(get_included_files()) at the end of your index.php file to see where Magento's loading Standard.php from. Magento can't dispatch without calling those methods. Commented Jul 30, 2013 at 21:16
0

Disable local and community modules to determine stock magento is functioning properly via the pages returning a 404. It should help determine if a 3rd party or local module is overriding the controller for these pages to function properly, as Alan has detailed.

You can disable the local code pool easily and quickly via app/etc/local.xml with:

<disable_local_modules>true</disable_local_modules>

community modules can be disabled via /etc/modules/*.xml

I would also double check that your ACL permissions are set to "All" on the admin account you're using, if it is in fact not a file/folder permission issue but related to a local/community module. Also logging out and logging back in to the admin can apply any new ACL permissions required of a module.

I've found the resetting permissions Wiki helpful if it is a permissions issue:

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.