Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AOE Scheduler - SQLSTATE[42S22] Column not found #173

Closed
Tjitse-E opened this issue Sep 26, 2015 · 11 comments
Closed

AOE Scheduler - SQLSTATE[42S22] Column not found #173

Tjitse-E opened this issue Sep 26, 2015 · 11 comments

Comments

@Tjitse-E
Copy link

Hi,

After installing the Aoe_Scheduler on a Magento 1.7 CE both cron.sh and scheduler_cron.sh generate an error.

a:5:{i:0;s:84:"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'last_seen' in 'where clause'";i:1;s:2201:"#0 /home/_/_.nl/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)

When I disable the AOE Scheduler the cron error disappears. Did anyone encounter this error before?

@fbrnc
Copy link
Member

fbrnc commented Sep 28, 2015

Hi @Tjitse-E,
the last_seen field was introduced in 0.4.2.
How did you install the module?
Did you clear caches and did the setup scripts run? (What version numbers do you see in the core_resource table: select * from core_resource where code like 'aoescheduler_setup';?)

Cheers,
Fabrizio

@Tjitse-E
Copy link
Author

Hi Fabrizio,

I've installed the plugin via FTP. Unfortunately we're not familiar with modman or composer. I've cleared all the caches and I see the aoescheduler_setup in core_resource (version number 1.2.1).

I just tried to clear the caches again, then activated the module. Still the same error (SQLSTATE[42S22) appears when I try to execute the cron.

Cheers,
Tjitse

@fbrnc
Copy link
Member

fbrnc commented Sep 29, 2015

Hi @Tjitse-E,

  • delete everything in app/code/local/Aoe/Scheduler (if there's anything). This might be leftovers from previous versions
  • make sure you're using the latest version from Github 1.2.x
  • confirm you've copied every file/directory into the correct location
  • clear all caches.
  • consider using modman and composer.
    Find some more information on how to install a module here: http://fbrnc.net/blog/2014/11/how-to-install-a-magento-module

Cheers,
Fabrizio

@Tjitse-E
Copy link
Author

Hi Fabrizio,

Thanks for your suggestion.

The local/Aoe folder was empty, so no leftovers. I've reinstalled the latest Aoe Scheduler module and cleared all caches. The same error appeared after executing cron.sh.

Is there anything else that I can try?

@fbrnc
Copy link
Member

fbrnc commented Nov 3, 2015

It's hard to tell what the issue is only be looking at the error message. I still think it's an issue with some files not being in the right place.
Feel free to reopen this issue if you have more information about this.

@fbrnc fbrnc closed this as completed Nov 3, 2015
@Tjitse-E
Copy link
Author

Tjitse-E commented Dec 2, 2015

I've reinstalled the latest version (1.3) of the scheduler module with modman. Still, the issue remains. When I try to execute scheduler_cron.sh:

shop@magento1:~/shop.nl$ ./scheduler_cron.sh
exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'last_seen' in 'where clause'' in /home/shop/shop.nl/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /home/shop/shop.nl/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/shop/shop.nl/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/shop/shop.nl/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /home/shop/shop.nl/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /home/shop/shop.nl/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
#5 /home/shop/shop.nl/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
#6 /home/shop/shop.nl/lib/Zend/Db/Adapter/Abstract.php(734): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `main_ta...', Array)
#7 /home/shop/shop.nl/lib/Varien/Data/Collection/Db.php(734): Zend_Db_Adapter_Abstract->fetchAll('SELECT `main_ta...', Array)
#8 /home/shop/shop.nl/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521): Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array)
#9 /home/shop/shop.nl/lib/Varien/Data/Collection/Db.php(566): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
#10 /home/shop/shop.nl/app/code/community/Aoe/Scheduler/Model/ProcessManager.php(98): Varien_Data_Collection_Db->load()
#11 /home/shop/shop.nl/app/code/community/Aoe/Scheduler/Model/ProcessManager.php(144): Aoe_Scheduler_Model_ProcessManager->checkRunningJobs()
#12 /home/shop/shop.nl/app/code/community/Aoe/Scheduler/Model/Observer.php(24): Aoe_Scheduler_Model_ProcessManager->watchdog()
#13 /home/shop/shop.nl/app/code/core/Mage/Core/Model/App.php(1338): Aoe_Scheduler_Model_Observer->dispatch(Object(Varien_Event_Observer))
#14 /home/shop/shop.nl/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Aoe_Scheduler_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#15 /home/shop/shop.nl/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('default', Array)
#16 /home/shop/shop.nl/shell/scheduler.php(377): Mage::dispatchEvent('default', Array)
#17 /home/shop/shop.nl/shell/scheduler.php(37): Aoe_Scheduler_Shell_Scheduler->cronAction()
#18 /home/shop/shop.nl/shell/scheduler.php(403): Aoe_Scheduler_Shell_Scheduler->run()
#19 {main}

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'last_seen' in 'where clause'' in /home/shop/shop.nl/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /home/shop/shop.nl/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/shop/shop.nl/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/shop/shop.nl/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /home/shop/shop.nl/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
#4 /home/shop/shop.nl/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
#5 /home/shop/shop.nl/lib/Zend/Db/Adapter/Abstract.php(734): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `main_ta...', Array)
#6 /home/shop/shop.nl/lib/Varien/Data/Collection/Db.php(734): Zend_Db_Adapter_Abstract->fetchAll('SELECT `main_ta...', Array)
#7 /home/shop/shop.nl/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521): Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array)
#8 /home/shop/shop.nl/lib/Varien/Data/Collection/Db.php(566): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
#9 /home/shop/shop.nl/app/code/community/Aoe/Scheduler/Model/ProcessManager.php(98): Varien_Data_Collection_Db->load()
#10 /home/shop/shop.nl/app/code/community/Aoe/Scheduler/Model/ProcessManager.php(144): Aoe_Scheduler_Model_ProcessManager->checkRunningJobs()
#11 /home/shop/shop.nl/app/code/community/Aoe/Scheduler/Model/Observer.php(24): Aoe_Scheduler_Model_ProcessManager->watchdog()
#12 /home/shop/shop.nl/app/code/core/Mage/Core/Model/App.php(1338): Aoe_Scheduler_Model_Observer->dispatch(Object(Varien_Event_Observer))
#13 /home/shop/shop.nl/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Aoe_Scheduler_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#14 /home/shop/shop.nl/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('default', Array)
#15 /home/shop/shop.nl/shell/scheduler.php(377): Mage::dispatchEvent('default', Array)
#16 /home/shop/shop.nl/shell/scheduler.php(37): Aoe_Scheduler_Shell_Scheduler->cronAction()
#17 /home/shop/shop.nl/shell/scheduler.php(403): Aoe_Scheduler_Shell_Scheduler->run()

Database entry AOE Scheduler in Core_resource: aoescheduler_setup 1.3.0 1.3.0.

Any ideas where to look further?

@peterstonesr
Copy link

If you look in the install-1.0.0.php script and mysql4-upgrade-0.41-0.4.2.php it is meant to add a column for last seen, however when I installed the latest AOE onto a new magento install (So had no prior AOE install), I get the same error as @Tjitse-E

It seems the install scripts aren't running correctly as there are more columns that are meant to be added in the install-1.0.0.php file but my cron_shedule table is missing these

@Tjitse-E
Copy link
Author

@peterstonesr i've got the module working by deleting it's entry in core_resource + refreshing the cache.

@EddyBuhler
Copy link

I'm having the same problem. I manually downloaded 1.3.1, copied all files it into my magento root, but the install script doesn't appear to get triggered (at least I do not see an entry for AOE Scheduler in core_resource).

The cronjobs fail with the above quoted error about the last_seen column missing.

@Tjitse-E
Copy link
Author

@EddyBuhler with Magerun you can execute the setup scripts manually. Check out their repo on Github.

@LiamKarlMitchell
Copy link

/bin/sh /home/user/public_html/website/scheduler_cron.sh
exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'last_seen' in 'where clause'' in /home/user/public_html/website/lib/Zend/Db/Statement/Pdo.php:228

Same problem on Magento 1.9.0.1 uploaded via FTP.
I enabled symlinks somewhere in Magento Admin Panel so that it would load up. (Only loads up sometimes).

But "No heartbeat task found." probably because of this error.

Documentation for installation is incomplete?

select * from core_resource where code like 'aoescheduler_setup';

No results.

Install magerun

wget https://files.magerun.net/n98-magerun.phar
chmod +x ./n98-magerun.phar

Check stored core_resource version against module versions.

./n98-magerun.phar sys:setup:compare-versions

Run any new setup scripts.

./n98-magerun.phar sys:setup:run

Now its installed.

select * from core_resource where code like 'aoescheduler_setup';

1.5.0 as expected and pages now show up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants