Wednesday, April 29, 2015

After upgrade from 1.9.0.1 to 1.9.1.0 magent sales email not working - No heartbeat task found. Check if cron is configured correctly

When I upgraded Magento 1.9.0.1 to 1.9.1.0 I noticed that sales email not working.

I read that
Starting with Magento 1.9.1 the emails are not being sent directly during checkout but instead are being queued. The queue is being processed via your Magento cronjob

To resolve this issue, I installed http://www.magentocommerce.com/magento-connect/aoe-scheduler.html extension. But had error message on magento admin "No heartbeat task found. Check if cron is configured correctly" and still no sales email was being sent.

My hosting is on godaddy server, to resolve No heartbeat task found, did following steps

1. Logged in to goDaddy
2. In Advance section, go to Crons Jobs
3. Add new Cron Job with command /bin/sh /home/<your hosting>/public_html/scheduler_cron.sh

Hope it will resolve the email sending issue.
 
Note if you are not able to install  aoe-scheduler, download its zipped version from "https://github.com/AOEpeople/Aoe_Scheduler", and copy it to your domain directly wisely. To take back is recommended.

References
http://magento.stackexchange.com/questions/45571/new-order-email-confirmation-not-being-sent-magento-1-9-1

Wednesday, April 1, 2015

Base table or view already exists: 1050 Table 'mage_core_email_queue' already exists after upgrade from 1.9.0.1 to 1.9.1.0

Base table or view already exists: 1050 Table 'mage_core_email_queue' already exists after upgrade from 1.9.0.1 to 1.9.1.0.

Full stack trace as below


/public_html/temp/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php" - SQLSTATE[42S01]:

Base table or view already exists: 1050 Table 'mage_core_email_queue' already exists, query was: CREATE TABLE `mage_core_email_queue` (
  `message_id` int

UNSIGNED NOT NULL auto_increment COMMENT 'Message Id' ,
  `entity_id` int UNSIGNED NULL COMMENT 'Entity ID' ,
  `entity_type` varchar(128) NULL COMMENT 'Entity

Type' ,
  `event_type` varchar(128) NULL COMMENT 'Event Type' ,
  `message_body_hash` varchar(64) NOT NULL COMMENT 'Message Body Hash' ,
  `message_body`

mediumtext NOT NULL COMMENT 'Message Body' ,
  `message_parameters` text NOT NULL COMMENT 'Message Parameters' ,
  `created_at` timestamp NULL default NULL

COMMENT 'Creation Time' ,
  `processed_at` timestamp NULL default NULL COMMENT 'Finish Time' ,
  PRIMARY KEY (`message_id`),
  INDEX

`747D3AF379628D00D009E037E2942C80` (`entity_id`, `entity_type`, `event_type`, `message_body_hash`)
) COMMENT='Email Queue' ENGINE=INNODB charset=utf8

COLLATE=utf8_general_ci";i:1;s:1058:"#0

Reason

The reason is clearly stated in log that table "mage_core_email_queue" alreay exist, 
 

Resolution:

I gone through the file located in "/mydomain/app/code/core/Mage/Core/sql/core_setup/" upgrade-1.6.0.5-1.6.0.6.php and reconcile current table structure of mage_core_email_queue and the one given in file upgrade-1.6.0.5-1.6.0.6.php and found already exists. 
 
Delete file "/mydomain/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php" will solve the issue.
Note; there is another table in this file with the name mage_core_email_recipients, reconcile it with your existing database as well if the same with your existing schema so there is no need of upgrade-1.6.0.5-1.6.0.6.php file at all.
You are strongly encourage to backup upgrade-1.6.0.5-1.6.0.6.php before deleting it.