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

Bug: Error: [MissingTableException] Table default_correlations for model Correlation was not found in datasource default. Exception Attributes: array ( #8620

Closed
1 task done
dazed51 opened this issue Sep 27, 2022 · 3 comments
Labels
needs triage This issue has been automatically labelled and needs further triage

Comments

@dazed51
Copy link

dazed51 commented Sep 27, 2022

Expected behavior

I am able to navigate to our dev landing page with no issues or errors, as with case two release cycles ago.

Actual behavior

Our prod instance of instance is throwing an internal server erorr msg while, dev doesnt. Prod instance also is showing stack trace errors, while dev does not.

#8 /var/www/MISP/app/Model/Event.php(645): Correlation->getRelatedEventIds()
#9 /var/www/MISP/app/Model/Event.php(572): Event->getRelatedEventCount()
#10 /var/www/MISP/app/Controller/EventsController.php(1054): Event->attachCorrelationCountToEvents()
#11 /var/www/MISP/app/Controller/EventsController.php(743): EventsController->__attachInfoToEvents()
#12 [internal function]: EventsController->index()
#13 /var/www/MISP/app/Lib/cakephp/lib/Cake/Controller/Controller.php(499): ReflectionMethod->invokeArgs()
#14 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(193): Controller->invokeAction()
#15 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke()
#16 /var/www/MISP/app/webroot/index.php(99): Dispatcher->dispatch()
#17 {main}
2022-09-27 11:17:39 Error: [MissingTableException] Table default_correlations for model Correlation was not found in datasource default.
Exception Attributes: array (
'table' => 'default_correlations',
'class' => 'Correlation',
'ds' => 'default',
)
Request URL: /events/index
Stack Trace:
#0 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3686): Model->setSource()
#1 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3053): Model->getDataSource()
#2 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3025): Model->_readDataSource()
#3 /var/www/MISP/app/Model/Behavior/DefaultCorrelationBehavior.php(488): Model->find()
#4 /var/www/MISP/app/Model/Behavior/DefaultCorrelationBehavior.php(436): DefaultCorrelationBehavior->__filterRelatedEvents()
#5 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/BehaviorCollection.php(238): DefaultCorrelationBehavior->fetchRelatedEventIds()
#6 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(829): BehaviorCollection->dispatchMethod()
#7 /var/www/MISP/app/Model/Correlation.php(843): Model->__call()
#8 /var/www/MISP/app/Model/Event.php(645): Correlation->getRelatedEventIds()
#9 /var/www/MISP/app/Model/Event.php(572): Event->getRelatedEventCount()
#10 /var/www/MISP/app/Controller/EventsController.php(1054): Event->attachCorrelationCountToEvents()
#11 /var/www/MISP/app/Controller/EventsController.php(743): EventsController->__attachInfoToEvents()
#12 [internal function]: EventsController->index()
#13 /var/www/MISP/app/Lib/cakephp/lib/Cake/Controller/Controller.php(499): ReflectionMethod->invokeArgs()
#14 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(193): Controller->invokeAction()
#15 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke()
#16 /var/www/MISP/app/webroot/index.php(99): Dispatcher->dispatch()
#17 {main}
2022-09-27 11:18:19 Error: [MissingTableException] Table default_correlations for model Correlation was not found in datasource default.
Exception Attributes: array (
'table' => 'default_correlations',
'class' => 'Correlation',
'ds' => 'default',
)
Request URL: /
Stack Trace:
#0 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3686): Model->setSource()
#1 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3053): Model->getDataSource()
#2 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3025): Model->_readDataSource()
#3 /var/www/MISP/app/Model/Behavior/DefaultCorrelationBehavior.php(488): Model->find()
#4 /var/www/MISP/app/Model/Behavior/DefaultCorrelationBehavior.php(436): DefaultCorrelationBehavior->__filterRelatedEvents()
#5 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/BehaviorCollection.php(238): DefaultCorrelationBehavior->fetchRelatedEventIds()
#6 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(829): BehaviorCollection->dispatchMethod()
#7 /var/www/MISP/app/Model/Correlation.php(843): Model->__call()
#8 /var/www/MISP/app/Model/Event.php(645): Correlation->getRelatedEventIds()
#9 /var/www/MISP/app/Model/Event.php(572): Event->getRelatedEventCount()
#10 /var/www/MISP/app/Controller/EventsController.php(1054): Event->attachCorrelationCountToEvents()
#11 /var/www/MISP/app/Controller/EventsController.php(743): EventsController->__attachInfoToEvents()
#12 [internal function]: EventsController->index()
#13 /var/www/MISP/app/Lib/cakephp/lib/Cake/Controller/Controller.php(499): ReflectionMethod->invokeArgs()
#14 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(193): Controller->invokeAction()
#15 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke()
#16 /var/www/MISP/app/webroot/index.php(99): Dispatcher->dispatch()
#17 {main}
2022-09-27 11:18:32 Error: [MissingTableException] Table default_correlations for model Correlation was not found in datasource default.
Exception Attributes: array (
'table' => 'default_correlations',
'class' => 'Correlation',
'ds' => 'default',
)
Request URL: /events/index
Stack Trace:
#0 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3686): Model->setSource()
#1 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3053): Model->getDataSource()
#2 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3025): Model->_readDataSource()
#3 /var/www/MISP/app/Model/Behavior/DefaultCorrelationBehavior.php(488): Model->find()
#4 /var/www/MISP/app/Model/Behavior/DefaultCorrelationBehavior.php(436): DefaultCorrelationBehavior->__filterRelatedEvents()
#5 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/BehaviorCollection.php(238): DefaultCorrelationBehavior->fetchRelatedEventIds()
#6 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(829): BehaviorCollection->dispatchMethod()
#7 /var/www/MISP/app/Model/Correlation.php(843): Model->__call()
#8 /var/www/MISP/app/Model/Event.php(645): Correlation->getRelatedEventIds()
#9 /var/www/MISP/app/Model/Event.php(572): Event->getRelatedEventCount()
#10 /var/www/MISP/app/Controller/EventsController.php(1054): Event->attachCorrelationCountToEvents()
#11 /var/www/MISP/app/Controller/EventsController.php(743): EventsController->__attachInfoToEvents()
#12 [internal function]: EventsController->index()
#13 /var/www/MISP/app/Lib/cakephp/lib/Cake/Controller/Controller.php(499): ReflectionMethod->invokeArgs()
#14 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(193): Controller->invokeAction()
#15 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke()
#16 /var/www/MISP/app/webroot/index.php(99): Dispatcher->dispatch()
#17 {main}

Steps to reproduce

tailed log file while navigating to land page and events page as you can see above

Version

2.4.163

Operating System

Ubuntu (both dev, prod)

Operating System version

20.04

PHP version

7.4.3 (dev,prod)

Browser

all browsers

Browser version

No response

Relevant log output

No response

Extra attachments

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@dazed51 dazed51 added the needs triage This issue has been automatically labelled and needs further triage label Sep 27, 2022
@zeroq
Copy link

zeroq commented Sep 28, 2022

going to "Server Settings & Maintance" -> "Diagnostics" and clicking "Clean Cache" solved that error for me. Looks like the old database model is cached and after upgrade of MISP this is still the old model in the cache.

@dazed51
Copy link
Author

dazed51 commented Sep 28, 2022

Great, thanks for the help. That worked. Closing ticket.

@dazed51 dazed51 closed this as completed Sep 28, 2022
@juju4
Copy link
Contributor

juju4 commented Dec 10, 2022

I'm also getting this error in my ansible role CI test, so for a newly setup MISP.
Is it possible to have cache issue? any way to do clean cache from cli or api?
I don't see default_correlations table in https://github.com/MISP/MISP/blob/2.4/INSTALL/MYSQL.sql but it is in https://github.com/MISP/MISP/blob/2.4/db_schema.json

https://github.com/juju4/ansible-MISP/actions/runs/3665313403/jobs/6196301391#step:9:5932

TASK [juju4.misp : Check MISP logs] ********************************************
       task path: /tmp/kitchen/juju4.misp/tasks/misp-add-users.yml:82
       Saturday 10 December 2022  18:26:49 +0000 (0:00:01.610)       0:15:20.239 ***** 
       ok: [localhost] => {"changed": false, "cmd": ["tail", "-n100", "/var/www/_MISP/MISP/app/tmp/logs/error.log", "/var/www/_MISP/MISP/app/tmp/logs/debug.log"], "delta": "0:00:00.004733", "end": "2022-12-10 18:26:49.511766", "msg": "", "rc": 0, "start": "2022-12-10 18:26:49.507033", "stderr": "", "stderr_lines": [], "stdout": "==> /var/www/_MISP/MISP/app/tmp/logs/error.log <==\n2022-12-10 18:26:47 Error: [MissingTableException] Table default_correlations for model Correlation was not found in datasource default.\nException Attributes: array (\n  'table' => 'default_correlations',\n  'class' => 'Correlation',\n  'ds' => 'default',\n)\nRequest URL: /servers/getVersion\nStack Trace:\n#0 /var/www/_MISP/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3686): Model->setSource('default_correla...')\n#1 /var/www/_MISP/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3488): Model->getDataSource()\n#2 /var/www/_MISP/MISP/app/Model/Correlation.php(1118): Model->query('truncate table ...')\n#3 /var/www/_MISP/MISP/app/Model/AppModel.php(3827): Correlation->truncate(Array, 'Legacy')\n#4 /var/www/_MISP/MISP/app/Model/AppModel.php(233): AppModel->__retireOldCorrelationEngine()\n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has been automatically labelled and needs further triage
Projects
None yet
Development

No branches or pull requests

3 participants