amuehlem / MISP-RPM

RPM packages for MISP
34 stars 15 forks source link

Error: An Internal Error Has Occurred. Please try your action again. If the problem persists, please contact administrator. #98

Closed LintStalker closed 1 month ago

LintStalker commented 2 months ago

I was able to get through all of the instructions, but when I try to browse out to the site, this message is displayed:

Error: An Internal Error Has Occurred. Please try your action again. If the problem persists, please contact administrator.

Keyboard shortcuts for this page: L: Go to event list E: Go to add event page ?: Show this help Could not locate the PGP public key.

There's no mention in the instructions about creating a PGP public key

amuehlem commented 2 months ago

Can you check the logfiles in /var/www/MISP/app/tmp/logs/error.log and /var/log/audit.log? I'm currently debugging a similar error, caused by SELINUX preventing the php-fpm process to connect to mariadb.

amuehlem commented 2 months ago

There was a problem with SELinux and php-fpm. I've updated the RHEL9 package to 2.4.196-2 which includes a new SELinux policy to enable the php74-php-fpm to connect to mariadb.

LintStalker commented 2 months ago

Awesome! I will give it a shot and report back what happens. Thank You!

I'm running RHEL 9. Which step do I need to redo to get the update?

Should I also run all of the steps in the Upgrade section?

LintStalker commented 2 months ago

I tried going through the instructions from the Upgrade section and when running this step:

rpm -e --nodeps MariaDB-server

I get this message:
error: package MariaDB-server is not installed

amuehlem commented 2 months ago

can you run the following command? It will show which mariadb packets are installed on the system

rpm -qa|grep -i mariadb
amuehlem commented 2 months ago

The upgrade section is just for upgrading a fully working MISP instance. The steps for MariaDB are just needed when you want to upgrade to a newer version of MariaDB. As RHEL is offering a 10 year upgrade cycle, there might be new versions of MariaDB available which you might want to upgrade to.

amuehlem commented 2 months ago

I'm running RHEL 9. Which step do I need to redo to get the update?

dnf upgrade misp misp-python-virtualenv

LintStalker commented 2 months ago

rpm -qa|grep -i mariadb

When I run that, these are the results:

mariadb-connector-c-config-3.2.6-1.el9_0.noarch mariadb-connector-c-3.2.6-1.el9_0.x86_64 mariadb-common-10.5.22-1.el9_2.x86_64 mariadb-errmsg-10.5.22-1.el9_2.x86_64 perl-DBD-MariaDB-1.21-16.el9_0.x86_64 mariadb-10.5.22-1.el9_2.x86_64 mariadb-backup-10.5.22-1.el9_2.x86_64 mariadb-gssapi-server-10.5.22-1.el9_2.x86_64 mariadb-server-10.5.22-1.el9_2.x86_64 mariadb-server-utils-10.5.22-1.el9_2.x86_64

amuehlem commented 2 months ago

Ah I see you've installed the mariadb-server from the official distribution repository and not from the MariaDB repository. In this case upper and lowercase take effect. But you should think if you want to upgrade MariaDB in your case or not. When you're fine with the mariadb version provided in the official distribution repository, you don't need to upgrade it. If you want to use a newer version from the official MariaDB repository, then you might want to upgrade it.

LintStalker commented 2 months ago

I deleted the server, and created a new, fresh RHEL 9 server, and then went through the instructions on the RHEL9.md page,

I'm still getting the original message, which is:

Error: An Internal Error Has Occurred. Please try your action again. If the problem persists, please contact administrator.

Keyboard shortcuts for this page: L: Go to event list E: Go to add event page ?: Show this help Could not locate the PGP public key.

There's no mention in the instructions about creating a PGP public key

I looked in the logs here > /var/www/MISP/app/tmp/logs/error.log and this is what is there for today:

2024-09-18 14:50:31 Error: [MissingConnectionException] Database connection "Mysql" is missing, or could not be created. Exception Attributes: array ( 'class' => 'Mysql', 'message' => 'SQLSTATE[HY000] [2002] No such file or directory', 'enabled' => true, ) Request URL: /events/index Stack Trace:

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(3659): ConnectionManager::getDataSource()

3 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(1162): Model->setDataSource()

4 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3686): Model->setSource()

5 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(1394): 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(781): BehaviorCollection->init()

10 /var/www/MISP/app/Model/AppModel.php(114): Model->__construct()

11 /var/www/MISP/app/Model/User.php(251): 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/Controller/AppController.php(125): ClassRegistry::init()

15 /var/www/MISP/app/Controller/EventsController.php(66): AppController->beforeFilter()

16 /var/www/MISP/app/Lib/Tools/BetterCakeEventManager.php(23): EventsController->beforeFilter()

17 /var/www/MISP/app/Lib/cakephp/lib/Cake/Controller/Controller.php(682): BetterCakeEventManager->dispatch()

18 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(189): Controller->startupProcess()

19 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke()

20 /var/www/MISP/app/webroot/index.php(101): Dispatcher->dispatch()

21 {main}

amuehlem commented 1 month ago

Have you configured database access in MISP/app/Config/database.php and is MariaDB running?

LintStalker commented 1 month ago

Have you configured database access in MISP/app/Config/database.php and is MariaDB running?

Are you referring to these instructions:

enable mariadb startup

systemctl enable mariadb.service systemctl start mariadb.service

secure the installation, set a reasonable root password

mariadb-secure-installation

install MISP DB schema

mysql -u root -p [YOUR MYSQL PASSWORD]

replace XXXXXXXXX with a reasonable password for misp

MariaDB [(none)]> create database misp; MariaDB [(none)]> grant usage on . to misp@localhost identified by 'XXXXXXXXX'; MariaDB [(none)]> grant all privileges on misp.* to misp@localhost ; MariaDB [(none)]> exit

cd /var/www/MISP

Import the empty MySQL database from MYSQL.sql

mysql -u misp -p misp < INSTALL/MYSQL.sql

If so, yes, I have done those. Is there something else?

LintStalker commented 1 month ago

MariaDB running?

Hmmmm... apparently not:

systemctl status mariadb.service × mariadb.service - MariaDB 11.4.3 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; preset: disabled) Drop-In: /etc/systemd/system/mariadb.service.d └─migrated-from-my.cnf-settings.conf Active: failed (Result: exit-code) since Wed 2024-09-18 09:32:37 EDT; 1 day 22h ago Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Process: 1138 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=216/GROUP) CPU: 1ms

Sep 18 09:32:37 mispcyber systemd[1]: Starting MariaDB 11.4.3 database server... Sep 18 09:32:37 mispcyber systemd[1]: mariadb.service: Control process exited, code=exited, status=216/GROUP Sep 18 09:32:37 mispcyber systemd[1]: mariadb.service: Failed with result 'exit-code'. Sep 18 09:32:37 mispcyber systemd[1]: Failed to start MariaDB 11.4.3 database server.

LintStalker commented 1 month ago

Have you configured database access in MISP/app/Config/database.php and is MariaDB running?

It seems to be working now! I had mis configured the database.php file.

I still see the message at the bottom that say's that Could not locate the PGP public key, but I am getting a login screen

amuehlem commented 1 month ago

When you see the login screen and can login using the default credentials, the installation was successful.

The GPG Key can be added in the settings section, see the official MISP documentation https://www.circl.lu/doc/misp/ for more details.

LintStalker commented 1 month ago

Thanks! It seems to be working now