Table 'portal2.kwf_sessions' doesn't exist (missing kwf tables)

10 views
Skip to first unread message

Artyom M

unread,
Jan 20, 2015, 6:59:22 PM1/20/15
to koala-fra...@googlegroups.com
Niko,

I did composer update today, install memcache and add line 'server.memcache.host = localhost'... and got error after login:

exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'portal2.kwf_sessions' doesn't exist' in C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement\Pdo.php:228
Stack trace:
#0 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement\Pdo.php(228): PDOStatement->execute(Array)
#1 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement.php(323): Zend_Db_Statement_Pdo->_execute(Array)
#2 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Adapter\Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT data FRO...', '1jt5caj3274ho89...')
#4 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Util\SessionHandler.php(117): Zend_Db_Adapter_Pdo_Abstract->query('SELECT data FRO...', '1jt5caj3274ho89...')
#5 [internal function]: Kwf_Util_SessionHandler->read('1jt5caj3274ho89...')
#6 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Session.php(482): session_start()
#7 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Session\Namespace.php(143): Zend_Session::start(true)
#8 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Session\Namespace.php(6): Zend_Session_Namespace->__construct('Zend_Auth', false)
#9 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Auth\Storage\Session.php(13): Kwf_Session_Namespace->__construct('Zend_Auth')
#10 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Auth\Storage\Session.php(38): Kwf_Auth_Storage_Session->_getSession()
#11 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\User\Model.php(222): Kwf_Auth_Storage_Session->read()
#12 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action.php(155): Kwf_User_Model->getAuthedUserRole()
#13 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action.php(78): Kwf_Controller_Action->_getUserRole()
#14 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action.php(21): Kwf_Controller_Action->preDispatch()
#15 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Dispatcher\Standard.php(308): Kwf_Controller_Action->dispatch('indexAction')
#16 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Kwf_Controller_Request_Http), Object(Kwf_Controller_Response_Http))
#17 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Front.php(139): Zend_Controller_Front->dispatch(Object(Kwf_Controller_Request_Http), Object(Kwf_Controller_Response_Http))
#18 C:\OpenServer\domains\aviashelf\bootstrap.php(20): Kwf_Controller_Front->dispatch()
#19 {main}

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'portal2.kwf_sessions' doesn't exist, query was: SELECT data FROM kwf_sessions WHERE sessionId=?' in C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement\Pdo.php:235
Stack trace:
#0 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement.php(323): Zend_Db_Statement_Pdo->_execute(Array)
#1 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Adapter\Abstract.php(480): Zend_Db_Statement->execute(Array)
#2 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT data FRO...', '1jt5caj3274ho89...')
#3 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Util\SessionHandler.php(117): Zend_Db_Adapter_Pdo_Abstract->query('SELECT data FRO...', '1jt5caj3274ho89...')
#4 [internal function]: Kwf_Util_SessionHandler->read('1jt5caj3274ho89...')
#5 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Session.php(482): session_start()
#6 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Session\Namespace.php(143): Zend_Session::start(true)
#7 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Session\Namespace.php(6): Zend_Session_Namespace->__construct('Zend_Auth', false)
#8 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Auth\Storage\Session.php(13): Kwf_Session_Namespace->__construct('Zend_Auth')
#9 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Auth\Storage\Session.php(38): Kwf_Auth_Storage_Session->_getSession()
#10 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\User\Model.php(222): Kwf_Auth_Storage_Session->read()
#11 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action.php(155): Kwf_User_Model->getAuthedUserRole()
#12 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action.php(78): Kwf_Controller_Action->_getUserRole()
#13 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action.php(21): Kwf_Controller_Action->preDispatch()
#14 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Dispatcher\Standard.php(308): Kwf_Controller_Action->dispatch('indexAction')
#15 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Kwf_Controller_Request_Http), Object(Kwf_Controller_Response_Http))
#16 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Front.php(139): Zend_Controller_Front->dispatch(Object(Kwf_Controller_Request_Http), Object(Kwf_Controller_Response_Http))
#17 C:\OpenServer\domains\aviashelf\bootstrap.php(20): Kwf_Controller_Front->dispatch()
#18 {main}

