MISP icon indicating copy to clipboard operation
MISP copied to clipboard

Bug: MISP cannot access workers

Open clunk0y opened this issue 1 year ago • 5 comments

Actual behavior

Expected behavior

Hello,

After updating to version 2.5, MISP is unable to access Redis and displays the following error:

Warning: MISP cannot access your /proc directory to check the status of the worker processes, which means that dead workers will not be detected by the diagnostic tool. If you would like to regain this functionality, make sure that the open_basedir directive is not set, or that /proc is included in it.

Warning: MISP cannot connect to the Supervisord API, check the following settings are correct: [`supervisor_host`, `supervisor_port`, `supervisor_user`, `supervisor_password`] and restart the service. For details check the MISP error logs.

. Interestingly, Redis is running on port 6379, and I am receiving a pong response, but MISP cannot connect to it. Additionally, the supervisor username and password have been entered correctly. I would appreciate your assistance with this issue.

Thank you!

Feel free to add the specific error message where indicated!

Steps to reproduce

Version

2.5

Operating System

Ubuntu

Operating System version

24.04.1

PHP version

8.3

Browser

No response

Browser version

No response

Relevant log output

Warning (2): Undefined array key "proc_accessible" [APP/View/Elements/healthElements/workers.ctp, line 3]
Code Context
include - APP/View/Elements/healthElements/workers.ctp, line 3
View::_evaluate() - APP/Lib/cakephp/lib/Cake/View/View.php, line 971
View::_render() - APP/Lib/cakephp/lib/Cake/View/View.php, line 933
View::_renderElement() - APP/Lib/cakephp/lib/Cake/View/View.php, line 1224
View::element() - APP/Lib/cakephp/lib/Cake/View/View.php, line 418
include - APP/View/Servers/server_settings.ctp, line 13
View::_evaluate() - APP/Lib/cakephp/lib/Cake/View/View.php, line 971
View::_render() - APP/Lib/cakephp/lib/Cake/View/View.php, line 933
View::render() - APP/Lib/cakephp/lib/Cake/View/View.php, line 473
Controller::render() - APP/Lib/cakephp/lib/Cake/Controller/Controller.php, line 973
Dispatcher::_invoke() - APP/Lib/cakephp/lib/Cake/Routing/Dispatcher.php, line 200
Dispatcher::dispatch() - APP/Lib/cakephp/lib/Cake/Routing/Dispatcher.php, line 167
[main] - APP/webroot/index.php, line 99
Warning: MISP cannot access your /proc directory to check the status of the worker processes, which means that dead workers will not be detected by the diagnostic tool. If you would like to regain this functionality, make sure that the open_basedir directive is not set, or that /proc is included in it.
Warning (2): Undefined array key "supervisord_status" [APP/View/Elements/healthElements/workers.ctp, line 9]
Code Context
include - APP/View/Elements/healthElements/workers.ctp, line 9
View::_evaluate() - APP/Lib/cakephp/lib/Cake/View/View.php, line 971
View::_render() - APP/Lib/cakephp/lib/Cake/View/View.php, line 933
View::_renderElement() - APP/Lib/cakephp/lib/Cake/View/View.php, line 1224
View::element() - APP/Lib/cakephp/lib/Cake/View/View.php, line 418
include - APP/View/Servers/server_settings.ctp, line 13
View::_evaluate() - APP/Lib/cakephp/lib/Cake/View/View.php, line 971
View::_render() - APP/Lib/cakephp/lib/Cake/View/View.php, line 933
View::render() - APP/Lib/cakephp/lib/Cake/View/View.php, line 473
Controller::render() - APP/Lib/cakephp/lib/Cake/Controller/Controller.php, line 973
Dispatcher::_invoke() - APP/Lib/cakephp/lib/Cake/Routing/Dispatcher.php, line 200
Dispatcher::dispatch() - APP/Lib/cakephp/lib/Cake/Routing/Dispatcher.php, line 167
[main] - APP/webroot/index.php, line 99
Warning: MISP cannot connect to the Supervisord API, check the following settings are correct: [`supervisor_host`, `supervisor_port`, `supervisor_user`, `supervisor_password`] and restart the service. For details check the MISP error logs.
Warning (2): Undefined array key "controls" [APP/View/Elements/healthElements/workers.ctp, line 15]
Code Context
include - APP/View/Elements/healthElements/workers.ctp, line 15
View::_evaluate() - APP/Lib/cakephp/lib/Cake/View/View.php, line 971
View::_render() - APP/Lib/cakephp/lib/Cake/View/View.php, line 933
View::_renderElement() - APP/Lib/cakephp/lib/Cake/View/View.php, line 1224
View::element() - APP/Lib/cakephp/lib/Cake/View/View.php, line 418
include - APP/View/Servers/server_settings.ctp, line 13
View::_evaluate() - APP/Lib/cakephp/lib/Cake/View/View.php, line 971
View::_render() - APP/Lib/cakephp/lib/Cake/View/View.php, line 933
View::render() - APP/Lib/cakephp/lib/Cake/View/View.php, line 473
Controller::render() - APP/Lib/cakephp/lib/Cake/Controller/Controller.php, line 973
Dispatcher::_invoke() - APP/Lib/cakephp/lib/Cake/Routing/Dispatcher.php, line 200
Dispatcher::dispatch() - APP/Lib/cakephp/lib/Cake/Routing/Dispatcher.php, line 167
[main] - APP/webroot/index.php, line 99

