Magento error: Mage registry key "controller" already exists - php

I have this site that runs Magento. The index.php file outputs a list of emails and encrypted stuff that seems to be a passwords.
I have marked out with red sensible information.
-All URLs give internal server error 500
-I have done the step by step verification recommended by a lot of sites, like this one:[https://techjam.gr/2012/magento/solve-magento-500-internal-server-errors/][2] but it has not solved the issue at all.
The error message I found at /var/report was the following: I cant really understand what it means.
a:5:{i:0;s:45:
"Mage registry key "controller" already exists"
;i:1;s:631:"
#0 /home/filomena/public_html/app/Mage.php(223): Mage::throwException('Mage registry k...')
#1 /home/filomena/public_html/app/code/core/Mage/Core/Model/App.php(747): Mage::register('controller', Object(Mage_Core_Controller_Varien_Front))
#2 /home/filomena/public_html/app/code/core/Mage/Core/Model/App.php(1094): Mage_Core_Model_App->_initFrontController()
#3 /home/filomena/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->getFrontController()
#4 /home/filomena/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#5 /home/filomena/public_html/index.php(87): Mage::run('', 'store')
#6 {main}"
;s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}
I cant open the admin panel ,also I get internal server error 500
I wonder if there is a guide to recover from this kind of issues.
Have I been hacked?

Try to flush whole Magento cache. If you use Redis, connect to server via SSH, then:
redis-cli
flushall
exit
If no, remove all files and directories from: magento_root_dir/var/cache

Related

having problems with Invision Community Board when posting/editing, getting a "EX0" error

first question i've asked on this site, here goes.
For those of you who would rather just see what we are working with here.
Host: hostinger.com
Php: 7.0.33
mySQL: 5.5.5-10.2.17-MariaDB
Forum version: Invision Community v4.3.6
So, I, manage a forums using invision community, I have extensively searched (being honest only really used google), but I have tried nonetheless.
Our host is hostinger (from what i’ve gathered through light research and my own experiences working with them on this site, they aren't exactly the best option but it's what we got)
we had recently done an update (from 4.2 to 4.3 i believe) but the error had started before we did an update.
the particular error i've received is a "EX0"
worst part about this error, is it "was" seemingly isolated to newer areas to the forums it is starting to affect all of them.
here are a few samples of errors i've had
https://pastebin.com/xkkLyUb5
InvalidArgumentException: (0)
#0 /home/xxxxxxxxxx/public_html/forums/system/Content/Search/Index.php(120): IPS\_Task::queue('core', 'IndexSingleItem', Array, 5, true)
#1 /home/xxxxxxxxxx/public_html/forums/system/Content/Item.php(2049): IPS\Content\Search\_Index->indexSingleItem(Object(IPS\forums\Topic))
#2 /home/xxxxxxxxxx/public_html/forums/applications/forums/sources/Topic/Topic.php(1091): IPS\Content\_Item->unhide(NULL)
#3 /home/xxxxxxxxxx/public_html/forums/applications/forums/sources/Topic/Topic.php(616): IPS\forums\_Topic->unhide(NULL)
#4 /home/xxxxxxxxxx/public_html/forums/applications/forums/sources/Topic/Topic.php(572): IPS\forums\_Topic->processAfterCreateOrEdit(Array)
#5 /home/xxxxxxxxxx/public_html/forums/applications/forums/modules/front/forums/topic.php(496): IPS\forums\_Topic->processAfterEdit(Array)
#6 /home/xxxxxxxxxx/public_html/forums/system/Dispatcher/Controller.php(85): IPS\forums\modules\front\forums\_topic->edit()
#7 /home/xxxxxxxxxx/public_html/forums/system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute()
#8 /home/xxxxxxxxxx/public_html/forums/applications/forums/modules/front/forums/topic.php(39): IPS\Content\_Controller->execute()
#9 /home/xxxxxxxxxx/public_html/forums/system/Dispatcher/Dispatcher.php(146): IPS\forums\modules\front\forums\_topic->execute()
#10 /home/xxxxxxxxxx/public_html/forums/index.php(13): IPS\_Dispatcher->run()
#11 {main}
Backtrace
#0 /home/xxxxxxxxxx/public_html/forums/init.php(537): IPS\_Log::log('InvalidArgument...', 'uncaught_except...')
#1 [internal function]: IPS\IPS::exceptionHandler(Object(InvalidArgumentException))
#2 {main}
some things i've tried (may or may not have thought it relevant, but nonetheless it didn't work)
Cleared my browser cookies (it happened idk if it was relevant)
Cleared my browser cache
Switching task method to Cron (surprisingly without breaking anything)
Disabled Enable Friendly URLs
Enabled Enable Friendly URLs
Tried Rewrite URLs
Cleared the server’s cached data (happened through the automated support tool)
I barely have any background in this stuff, but any additional information that's needed feel free to ask for.
This is most likely due to a corrupted extension in your core application.
if you look at the function queue in \IPS\Task (/system/Task/Task.php)
It has the following conditions that can throw an InvalidArgumentException:
try
{
$extensions = \IPS\Application::load( $app )->extensions( 'core', 'Queue', FALSE );
}
catch ( \OutOfRangeException $e )
{
throw new \InvalidArgumentException;
}
if ( !isset( $extensions[ $key ] ) )
{
throw new \InvalidArgumentException;
}
This will attempt to load each applications Queue extensions (stored in /applications/APP_NAME/extensions/core/Queue.
If for any reason it fails to load one of those, or the supplied extension does not exist for the specified application, it will throw this exception.
I would look at your /applications/core/extensions/core/Queue directory for any corrupted Queue Extensions, and possibly re-upload the entire directory in case some or all of them are missing.

XAMPP and Magento - Need to change ports?

Today I tried to access localhost/magento and the page would not load. Then, I just tried using localhost/phpmyadmin and the same thing. I read somewhere that the default port could be in use and cause this issue, so I changed the listener to 100 and localhost:100/phpmyadmin worked. Now, Magento gets an error every time I try to access it.
I've tried changing the web/unsecure/base_url and web/secure/base_url tables to http://localhost:100/magento/ and manually deleting my var/cache folder contents... still no luck.
Is there something I'm missing or an extra step I need to do with magento?
By the way I have it installed on XAMPP with windows 7 64-bit. Everything was working fine the day before.
edit: error codes
Module "Practice_OneStepCheckout" requires module "Mage_CatalogInventorty".
Trace:
#0 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Config.php(849): Mage::throwException('Module "Practic...')
#1 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Config.php(812): Mage_Core_Model_Config->_sortModuleDepends(Array)
#2 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Config.php(315): Mage_Core_Model_Config->_loadDeclaredModules()
#3 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(414): Mage_Core_Model_Config->loadModules()
#4 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(343): Mage_Core_Model_App->_initModules()
#5 C:\xampp\htdocs\magento\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#6 C:\xampp\htdocs\magento\index.php(87): Mage::run('', 'store')
#7 {main}
Thanks in advance for your help!
Is there something I'm missing or an extra step I need to do with magento?
Nope, it should work out of the box. What is the error you get?
I can recommend to use vhosts, that wil save you allot of time in the future: http://butlerccwebdev.net/support/testingserver/vhosts-setup-win.html
(Also, the most common port 80 issue under windows/xampp users is TeamViewer)

Error processing your request: SQLSTATE[42S01]: Base table or view already exists: in magento 1.9

I have installed magento 1.9 CE on my local server and it was working fine. Suddenly it stopped working and shows error like
There has been an Error processing your request.
When I check error report from report folder then I got logs like
a:5:{i:0;s:219:"Error in file: "C:\wamp\www\anzonline\app\code\core\Mage\XmlConnect\sql\xmlconnect_setup\upgrade-1.6.0.0-1.6.0.0.1.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'xmlconnect_images' already exists";i:1;s:950:"
#0 C:\wamp\www\anzonline\app\code\core\Mage\Core\Model\Resource\Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 C:\wamp\www\anzonline\app\code\core\Mage\Core\Model\Resource\Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '1.6.0.0', '1.6.0.0.1')
#2 C:\wamp\www\anzonline\app\code\core\Mage\Core\Model\Resource\Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.6.0.0', '1.6.0.0.1')
#3 C:\wamp\www\anzonline\app\code\core\Mage\Core\Model\Resource\Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 C:\wamp\www\anzonline\app\code\core\Mage\Core\Model\App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 C:\wamp\www\anzonline\app\code\core\Mage\Core\Model\App.php(343): Mage_Core_Model_App->_initModules()
#6 C:\wamp\www\anzonline\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#7 C:\wamp\www\anzonline\index.php(87): Mage::run('', 'store')
#8 {main}";s:3:"url";s:11:"/anzonline/";s:11:"script_name";s:20:"/anzonline/index.php";s:4:"skin";s:7:"default";}
I have found several solutions from Google but none of those worked out for me example.
The error message is telling you that Magento tries to create a table which already exists. This takes place in an upgrade script and was probably caused by an incomplete previous run of said upgrade script. Magento executes upgrade scripts, but only marks them done when they complete without error. Even an incompletely run script can have created tables, though, and next time Magento tries to run that update script the exstance of those tables cause a problem.
So you can either do some Database work and do some tweeking like removing the tables in question (with saving the data if needed), or you redo your Magento Installation.
This can also be caused by recently installed extensions, if so uninstalling them with the Connect Manager and reinstalling them might work.
Use
DROP TABLE IF EXISTS xmlconnect_images;
then, refresh your brownser. It works for me.
You can clear cache if you dont see any changes:
To clear the cache, simply delete everything from the /var/cache directory and then reload your website in your browser.
rm -rf magento/var/cache/*
To clear all sessions, you can also delete everything from the /var/session folder within your Magento installation directory.
rm -rf magento/var/session/*

Magento wants to reinstall after migration

In the last days I moved a Magento installation over a new staging server and a new production server. Everything went well on the production server, where the site is back againg, but I'm not able to make it work on the staging server... It keeps saying that the table "admin_assert" is already present (mysql error) and the error comes from the install script... but I don't want another install.
How's it possible that magento is trying to perform an installation over another preconfigured base?
I moved the whole base (source code), without performing a clean install, then I dumped the DB and changed the base urls.
Do you have any idea?
FYI this is the whole error log:
a:5:{i:0;s:193:"Error in file: "/home/lex/code/mycommerce/app/code/core/Mage/Admin/sql/admin_setup/install-1.6.0.0.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'admin_assert' already exists";i:1;s:920:"#0 /home/lex/code/mycommerce/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/lex/code/mycommerce/app/code/core/Mage/Core/Model/Resource/Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.6.1.0')
#2 /home/lex/code/mycommerce/app/code/core/Mage/Core/Model/Resource/Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.6.1.0')
#3 /home/lex/code/mycommerce/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /home/lex/code/mycommerce/app/code/core/Mage/Core/Model/App.php(412): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /home/lex/code/mycommerce/app/code/core/Mage/Core/Model/App.php(338): Mage_Core_Model_App->_initModules()
#6 /home/lex/code/mycommerce/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#7 /home/lex/code/mycommerce/index.php(90): Mage::run('', 'store')
#8 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}
Not a big deal. You will find many more errors like this.
The error simple says your DB already has table name admin_assert.
You can ignore this by opening the install script and comment out the code which tries to re-create the table, and refresh the magento again.
Once everything is set up properly, don't forget to uncomment the commented create table script.
I ran into this issue as well with a rather large database and it turned out that PHPMyAdmin was unable to export the entire thing at the same time, so my data was incomplete. The solution in my case was to export tables in batches instead of all at once, and then import them in the same way.
tl;dr
Make sure that your databases match

Move Magento Installation to new server

I've been trying now for a few hours to move our Magento installation from dev to live. I found multiple links on the web saying that to move a Magento Installation you need to edit /app/etc/local.xml and update it with the new MySQL credentials and then delete the contents of /var/cache/ (a few even suggested deleting the whole /var folder. I also deleted the contents of /var/session/. Our server is NOT cached (no memcached, varnish, etc). I even restarted apache to see if I could flush any cache that might be running.
So the problem is our Magento installation is still attempting to connect to the old database somehow. We are given this error:
SQLSTATE[28000] [1045] Access denied for user 'oldDBUsername'#'localhost' (using password: YES)
If anyone has any ideas on how to fix this that I haven't already mentioned it would be greatly appreciated.
EDIT:
Here is the stack trace that Magento also reports:
Trace:
#0 fileroot/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 fileroot/lib/Varien/Db/Adapter/Pdo/Mysql.php(300): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 fileroot/lib/Zend/Db/Adapter/Abstract.php(459): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 fileroot/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 fileroot/lib/Varien/Db/Adapter/Pdo/Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 fileroot/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 fileroot/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 fileroot/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_read')
#8 fileroot/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getConnection('read')
#9 fileroot/app/code/core/Mage/Core/Model/Resource/Cache.php(53): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#10 fileroot/app/code/core/Mage/Core/Model/Cache.php(449): Mage_Core_Model_Resource_Cache->getAllOptions()
#11 fileroot/app/code/core/Mage/Core/Model/Cache.php(491): Mage_Core_Model_Cache->_initOptions()
#12 fileroot/app/code/core/Mage/Core/Model/App.php(1175): Mage_Core_Model_Cache->canUse('config')
#13 fileroot/app/code/core/Mage/Core/Model/Config.php(414): Mage_Core_Model_App->useCache('config')
#14 fileroot/app/code/core/Mage/Core/Model/Config.php(294): Mage_Core_Model_Config->_canUseCacheForInit()
#15 fileroot/app/code/core/Mage/Core/Model/App.php(408): Mage_Core_Model_Config->loadModulesCache()
#16 fileroot/app/code/core/Mage/Core/Model/App.php(338): Mage_Core_Model_App->_initModules()
#17 fileroot/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#18 fileroot/index.php(80): Mage::run('', 'store')
#19 {main}
I figured it out.
When I brought over the dev installation to live I had copied local.xml to local_bk.xml I discovered that Magento will attempt to autoload ALL xml files in the /app/etc/ folder so it was trying to load my backed up file, soon as I renamed my backup to something that didn't end in .xml it worked.
When you install magento you have to select whether cache and session data is stored on the file system or db.
It may be the following line in local.xml, cant quite remember right now.
<session_save><![CDATA[files]]></session_save>
if you are using the db then it stores data in the core_cache table maybe in the database.
See if your db cache tables are empty if they are not truncate them.
You will also need to update your base url both secure and unsecure in core_config_data
see the following for SQL to do the update
http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/update_site_url_in_core_config_data
The correct path is
app/etc/local.xml
instead of:
etc/app/local.xml
Does this solve your issue?
For others having this issue in the future here is some documentation on Magento's wiki. http://www.magentocommerce.com/wiki/groups/227/moving_magento_to_another_server
Your answer saved me! I spent a lot of time on this issue and only stumbled on this answer. I usually copy and paste to search for the error, so I wanted to give more of the actual error so that others could benefit.
I named my local.xml file to local.bak and that's where my mistake was. Comparison against all files of a working Magento instance yielded only the extra file.
The error led me to believe that maybe mySQL was the issue but it had nothing to do with it. Perhaps someone might be able to post a log or method that shows what file is actually being used. I didn't see any notice written to any log.
Here is more of the error, excluding anything site specific:
"SQLSTATE[HY000] [1045] Access denied for user '*myuser*'#'localhost' (using password: YES) /lib/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
Also changing my file names in app/etc/ removing the .xml in the middle worked for me:
local.xml.template to local.template and local.xml.additional
to local.additional
Thanks #Peter.
Within your magento folder you need to edit app/etc/local.xml as Gershon mentioned.
You will also as root or sudo need to remove all files and directories in your magento folder's var/cache that magento creates.

Categories