Also tried to update database with command 'php bootstrap.php update' and has error too:

c:\OpenServer\domains\aviashelf>php bootstrap.php update
exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'portal2.kwf_update' doesn't exist' in C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement\Pdo.php:228
Stack trace:
#0 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement\Pdo.php(228): PDOStatement->execute(Array)
#1 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement.php(323): Zend_Db_Statement_Pdo->_execute(Array)
#2 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Adapter\Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE kwf_upda...', 'a:8:{i:0;s:16:"...')
#4 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Util\Update\Helper.php(206): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE kwf_upda...', 'a:8:{i:0;s:16:"...')
#5 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action\Cli\Web\UpdateController.php(53): Kwf_Util_Update_Helper::getExecutedUpdatesNames()
#6 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action.php(33): Kwf_Controller_Action_Cli_Web_UpdateController->indexAction()
#7 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Dispatcher\Standard.php(308): Kwf_Controller_Action->dispatch('indexAction')
#8 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Kwf_Controller_Request_Cli), Object(Kwf_Controller_Response_Http))
#9 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Front.php(139): Zend_Controller_Front->dispatch(Object(Kwf_Controller_Request_Cli), Object(Kwf_Controller_Response_Http))
#10 C:\OpenServer\domains\aviashelf\bootstrap.php(20): Kwf_Controller_Front->dispatch()
#11 {main}

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'portal2.kwf_update' doesn't exist, query was: UPDATE kwf_update SET data=?' in C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement\Pdo.php:235
Stack trace:
#0 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement.php(323): Zend_Db_Statement_Pdo->_execute(Array)
#1 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Adapter\Abstract.php(480): Zend_Db_Statement->execute(Array)
#2 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE kwf_upda...', 'a:8:{i:0;s:16:"...')
#3 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Util\Update\Helper.php(206): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE kwf_upda...', 'a:8:{i:0;s:16:"...')
#4 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action\Cli\Web\UpdateController.php(53): Kwf_Util_Update_Helper::getExecutedUpdatesNames()
#5 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action.php(33): Kwf_Controller_Action_Cli_Web_UpdateController->indexAction()
#6 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Dispatcher\Standard.php(308): Kwf_Controller_Action->dispatch('indexAction')
#7 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Kwf_Controller_Request_Cli), Object(Kwf_Controller_Response_Http))
#8 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Front.php(139): Zend_Controller_Front->dispatch(Object(Kwf_Controller_Request_Cli), Object(Kwf_Controller_Response_Http))
#9 C:\OpenServer\domains\aviashelf\bootstrap.php(20): Kwf_Controller_Front->dispatch()
#10 {main}

I looked which tables (kwc and kwf) I have:
kwc_fulltext_meta
kwf_log_duplicate
kwf_pools
kwf_redirects
kwf_uploads
kwf_users
kwf_user_messages
kwf_welcome

That's all. But in kwf-app-demo are more of them, including those which are due to errors.

How to add missing tables to my app? Only by hands or other way exists?

Niko Sams

unread,
Jan 21, 2015, 2:42:51 AM1/21/15
to Koala Framework Dev
hi,

yes, php bootstrap.php update should create the required tables.

and update does this by excuting all update scripts, also those in Kwf/Update.
Kwf/Update/38004.sql is the one that creates kwf_update table for example.

For obvious reasons an update script must only be executed once - for that "php bootstrap.php update"
remembers the already executed updates.
old version: update file in the application root folder (contains serialized update script names)
new version: kwf_update table in database

I don't remember exactly when we switched from old to new, but i would say around 3.6 or 3.7.

so basically if you copy the database and that database doesn't contain kwf_update table you also need to copy the update file.