Extra attachments

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

clunk0y avatar Oct 16 '24 05:10 clunk0y

Hey there, the issue appears to be that MISP cannot connect to supervisord. Some troubleshooting steps:

  1. Check the config variables for SimpleBackgroundJobs and ensure that the redis and supervisor variables are set correctly.
  2. Ensure that redis and supervisord are configured accordingly to your variables, especially username and password.
  3. Check redis and supervisord logs for errors.

simonbjorzen-ts avatar Oct 16 '24 09:10 simonbjorzen-ts

Hey there, the issue appears to be that MISP cannot connect to supervisord. Some troubleshooting steps:

  1. Check the config variables for SimpleBackgroundJobs and ensure that the redis and supervisor variables are set correctly.
  2. Ensure that redis and supervisord are configured accordingly to your variables, especially username and password.
  3. Check redis and supervisord logs for errors.

Hello there, All these tasks have been completed, and there are no issues in the logs. I even manually tested the status of Redis and Supervisor using curl, and they are working. There was nothing in the announced logs. The only log with an error is the MISP error log.

Error: [Exception] Class Redis doesn't exists. Please install redis extension for PHP. Request URL: /servers/serverSettings/diagnostics Stack Trace: #0 /var/www/MISP/app/Lib/Tools/BackgroundJobsTool.php(126): BackgroundJobsTool->createRedisConnection() #1 /var/www/MISP/app/Model/AppModel.php(3307): BackgroundJobsTool->__construct() #2 /var/www/MISP/app/Model/Server.php(3856): AppModel->getBackgroundJobsTool() #3 /var/www/MISP/app/Controller/ServersController.php(1194): Server->backgroundJobsDiagnostics() #4 [internal function]: ServersController->serverSettings() #5 /var/www/MISP/app/Lib/cakephp/lib/Cake/Controller/Controller.php(504): ReflectionMethod->invokeArgs() #6 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(193): Controller->invokeAction() #7 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke() #8 /var/www/MISP/app/webroot/index.php(99): Dispatcher->dispatch() #9 {main}

clunk0y avatar Oct 16 '24 13:10 clunk0y

Looks like the redis extension for PHP is missing, this may be caused by multiple things. Do you see redis when running "php -m"? If not, try running "phpenmod redis"

simonbjorzen-ts avatar Oct 16 '24 14:10 simonbjorzen-ts

Looks like the redis extension for PHP is missing, this may be caused by multiple things. Do you see redis when running "php -m"? If not, try running "phpenmod redis"

Yes, I can see Redis in "php -m".

clunk0y avatar Oct 16 '24 14:10 clunk0y

Do you have both php7.4 and php8.x installed now? Which php binary is php -m using? I assume that it might be using 7.4 still?

simonbjorzen-ts avatar Oct 18 '24 11:10 simonbjorzen-ts

@clunk0y How you fixed it? I have same problem and diagnostics page shows internal error message.

ahmedxuae91 avatar Dec 11 '24 11:12 ahmedxuae91

@clunk0y How you fixed it? I have same problem and diagnostics page shows internal error message.

Check if the PHP version running on MISP is truly 8.3 by

<?php
phpinfo();
?>

clunk0y avatar Dec 22 '24 13:12 clunk0y