Got error 28 from storage engine – Mysql Database

Friday, 19. July 2013

I came to a surprising problem this morning with one of our client’s site where all of a sudden Magento was throwing error Got error 28 from storage engine on error logs

Had no clue what that means really so looking around the server ended up noting the server is actually run out of space!

Shame, but that happened to be the reason behind this problem and things went back to normal after fixing the space issue.

Oh, well, shift happen! :)

Magento 404 Error CMS Page Not Found In Admin Panel

Thursday, 1. November 2012

If you have been getting a 404 error when trying to access CMS pages in magento admin, possibly after an upgrade, chances are you have store IDs mixed up!

Run this script in phpmyadmin against the site database and hopefully it will bring smile to your face!

DELETE FROM cms_page_store WHERE store_id NOT IN (SELECT store_id FROM core_store);

Only variables should be passed by reference in lib_Zend_Db_Select line 246

Wednesday, 13. June 2012

Had this strange error today while doing a database backup via Magento admin

Strict Notice: Only variables should be passed by reference  in ../lib/Zend/Db/Select.php on line 246
#0 ../lib/Zend/Db/Select.php(246): mageCoreErrorHandler(2048, 'Only variables ...', '/var/www/client...', 246, Array)

After a bit of digging around, the issue was simply solved by doing the following:

– Navigate to: /lib/Zend/Db/Select.php and go to live 246


$correlationName = current(array_keys($this->_parts[self::FROM]));

– Replace that with

$correlationName = array_keys($this->_parts[self::FROM]);
$correlationName = $correlationName[0];

Please NOTE:
You have just edited the core file there. I will recommend you take a note of this for future reference.

Invalid model for shipping method: msmultiflat – Magento

Tuesday, 28. February 2012

Came across this error while upgrading Magento Invalid model for shipping method: msmultiflat – and here is a solution on how to solve it.

In this case, the shipping module in question was no longer needed, so the solution was to delete it from the system.

Open your phpmyadmin OR similar DB IDE of your choice and run the following script

DELETE FROM core_config_data WHERE path LIKE '%carriers/msmultiflat%'

*** CLEAR YOUR MAGENTO CACHE after running your script ***

Similar script can be used to delete any other missing model for that matter.. just replace msmultiflat with the missing model!

SQLSTATE[HY000]: General error: 1030 Got error 28 from storage engine Magento

Friday, 27. January 2012

Came across this issue recently on one my client’s site and here was the solution:

Increase the disk space on the server!

Basically this issue (error 28) is usually because the your hard disk has run out of space and MySQL is failing to perform its operations due to limited resources.

So check hard drive space, you overall shared hosting/space and probably MySQL misconfiguration. Chances are however, if the site has been working OK and all of a sudden you get this issue, disk drive will most likely be the verdict!

Let us know if this helped you and/or if you have a better solution/source for this problem

How to enable Template path hints for Magento admin pages

Wednesday, 30. November 2011

One of them nice little handy tools for backend developers!

INSERT INTO core_config_data (scope, scope_id, path, VALUE)
VALUES ('default', 0, 'dev/debug/template_hints_blocks', 1),
('default', 0, 'dev/debug/template_hints', 1);

Column not found: 1054 Unknown column main_table.include_in_menu in where clause

Tuesday, 29. November 2011

Had this issue today upgrading Magento from to :

Column not found: 1054 Unknown column ‘main_table.include_in_menu’ in ‘where clause’

After a bit of looking around with no luck, resorted back to running a complete Index Management which solved the issue for us.

Let us know if you have any interesting observations yourself!

Run Raw SQL statement with Magento Core resource

Monday, 24. October 2011

There are times when you just want to run a simple SQL statement to quickly test things up on Magento without having to load up the entire collection.

On servers with limited resources this can be handy. Also, for someone like me sometimes I find life much easier working directly on the database (as LONG as you KNOW what you are doing! This approach in Magento can easily be your own UNDOING!)

Get the core resource

$_resource = Mage::getSingleton('core/resource');

Get the correct Database name

Because some installations may have table prefixes, this is the best way to make sure you get the correct table name with prefix (if one exists)

$_tableName = $_resource->getTableName('catalogsearch_query');

Start Magento Database Connection

Once everything is in place and you are ready to go, here is how you obtain DB connection

$_conn = $_resource->getConnection('core_write'); #you can also use 'core_read' for just reading data
# example
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');

Read Data From Magento Database

$sql = "SELECT * FROM directory_country_region WHERE country_id='UK'";
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
foreach ($connection->fetchAll($sql) as $arr_row) {
	print $arr_row['default_name'];

Insert Data Into Magento Database Directly

// insert a new US State into the region table
$sql = "INSERT INTO `directory_country_region` (`region_id`,`country_id`,`code`,`default_name`) VALUES (NULL,'US','XX','New US State')";
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');


Exclude Tables With Mysqldump – Reduce the Size of Magento database backup

Wednesday, 12. October 2011

If you have ever wondered or be in need of excluding certain tables from your Mysqldump, here is snippet for you!

Basically you only have to specify the –ignore-table flag with your Mysqldump command. In order to exclude as multiple tables you will need to repeat the command as many times as the tables you want to exclude.

One important thing to remember, the –ignore-table flag expects you to specify the full table path i.e include the database name such as dbname.tablename.

Example: How to exclude Magento log table from mysqldump

mysqldump -uUSERNAME -pPASSWORD  --ignore-table=<DBASE_NAME>.log_url --ignore-table=<DBASE_NAME>.log_url_info  --ignore-table=<DBASE_NAME>.log_visitor --ignore-table=<DBASE_NAME>.log_visitor_info  --ignore-table=<DBASE_NAME>.log_customer --ignore-table=<DBASE_NAME>.log_quote --ignore-table=<DBASE_NAME>.report_event  --ignore-table=<DBASE_NAME>.index_event --ignore-table=<DBASE_NAME>.index_process_event  --ignore-table=<DBASE_NAME>.report_viewed_product_index --ignore-table=<DBASE_NAME>.dataflow_batch_export  --ignore-table=<DBASE_NAME>.dataflow_batch_import <DBASE_NAME> | gzip > <DBASE_NAME>_dump.sql.gz

Disable Foreign Key Checks AND Ignore inserts

mysqldump -uUSERNAME -pPASSWORD  --ignore-table=<DBASE_NAME>.log_url --ignore-table=<DBASE_NAME>.log_url_info  --ignore-table=<DBASE_NAME>.log_visitor --ignore-table=<DBASE_NAME>.log_visitor_info  --ignore-table=<DBASE_NAME>.log_customer --ignore-table=<DBASE_NAME>.log_quote --ignore-table=<DBASE_NAME>.report_event  --ignore-table=<DBASE_NAME>.index_event --ignore-table=<DBASE_NAME>.index_process_event  --ignore-table=<DBASE_NAME>.report_viewed_product_index --ignore-table=<DBASE_NAME>.dataflow_batch_export  --ignore-table=<DBASE_NAME>.dataflow_batch_import --disable-keys --extended-insert --insert-ignore  <DBASE_NAME> | gzip > <DBASE_NAME>_dump.sql.gz

Compress MySqlDump Database Output Terminal command

Thursday, 22. September 2011

If you want to compress the output of your mysqldump here is the command you will need to use.

mysqldump -uUSER -pPASSWORD DATABASE|gzip > dump.SQL.gz

You can also use bzip2 compression:

mysqldump -uUSER -pPASSWORD DATABASE|bzip2 > dump.SQL.bz2