if the database contains kwf_update it's much easier, in most cases you don't have to take care about that
(that's the reason why we changed that)


Niko



--
You received this message because you are subscribed to the Google Groups "Koala Framework Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to koala-framework...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Artyom M

unread,
Jan 21, 2015, 3:14:47 AM1/21/15
to koala-fra...@googlegroups.com
I don't understand how to add new tables by "php bootstrap.php update"....without this table it wrote me an error (explained higher).

I created table "kwf_sessions" by hands and it works normally with memcache now.

But creating "kwf_update" table (withount data) not helps:
c:\OpenServer\domains\aviashelf>php bootstrap.php update
No update revision found, assuming up-to-date

How to update? 
Do I need those new tables in my DB?



Artyom M

unread,
Feb 2, 2015, 1:37:36 AM2/2/15
to koala-fra...@googlegroups.com
Today I can't activate user and see error:

exception 'Kwf_Exception' with message 'Invalid column 'activate_token' for model 'Kwf_User_EditModel'' in C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Model\Row\Abstract.php:167
Stack trace:
#0 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Model\Proxy\Row.php(48): Kwf_Model_Row_Abstract->__get('activate_token')
#1 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\User\EditRow.php(91): Kwf_Model_Proxy_Row->__get('activate_token')
#2 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\User\EditRow.php(48): Kwf_User_EditRow->__get('activate_token')
#3 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\User\Auth\PasswordFields.php(78): Kwf_User_EditRow->__set('activate_token', '1422944121:$2a$...')
#4 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\User\Auth\Proxy\Password.php(28): Kwf_User_Auth_PasswordFields->generateActivationToken(Object(Kwf_User_EditRow))
#5 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\User\Row.php(20): Kwf_User_Auth_Proxy_Password->generateActivationToken(Object(Kwf_User_Row))
#6 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\User\Model.php(126): Kwf_User_Row->generateActivationToken()
#7 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\User\Mail\Activation.php(11): Kwf_User_Model->getUserActivationUrl(Object(Kwf_User_Row))
#8 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\User\EditRow.php(261): Kwf_User_Mail_Activation->__construct(Object(Kwf_User_Row))
#9 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action\User\UsersController.php(123): Kwf_User_EditRow->sendActivationMail()
#10 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action.php(33): Kwf_Controller_Action_User_UsersController->jsonResendMailAction()
#11 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Dispatcher\Standard.php(308): Kwf_Controller_Action->dispatch('jsonResendMailA...')
#12 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Kwf_Controller_Request_Http), Object(Kwf_Controller_Response_Http))
#13 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Front.php(139): Zend_Controller_Front->dispatch(Object(Kwf_Controller_Request_Http), Object(Kwf_Controller_Response_Http))
#14 C:\OpenServer\domains\aviashelf\bootstrap.php(20): Kwf_Controller_Front->dispatch()
#15 {main}

See activation_token.png in attach.

I install kwf-app-demo and decide to compare 3.5 'kwf_users' table with 3.8 table and found some changes:
1. in 3.8 'locked' table not exists
2. in 3.8 there are new fields: 'autologin' and 'activate_token'.

See 3.5_users.jpg and 3.8_users.jpg

Now I will manually transfer the new fields. Unfortunately, transit DB to new version for me is more and more like the creation of Frankenstein 
activation_token.png
3.5_users.JPG
3.8_users.JPG

Niko Sams

unread,
Feb 3, 2015, 11:13:35 AM2/3/15
to Koala Framework Dev
On Mon, Feb 2, 2015 at 7:37 AM, Artyom M <psycho...@gmail.com> wrote:
> install kwf-app-demo and decide to compare 3.5 'kwf_users' table with 3.8 table and found some changes:
>
> 1. in 3.8 'locked' table not exists
that is correct. the feature to lock users was removed.

> 2. in 3.8 there are new fields: 'autologin' and 'activate_token'.
yes, you'll need those two fields, especially the activate_token.

And there are update scripts Kwf/Update/38014.sql and 30815.sql that create those columns when executing php bootstrap.php update


Did the update not create the columns for you?
and did you fix the issue by creating them manually?

Niko

Reply all
Reply to author
Forward
0 new messages