MISP / MISP

MISP (core software) - Open Source Threat Intelligence and Sharing Platform
https://www.misp-project.org/
GNU Affero General Public License v3.0
5.41k stars 1.4k forks source link

Bug: INSTALL on Ubuntu 24.04 fails #9999

Open uforia opened 1 month ago

uforia commented 1 month ago

Actual behavior

During the installation on an Ubuntu 24.04.01 LTS system, INSTALLER fails during MISP updates with:

[STATUS] Running MISP updates
Error: Database connection "MysqlObserverExtended" is missing, or could not be created.
#0 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Datasource/DboSource.php(278): Mysql->connect()
#1 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/ConnectionManager.php(105): DboSource->__construct()
#2 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3660): ConnectionManager::getDataSource()
#3 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(1163): Model->setDataSource()
#4 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3687): Model->setSource()
#5 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(1395): Model->getDataSource()
#6 /var/www/MISP/app/Plugin/SysLogLogable/Model/Behavior/SysLogLogableBehavior.php(283): Model->schema()
#7 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/BehaviorCollection.php(145): SysLogLogableBehavior->setup()
#8 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/BehaviorCollection.php(66): BehaviorCollection->load()
#9 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(782): BehaviorCollection->init()
#10 /var/www/MISP/app/Model/AppModel.php(114): Model->__construct()
#11 /var/www/MISP/app/Model/User.php(255): AppModel->__construct()
#12 [internal function]: User->__construct()
#13 /var/www/MISP/app/Lib/cakephp/lib/Cake/Utility/ClassRegistry.php(169): ReflectionClass->newInstance()
#14 /var/www/MISP/app/Lib/cakephp/lib/Cake/Console/Shell.php(315): ClassRegistry::init()
#15 /var/www/MISP/app/Lib/cakephp/lib/Cake/Console/Shell.php(269): Shell->loadModel()
#16 /var/www/MISP/app/Lib/cakephp/lib/Cake/Console/Shell.php(228): Shell->_loadModels()
#17 /var/www/MISP/app/Console/Command/AppShell.php(53): Shell->initialize()
#18 /var/www/MISP/app/Lib/cakephp/lib/Cake/Console/ShellDispatcher.php(221): AppShell->initialize()
#19 /var/www/MISP/app/Lib/cakephp/lib/Cake/Console/ShellDispatcher.php(66): ShellDispatcher->dispatch()
#20 /var/www/MISP/app/Console/cake.php(47): ShellDispatcher::run()

After the background workers setup and the 'settings configured', the installer attempts to ingest JSON structures, and this causes a hard error:

[STATUS] Ingesting JSON structures
[ERROR] JSON structures ingestion failed. Please check /var/log/misp_install.log for more details.

The install.log at that point is filled with similar errors:

Error: Database connection "MysqlObserverExtended" is missing, or could not be created.
#0 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Datasource/DboSource.php(278): Mysql->connect()
#1 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/ConnectionManager.php(105): DboSource->__construct()
#2 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3660): ConnectionManager::getDataSource()
#3 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(1163): Model->setDataSource()
#4 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3687): Model->setSource()
#5 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(1395): Model->getDataSource()
#6 /var/www/MISP/app/Plugin/SysLogLogable/Model/Behavior/SysLogLogableBehavior.php(283): Model->schema()
#7 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/BehaviorCollection.php(145): SysLogLogableBehavior->setup()
#8 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/BehaviorCollection.php(66): BehaviorCollection->load()
#9 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(782): BehaviorCollection->init()
#10 /var/www/MISP/app/Model/AppModel.php(114): Model->__construct()
#11 /var/www/MISP/app/Model/User.php(255): AppModel->__construct()
#12 [internal function]: User->__construct()
#13 /var/www/MISP/app/Lib/cakephp/lib/Cake/Utility/ClassRegistry.php(169): ReflectionClass->newInstance()
#14 /var/www/MISP/app/Plugin/SysLogLogable/Model/Behavior/SysLogLogableBehavior.php(279): ClassRegistry::init()
#15 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/BehaviorCollection.php(145): SysLogLogableBehavior->setup()
#16 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/BehaviorCollection.php(66): BehaviorCollection->load()
#17 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(782): BehaviorCollection->init()
#18 /var/www/MISP/app/Model/AppModel.php(114): Model->__construct()
#19 [internal function]: AppModel->__construct()
#20 /var/www/MISP/app/Lib/cakephp/lib/Cake/Utility/ClassRegistry.php(169): ReflectionClass->newInstance()
#21 /var/www/MISP/app/Lib/cakephp/lib/Cake/Console/Shell.php(315): ClassRegistry::init()
#22 /var/www/MISP/app/Lib/cakephp/lib/Cake/Console/Shell.php(269): Shell->loadModel()
#23 /var/www/MISP/app/Lib/cakephp/lib/Cake/Console/Shell.php(228): Shell->_loadModels()
#24 /var/www/MISP/app/Console/Command/AppShell.php(53): Shell->initialize()
#25 /var/www/MISP/app/Lib/cakephp/lib/Cake/Console/ShellDispatcher.php(221): AppShell->initialize()
#26 /var/www/MISP/app/Lib/cakephp/lib/Cake/Console/ShellDispatcher.php(66): ShellDispatcher->dispatch()
#27 /var/www/MISP/app/Console/cake.php(47): ShellDispatcher::run()
#28 {main}

Expected behavior

The install should complete normally.

Steps to reproduce

Start a clean install or restart an errored out existing install:

pecl uninstall brotli simdjson zstd
rm -rf /var/www/MISP /var/www/.cache
./INSTALL.ubuntu2404.sh

Version

2.5

Operating System

Ubuntu

Operating System version

24.04.01

PHP version

8.3

Browser

All

Browser version

No response

Relevant log output

No response

Extra attachments

No response

Code of Conduct

ronaldocherokee commented 1 month ago

The same issue

iglocska commented 1 month ago

Anything in /var/log/misp_install.log? Sounds like something went wrong with creating the MISP db in the first place or perhaps even the misp DB user in mariadb.

iglocska commented 1 month ago

The issue pasted above is already a symptom of the error not the actual error please share the fill misp_install.log file instead.

Kelvinloucosta commented 4 weeks ago

The same issue

uforia commented 2 weeks ago

misp_install.log

Please see the attached misp_install.log file. Is it possible to provide a workaround/fix for this? It's a showstopper currently.

uforia commented 1 week ago

I've resolved this by manually completely wiping and doing a clean install of everything. Would it be possible to add a feature to the installer to 'clean up' after a failed install?