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

Fix the errors in the dashboard for the AIO installation #2117

Merged
merged 9 commits into from
Mar 10, 2023

Conversation

verdx
Copy link
Contributor

@verdx verdx commented Mar 7, 2023

Related issue
#2111

Description

This PR aims to fix the errors seen in the dashboard installation when an All-in-one installation is done in a system with less capabilities than the recommended ones. This errors have discovered some issues on the error treatment of the installation.

For now, function passwords_getApiToken now detects one more possible error and retries the Token downloading some number of times.

Testing

Test AIO on machines with minimum requirements(4GB and 2 cores):

🟢 Ubuntu 22
root@ubuntu22:/home/vagrant# bash wazuh-install.sh -a -o
09/03/2023 09:55:52 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 09:55:52 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 09:55:53 INFO: --- Removing existing Wazuh installation ---
09/03/2023 09:55:53 INFO: Removing Wazuh indexer.
09/03/2023 09:55:54 INFO: Wazuh indexer removed.
09/03/2023 09:55:54 INFO: Wazuh GPG key was not found in the system
09/03/2023 09:55:54 INFO: Installation cleaned.
09/03/2023 09:56:04 INFO: Wazuh development repository added.
09/03/2023 09:56:04 INFO: --- Configuration files ---
09/03/2023 09:56:04 INFO: Generating configuration files.
09/03/2023 09:56:06 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 09:56:06 INFO: --- Wazuh indexer ---
09/03/2023 09:56:06 INFO: Starting Wazuh indexer installation.
09/03/2023 09:57:05 INFO: Wazuh indexer installation finished.
09/03/2023 09:57:05 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 09:57:05 INFO: Starting service wazuh-indexer.
09/03/2023 09:58:00 INFO: wazuh-indexer service started.
09/03/2023 09:58:00 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 09:58:11 INFO: Wazuh indexer cluster initialized.
09/03/2023 09:58:11 INFO: --- Wazuh server ---
09/03/2023 09:58:11 INFO: Starting the Wazuh manager installation.
09/03/2023 09:59:39 INFO: Wazuh manager installation finished.
09/03/2023 09:59:39 INFO: Starting service wazuh-manager.
09/03/2023 10:00:01 INFO: wazuh-manager service started.
09/03/2023 10:00:01 INFO: Starting Filebeat installation.
09/03/2023 10:00:27 INFO: Filebeat installation finished.
09/03/2023 10:00:29 INFO: Filebeat post-install configuration finished.
09/03/2023 10:00:29 INFO: Starting service filebeat.
09/03/2023 10:00:31 INFO: filebeat service started.
09/03/2023 10:00:31 INFO: --- Wazuh dashboard ---
09/03/2023 10:00:31 INFO: Starting Wazuh dashboard installation.
09/03/2023 10:02:41 INFO: Wazuh dashboard installation finished.
09/03/2023 10:02:42 INFO: Wazuh dashboard post-install configuration finished.
09/03/2023 10:02:42 INFO: Starting service wazuh-dashboard.
09/03/2023 10:02:45 INFO: wazuh-dashboard service started.
09/03/2023 10:04:00 INFO: Initializing Wazuh dashboard web application.
09/03/2023 10:04:01 INFO: Wazuh dashboard web application initialized.
09/03/2023 10:04:01 INFO: --- Summary ---
09/03/2023 10:04:01 INFO: You can access the web interface https://<wazuh-dashboard-ip>
    User: admin
    Password: TvORe6yP4XyjP5keULCb9EV7Q**QmKTR
09/03/2023 10:04:01 INFO: Installation finished.
🟢 CentOS 8
[root@centos8 vagrant]# bash wazuh-install.sh -a 
09/03/2023 09:50:38 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 09:50:38 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 09:50:43 INFO: Wazuh development repository added.
09/03/2023 09:50:43 INFO: --- Configuration files ---
09/03/2023 09:50:43 INFO: Generating configuration files.
09/03/2023 09:50:45 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 09:50:45 INFO: --- Wazuh indexer ---
09/03/2023 09:50:45 INFO: Starting Wazuh indexer installation.
09/03/2023 09:54:42 INFO: Wazuh indexer installation finished.
09/03/2023 09:54:42 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 09:54:42 INFO: Starting service wazuh-indexer.
09/03/2023 09:55:05 INFO: wazuh-indexer service started.
09/03/2023 09:55:05 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 09:55:16 INFO: Wazuh indexer cluster initialized.
09/03/2023 09:55:16 INFO: --- Wazuh server ---
09/03/2023 09:55:16 INFO: Starting the Wazuh manager installation.
^[[A09/03/2023 09:56:51 INFO: Wazuh manager installation finished.
09/03/2023 09:56:51 INFO: Starting service wazuh-manager.
09/03/2023 09:57:08 INFO: wazuh-manager service started.
09/03/2023 09:57:08 INFO: Starting Filebeat installation.
09/03/2023 09:57:20 INFO: Filebeat installation finished.
09/03/2023 09:57:21 INFO: Filebeat post-install configuration finished.
09/03/2023 09:57:21 INFO: Starting service filebeat.
09/03/2023 09:57:22 INFO: filebeat service started.
09/03/2023 09:57:22 INFO: --- Wazuh dashboard ---
09/03/2023 09:57:22 INFO: Starting Wazuh dashboard installation.
09/03/2023 10:00:15 INFO: Wazuh dashboard installation finished.
09/03/2023 10:00:15 INFO: Wazuh dashboard post-install configuration finished.
09/03/2023 10:00:15 INFO: Starting service wazuh-dashboard.
09/03/2023 10:00:16 INFO: wazuh-dashboard service started.
09/03/2023 10:01:11 INFO: Initializing Wazuh dashboard web application.
09/03/2023 10:01:13 INFO: Wazuh dashboard web application initialized.
09/03/2023 10:01:13 INFO: --- Summary ---
09/03/2023 10:01:13 INFO: You can access the web interface https://<wazuh-dashboard-ip>
    User: admin
    Password: .71?vq5r+OedcR8W6mI3TdLKnJasstCY
09/03/2023 10:01:13 INFO: Installation finished.
🟢 Amazon Linux 2
[root@amazonlinux2 vagrant]# bash wazuh-install.sh -a 
09/03/2023 11:02:55 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 11:02:55 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 11:02:59 INFO: Wazuh development repository added.
09/03/2023 11:02:59 INFO: --- Configuration files ---
09/03/2023 11:02:59 INFO: Generating configuration files.
09/03/2023 11:03:00 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 11:03:00 INFO: --- Wazuh indexer ---
09/03/2023 11:03:00 INFO: Starting Wazuh indexer installation.
09/03/2023 11:05:04 INFO: Wazuh indexer installation finished.
09/03/2023 11:05:04 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 11:05:04 INFO: Starting service wazuh-indexer.
09/03/2023 11:05:21 INFO: wazuh-indexer service started.
09/03/2023 11:05:21 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 11:05:31 INFO: Wazuh indexer cluster initialized.
09/03/2023 11:05:31 INFO: --- Wazuh server ---
09/03/2023 11:05:31 INFO: Starting the Wazuh manager installation.
09/03/2023 11:06:11 INFO: Wazuh manager installation finished.
09/03/2023 11:06:11 INFO: Starting service wazuh-manager.
09/03/2023 11:06:28 INFO: wazuh-manager service started.
09/03/2023 11:06:28 INFO: Starting Filebeat installation.
09/03/2023 11:06:37 INFO: Filebeat installation finished.
09/03/2023 11:06:39 INFO: Filebeat post-install configuration finished.
09/03/2023 11:06:39 INFO: Starting service filebeat.
09/03/2023 11:06:39 INFO: filebeat service started.
09/03/2023 11:06:39 INFO: --- Wazuh dashboard ---
09/03/2023 11:06:39 INFO: Starting Wazuh dashboard installation.
09/03/2023 11:09:28 INFO: Wazuh dashboard installation finished.
09/03/2023 11:09:28 INFO: Wazuh dashboard post-install configuration finished.
09/03/2023 11:09:28 INFO: Starting service wazuh-dashboard.
09/03/2023 11:09:30 INFO: wazuh-dashboard service started.
09/03/2023 11:10:37 INFO: Initializing Wazuh dashboard web application.
09/03/2023 11:10:40 INFO: Wazuh dashboard web application initialized.
09/03/2023 11:10:40 INFO: --- Summary ---
09/03/2023 11:10:40 INFO: You can access the web interface https://<wazuh-dashboard-ip>
    User: admin
    Password: s1VUTEH9*hJgnAW6*2zDshCJA6R.McPD
09/03/2023 11:10:40 INFO: Installation finished.
[root@amazonlinux2 vagrant]# 
🟢 RHEL 9
[root@redhat9 vagrant]# bash wazuh-install.sh -a -i -o
09/03/2023 10:50:12 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 10:50:12 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 10:50:16 INFO: --- Removing existing Wazuh installation ---
09/03/2023 10:50:16 INFO: Removing Wazuh indexer.
09/03/2023 10:50:17 INFO: Wazuh indexer removed.
09/03/2023 10:50:17 INFO: Removing Filebeat.
09/03/2023 10:50:19 INFO: Filebeat removed.
09/03/2023 10:50:19 INFO: Removing Wazuh dashboard.
09/03/2023 10:50:53 INFO: Wazuh dashboard removed.
09/03/2023 10:50:53 INFO: Wazuh GPG key was not found in the system.
09/03/2023 10:50:53 INFO: Installation cleaned.
09/03/2023 10:50:53 WARNING: Hardware and system checks ignored.
09/03/2023 10:50:58 INFO: Wazuh development repository added.
09/03/2023 10:50:58 INFO: --- Configuration files ---
09/03/2023 10:50:58 INFO: Generating configuration files.
09/03/2023 10:51:01 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 10:51:02 INFO: --- Wazuh indexer ---
09/03/2023 10:51:02 INFO: Starting Wazuh indexer installation.
09/03/2023 10:53:12 INFO: Wazuh indexer installation finished.
09/03/2023 10:53:12 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 10:53:12 INFO: Starting service wazuh-indexer.
09/03/2023 10:53:33 INFO: wazuh-indexer service started.
09/03/2023 10:53:33 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 10:53:44 INFO: Wazuh indexer cluster initialized.
09/03/2023 10:53:44 INFO: --- Wazuh server ---
09/03/2023 10:53:44 INFO: Starting the Wazuh manager installation.
09/03/2023 10:55:12 INFO: Wazuh manager installation finished.
09/03/2023 10:55:12 INFO: Starting service wazuh-manager.
09/03/2023 10:55:29 INFO: wazuh-manager service started.
09/03/2023 10:55:29 INFO: Starting Filebeat installation.
09/03/2023 10:55:50 INFO: Filebeat installation finished.
09/03/2023 10:55:54 INFO: Filebeat post-install configuration finished.
09/03/2023 10:55:54 INFO: Starting service filebeat.
09/03/2023 10:55:55 INFO: filebeat service started.
09/03/2023 10:55:55 INFO: --- Wazuh dashboard ---
09/03/2023 10:55:55 INFO: Starting Wazuh dashboard installation.
09/03/2023 10:59:03 INFO: Wazuh dashboard installation finished.
09/03/2023 10:59:04 INFO: Wazuh dashboard post-install configuration finished.
09/03/2023 10:59:04 INFO: Starting service wazuh-dashboard.
09/03/2023 10:59:04 INFO: wazuh-dashboard service started.
09/03/2023 11:00:21 INFO: Initializing Wazuh dashboard web application.
09/03/2023 11:00:22 INFO: Wazuh dashboard web application initialized.
09/03/2023 11:00:22 INFO: --- Summary ---
09/03/2023 11:00:22 INFO: You can access the web interface https://<wazuh-dashboard-ip>
    User: admin
    Password: LyBBS*4HL2LvRFw7dV2gouZSy5UsjwQT
09/03/2023 11:00:22 INFO: Installation finished.
[root@redhat9 vagrant]# 

Test AIO on machines with limited resources (2GB and 1 cores):

🟡 CentOS 9 Stream Details of the error in commentary https://github.com//pull/2117#issuecomment-1462220195
🟢 Amazon Linux 2

Solved a problem as explained in #2117 (comment)

[root@amazonlinux2 vagrant]# bash wazuh-install.sh -a -i
09/03/2023 14:37:42 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 14:37:42 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 14:37:44 WARNING: Hardware and system checks ignored.
09/03/2023 14:37:46 INFO: Wazuh development repository added.
09/03/2023 14:37:46 INFO: --- Configuration files ---
09/03/2023 14:37:46 INFO: Generating configuration files.
09/03/2023 14:37:48 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 14:37:48 INFO: --- Wazuh indexer ---
09/03/2023 14:37:48 INFO: Starting Wazuh indexer installation.
09/03/2023 14:39:29 INFO: Wazuh indexer installation finished.
09/03/2023 14:39:29 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 14:39:29 INFO: Starting service wazuh-indexer.
09/03/2023 14:40:13 INFO: wazuh-indexer service started.
09/03/2023 14:40:13 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 14:40:25 INFO: Wazuh indexer cluster initialized.
09/03/2023 14:40:25 INFO: --- Wazuh server ---
09/03/2023 14:40:25 INFO: Starting the Wazuh manager installation.
09/03/2023 14:41:06 INFO: Wazuh manager installation finished.
09/03/2023 14:41:06 INFO: Starting service wazuh-manager.
09/03/2023 14:41:26 INFO: wazuh-manager service started.
09/03/2023 14:41:26 INFO: Starting Filebeat installation.
09/03/2023 14:41:38 INFO: Filebeat installation finished.
09/03/2023 14:41:40 INFO: Filebeat post-install configuration finished.
09/03/2023 14:41:40 INFO: Starting service filebeat.
09/03/2023 14:41:40 INFO: filebeat service started.
09/03/2023 14:41:40 INFO: --- Wazuh dashboard ---
09/03/2023 14:41:40 INFO: Starting Wazuh dashboard installation.
09/03/2023 14:44:35 INFO: Wazuh dashboard installation finished.
09/03/2023 14:44:35 INFO: Wazuh dashboard post-install configuration finished.
09/03/2023 14:44:35 INFO: Starting service wazuh-dashboard.
09/03/2023 14:44:35 INFO: wazuh-dashboard service started.
09/03/2023 14:45:43 INFO: Initializing Wazuh dashboard web application.
09/03/2023 14:45:43 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 14:45:59 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 14:46:14 INFO: Wazuh dashboard web application initialized.
09/03/2023 14:46:14 INFO: --- Summary ---
09/03/2023 14:46:14 INFO: You can access the web interface https://<wazuh-dashboard-ip>
    User: admin
    Password: P*kH3at7bsRJh+DGV6P0dQyEMBs1vtjp
09/03/2023 14:46:14 INFO: Installation finished.
[root@amazonlinux2 vagrant]# 
🟢 CentOS 7
[root@centos7 vagrant]# bash wazuh-install.sh -a -i
09/03/2023 11:18:39 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 11:18:39 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 11:18:42 WARNING: Hardware and system checks ignored.
09/03/2023 11:18:49 INFO: Wazuh development repository added.
09/03/2023 11:18:49 INFO: --- Configuration files ---
09/03/2023 11:18:49 INFO: Generating configuration files.
09/03/2023 11:18:51 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 11:18:51 INFO: --- Wazuh indexer ---
09/03/2023 11:18:51 INFO: Starting Wazuh indexer installation.
09/03/2023 11:26:30 INFO: Wazuh indexer installation finished.
09/03/2023 11:26:30 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 11:26:30 INFO: Starting service wazuh-indexer.
09/03/2023 11:27:02 INFO: wazuh-indexer service started.
09/03/2023 11:27:02 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 11:27:13 INFO: Wazuh indexer cluster initialized.
09/03/2023 11:27:13 INFO: --- Wazuh server ---
09/03/2023 11:27:13 INFO: Starting the Wazuh manager installation.
09/03/2023 11:28:21 INFO: Wazuh manager installation finished.
09/03/2023 11:28:21 INFO: Starting service wazuh-manager.
09/03/2023 11:28:40 INFO: wazuh-manager service started.
09/03/2023 11:28:40 INFO: Starting Filebeat installation.
09/03/2023 11:29:00 INFO: Filebeat installation finished.
09/03/2023 11:29:02 INFO: Filebeat post-install configuration finished.
09/03/2023 11:29:02 INFO: Starting service filebeat.
09/03/2023 11:29:02 INFO: filebeat service started.
09/03/2023 11:29:02 INFO: --- Wazuh dashboard ---
09/03/2023 11:29:02 INFO: Starting Wazuh dashboard installation.
09/03/2023 11:31:33 INFO: Wazuh dashboard installation finished.
09/03/2023 11:31:33 INFO: Wazuh dashboard post-install configuration finished.
09/03/2023 11:31:33 INFO: Starting service wazuh-dashboard.
09/03/2023 11:31:33 INFO: wazuh-dashboard service started.
09/03/2023 11:32:34 INFO: Initializing Wazuh dashboard web application.
09/03/2023 11:32:36 INFO: Wazuh dashboard web application initialized.
09/03/2023 11:32:36 INFO: --- Summary ---
09/03/2023 11:32:36 INFO: You can access the web interface https://<wazuh-dashboard-ip>
    User: admin
    Password: HR9f4HiUd3QKFYf3*ZJR.nyU2kBG+H5+
09/03/2023 11:32:36 INFO: Installation finished.
[root@centos7 vagrant]# 
🟢 RHEL 7
[root@redhat7 vagrant]# bash wazuh-install.sh -a
09/03/2023 12:00:49 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 12:00:50 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 12:01:14 INFO: Wazuh development repository added.
09/03/2023 12:01:14 INFO: --- Configuration files ---
09/03/2023 12:01:14 INFO: Generating configuration files.
09/03/2023 12:01:17 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 12:01:17 INFO: --- Wazuh indexer ---
09/03/2023 12:01:17 INFO: Starting Wazuh indexer installation.
09/03/2023 12:03:50 INFO: Wazuh indexer installation finished.
09/03/2023 12:03:50 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 12:03:50 INFO: Starting service wazuh-indexer.
09/03/2023 12:04:10 INFO: wazuh-indexer service started.
09/03/2023 12:04:10 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 12:04:21 INFO: Wazuh indexer cluster initialized.
09/03/2023 12:04:21 INFO: --- Wazuh server ---
09/03/2023 12:04:21 INFO: Starting the Wazuh manager installation.
09/03/2023 12:05:48 INFO: Wazuh manager installation finished.
09/03/2023 12:05:48 INFO: Starting service wazuh-manager.
09/03/2023 12:06:06 INFO: wazuh-manager service started.
09/03/2023 12:06:06 INFO: Starting Filebeat installation.
09/03/2023 12:06:21 INFO: Filebeat installation finished.
09/03/2023 12:06:22 INFO: Filebeat post-install configuration finished.
09/03/2023 12:06:22 INFO: Starting service filebeat.
09/03/2023 12:06:23 INFO: filebeat service started.
09/03/2023 12:06:23 INFO: --- Wazuh dashboard ---
09/03/2023 12:06:23 INFO: Starting Wazuh dashboard installation.
09/03/2023 12:09:38 INFO: Wazuh dashboard installation finished.
09/03/2023 12:09:38 INFO: Wazuh dashboard post-install configuration finished.
09/03/2023 12:09:38 INFO: Starting service wazuh-dashboard.
09/03/2023 12:09:40 INFO: wazuh-dashboard service started.
09/03/2023 12:10:51 INFO: Initializing Wazuh dashboard web application.
09/03/2023 12:10:53 INFO: Wazuh dashboard web application initialized.
09/03/2023 12:10:53 INFO: --- Summary ---
09/03/2023 12:10:53 INFO: You can access the web interface https://<wazuh-dashboard-ip>
    User: admin
    Password: 7QNp?aF4+JYqwoof6CqwXC9H9ovog*??
09/03/2023 12:10:53 INFO: Installation finished.
🟡 Ubuntu18LTS

A first installation has failed with an error starting the wazuh-manager, very probably on account of a memory shortage

root@ubuntu18:/home/vagrant# bash wazuh-install.sh -a -i
09/03/2023 12:18:33 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 12:18:33 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 12:18:35 WARNING: Hardware and system checks ignored.
09/03/2023 12:18:54 INFO: --- Dependencies ----
09/03/2023 12:18:54 INFO: Installing apt-transport-https.
09/03/2023 12:19:09 INFO: Wazuh development repository added.
09/03/2023 12:19:09 INFO: --- Configuration files ---
09/03/2023 12:19:09 INFO: Generating configuration files.
09/03/2023 12:19:11 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 12:19:11 INFO: --- Wazuh indexer ---
09/03/2023 12:19:11 INFO: Starting Wazuh indexer installation.
09/03/2023 12:23:03 INFO: Wazuh indexer installation finished.
09/03/2023 12:23:04 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 12:23:04 INFO: Starting service wazuh-indexer.
09/03/2023 12:26:33 INFO: wazuh-indexer service started.
09/03/2023 12:26:34 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 12:27:47 INFO: Wazuh indexer cluster initialized.
09/03/2023 12:27:47 INFO: --- Wazuh server ---
09/03/2023 12:27:47 INFO: Starting the Wazuh manager installation.
09/03/2023 12:32:02 INFO: Wazuh manager installation finished.
09/03/2023 12:32:02 INFO: Starting service wazuh-manager.
09/03/2023 12:33:37 ERROR: wazuh-manager could not be started.
09/03/2023 12:33:37 INFO: --- Removing existing Wazuh installation ---
09/03/2023 12:33:37 INFO: Removing Wazuh manager.
09/03/2023 12:39:43 INFO: Wazuh manager removed.
09/03/2023 12:39:43 INFO: Removing Wazuh indexer.
09/03/2023 12:40:17 INFO: Wazuh indexer removed.
09/03/2023 12:40:17 INFO: Removing Wazuh indexer.
09/03/2023 12:40:18 INFO: Wazuh indexer removed.
09/03/2023 12:40:18 INFO: Installation cleaned. Check the /var/log/wazuh-install.log file to learn more about the issue.
root@ubuntu18:/home/vagrant# 

After some more installations have been done, it can be said when the manager starts, there is no problem with the API or dashboard, and so the changes in this PR work correctly.

root@ubuntu18:/home/vagrant# bash wazuh-install.sh -a -i -o
09/03/2023 15:27:41 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 15:27:41 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 15:27:49 INFO: --- Removing existing Wazuh installation ---
09/03/2023 15:27:49 INFO: Removing Wazuh manager.
09/03/2023 15:28:05 INFO: Wazuh manager removed.
09/03/2023 15:28:05 INFO: Removing Wazuh indexer.
09/03/2023 15:28:13 INFO: Wazuh indexer removed.
09/03/2023 15:28:13 INFO: Removing Wazuh indexer.
09/03/2023 15:28:14 INFO: Wazuh indexer removed.
09/03/2023 15:28:14 INFO: Removing Filebeat.
09/03/2023 15:28:19 INFO: Filebeat removed.
09/03/2023 15:28:19 INFO: Removing Wazuh dashboard.
09/03/2023 15:28:32 INFO: Wazuh dashboard removed.
09/03/2023 15:28:32 INFO: Installation cleaned.
09/03/2023 15:28:32 WARNING: Hardware and system checks ignored.
09/03/2023 15:28:49 INFO: Wazuh development repository added.
09/03/2023 15:28:49 INFO: --- Configuration files ---
09/03/2023 15:28:49 INFO: Generating configuration files.
09/03/2023 15:28:51 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 15:28:51 INFO: --- Wazuh indexer ---
09/03/2023 15:28:52 INFO: Starting Wazuh indexer installation.
09/03/2023 15:30:04 INFO: Wazuh indexer installation finished.
09/03/2023 15:30:04 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 15:30:04 INFO: Starting service wazuh-indexer.
09/03/2023 15:30:48 INFO: wazuh-indexer service started.
09/03/2023 15:30:48 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 15:31:03 INFO: Wazuh indexer cluster initialized.
09/03/2023 15:31:03 INFO: --- Wazuh server ---
09/03/2023 15:31:03 INFO: Starting the Wazuh manager installation.
09/03/2023 15:32:23 INFO: Wazuh manager installation finished.
09/03/2023 15:32:23 INFO: Starting service wazuh-manager.
09/03/2023 15:32:47 INFO: wazuh-manager service started.
09/03/2023 15:32:47 INFO: Starting Filebeat installation.
09/03/2023 15:33:08 INFO: Filebeat installation finished.
09/03/2023 15:33:11 INFO: Filebeat post-install configuration finished.
09/03/2023 15:33:11 INFO: Starting service filebeat.
09/03/2023 15:33:13 INFO: filebeat service started.
09/03/2023 15:33:13 INFO: --- Wazuh dashboard ---
09/03/2023 15:33:13 INFO: Starting Wazuh dashboard installation.
09/03/2023 15:34:59 INFO: Wazuh dashboard installation finished.
09/03/2023 15:34:59 INFO: Wazuh dashboard post-install configuration finished.
09/03/2023 15:34:59 INFO: Starting service wazuh-dashboard.
09/03/2023 15:35:00 INFO: wazuh-dashboard service started.
09/03/2023 15:36:13 INFO: Initializing Wazuh dashboard web application.
09/03/2023 15:36:14 INFO: Wazuh dashboard web application initialized.
09/03/2023 15:36:14 INFO: --- Summary ---
09/03/2023 15:36:14 INFO: You can access the web interface https://<wazuh-dashboard-ip>
    User: admin
    Password: xpcLuyRLkRMOYO*I10SqQ?W55IzRT+aD
09/03/2023 15:36:14 INFO: Installation finished.
root@ubuntu18:/home/vagrant# 

A final test using a machine with only 1GB also finishes successfully:

root@ubuntu18:/home/vagrant# bash wazuh-install.sh -a -i
09/03/2023 15:47:54 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 15:47:54 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 15:47:56 WARNING: Hardware and system checks ignored.
09/03/2023 15:48:20 INFO: --- Dependencies ----
09/03/2023 15:48:20 INFO: Installing apt-transport-https.
09/03/2023 15:48:33 INFO: Wazuh development repository added.
09/03/2023 15:48:33 INFO: --- Configuration files ---
09/03/2023 15:48:33 INFO: Generating configuration files.
09/03/2023 15:48:35 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 15:48:35 INFO: --- Wazuh indexer ---
09/03/2023 15:48:35 INFO: Starting Wazuh indexer installation.
09/03/2023 15:50:12 INFO: Wazuh indexer installation finished.
09/03/2023 15:50:12 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 15:50:12 INFO: Starting service wazuh-indexer.
09/03/2023 15:50:57 INFO: wazuh-indexer service started.
09/03/2023 15:50:57 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 15:51:13 INFO: Wazuh indexer cluster initialized.
09/03/2023 15:51:13 INFO: --- Wazuh server ---
09/03/2023 15:51:13 INFO: Starting the Wazuh manager installation.
09/03/2023 15:52:41 INFO: Wazuh manager installation finished.
09/03/2023 15:52:41 INFO: Starting service wazuh-manager.
09/03/2023 15:53:07 INFO: wazuh-manager service started.
09/03/2023 15:53:07 INFO: Starting Filebeat installation.
09/03/2023 15:53:39 INFO: Filebeat installation finished.
09/03/2023 15:53:44 INFO: Filebeat post-install configuration finished.
09/03/2023 15:53:44 INFO: Starting service filebeat.
09/03/2023 15:53:46 INFO: filebeat service started.
09/03/2023 15:53:46 INFO: --- Wazuh dashboard ---
09/03/2023 15:53:46 INFO: Starting Wazuh dashboard installation.
09/03/2023 15:55:50 INFO: Wazuh dashboard installation finished.
09/03/2023 15:55:50 INFO: Wazuh dashboard post-install configuration finished.
09/03/2023 15:55:50 INFO: Starting service wazuh-dashboard.
09/03/2023 15:55:50 INFO: wazuh-dashboard service started.
09/03/2023 15:57:13 INFO: Initializing Wazuh dashboard web application.
09/03/2023 15:57:15 INFO: Wazuh dashboard web application initialized.
09/03/2023 15:57:15 INFO: --- Summary ---
09/03/2023 15:57:15 INFO: You can access the web interface https://<wazuh-dashboard-ip>
    User: admin
    Password: HB3L+ag8KlVX.S6OtOnzRbbmoqb72F5c
09/03/2023 15:57:15 INFO: Installation finished.

@verdx verdx self-assigned this Mar 7, 2023
Signed-off-by: Miguel Verdaguer Velázquez <[email protected]>
Signed-off-by: Miguel Verdaguer Velázquez <[email protected]>
@verdx verdx marked this pull request as draft March 7, 2023 14:29
…ct help commentary for argument --development

Signed-off-by: Miguel Verdaguer Velázquez <[email protected]>
Signed-off-by: Miguel Verdaguer Velázquez <[email protected]>
Signed-off-by: Miguel Verdaguer Velázquez <[email protected]>
@verdx
Copy link
Contributor Author

verdx commented Mar 9, 2023

Test failed for Amazon Linux 2, 2GB 1 CPU core

While testing an AIO installation on an Amazon Linux 2 machine with 2GB of ram and 1 cpu core, an error has been seen:

[root@amazonlinux2 vagrant]# bash wazuh-install.sh -a -i
09/03/2023 11:38:21 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 11:38:21 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 11:38:22 WARNING: Hardware and system checks ignored.
09/03/2023 11:38:25 INFO: Wazuh development repository added.
09/03/2023 11:38:25 INFO: --- Configuration files ---
09/03/2023 11:38:25 INFO: Generating configuration files.
09/03/2023 11:38:26 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 11:38:26 INFO: --- Wazuh indexer ---
09/03/2023 11:38:26 INFO: Starting Wazuh indexer installation.
09/03/2023 11:40:35 INFO: Wazuh indexer installation finished.
09/03/2023 11:40:35 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 11:40:35 INFO: Starting service wazuh-indexer.
09/03/2023 11:41:28 INFO: wazuh-indexer service started.
09/03/2023 11:41:28 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 11:41:38 INFO: Wazuh indexer cluster initialized.
09/03/2023 11:41:38 INFO: --- Wazuh server ---
09/03/2023 11:41:38 INFO: Starting the Wazuh manager installation.
09/03/2023 11:43:48 INFO: Wazuh manager installation finished.
09/03/2023 11:43:48 INFO: Starting service wazuh-manager.
09/03/2023 11:44:19 INFO: wazuh-manager service started.
09/03/2023 11:44:19 INFO: Starting Filebeat installation.
09/03/2023 11:45:04 INFO: Filebeat installation finished.
09/03/2023 11:45:39 INFO: Filebeat post-install configuration finished.
09/03/2023 11:45:39 INFO: Starting service filebeat.
09/03/2023 11:45:44 INFO: filebeat service started.
09/03/2023 11:45:44 INFO: --- Wazuh dashboard ---
09/03/2023 11:45:44 INFO: Starting Wazuh dashboard installation.
09/03/2023 11:53:00 INFO: Wazuh dashboard installation finished.
09/03/2023 11:53:01 INFO: Wazuh dashboard post-install configuration finished.
09/03/2023 11:53:01 INFO: Starting service wazuh-dashboard.
09/03/2023 11:53:05 INFO: wazuh-dashboard service started.
09/03/2023 11:59:22 INFO: Initializing Wazuh dashboard web application.
09/03/2023 11:59:22 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 11:59:23 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 11:59:24 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 11:59:25 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 11:59:26 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 11:59:27 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 11:59:28 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 11:59:29 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 11:59:30 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 11:59:31 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 11:59:32 ERROR: Wazuh dashboard installation failed.
09/03/2023 11:59:32 INFO: --- Removing existing Wazuh installation ---
09/03/2023 11:59:32 INFO: Removing Wazuh manager.
09/03/2023 12:02:53 INFO: Wazuh manager removed.
09/03/2023 12:02:53 INFO: Removing Wazuh indexer.
09/03/2023 12:03:19 INFO: Wazuh indexer removed.
09/03/2023 12:03:19 INFO: Removing Wazuh indexer.
09/03/2023 12:03:19 INFO: Wazuh indexer removed.
09/03/2023 12:03:19 INFO: Removing Filebeat.
09/03/2023 12:03:20 INFO: Filebeat removed.
09/03/2023 12:03:21 INFO: Removing Wazuh dashboard.
09/03/2023 12:04:12 INFO: Wazuh dashboard removed.
09/03/2023 12:04:13 INFO: Installation cleaned. Check the /var/log/wazuh-install.log file to learn more about the issue.
[root@amazonlinux2 vagrant]# 

The installation failed, but the retries of dashboard were called correctly.

By stopping the installation after the last retry, it has been proven the wait done in the retries is not enough at all, as, after waiting a couple of minutes, the dashboard is initialized.

Solution

After increasing the time between retries and the number of retries, the problem has been solved.

@verdx
Copy link
Contributor Author

verdx commented Mar 9, 2023

Test failed for CentOS 9 Stream, 2GB 1 CPU core

A first try failed because of an error in the Wazuh indexer installation:

[root@centos9stream vagrant]# bash wazuh-install.sh -a -i
09/03/2023 11:14:37 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 11:14:37 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 11:14:40 WARNING: Hardware and system checks ignored.
09/03/2023 11:14:44 INFO: Wazuh development repository added.
09/03/2023 11:14:44 INFO: --- Configuration files ---
09/03/2023 11:14:44 INFO: Generating configuration files.
09/03/2023 11:14:46 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 11:14:46 INFO: --- Wazuh indexer ---
09/03/2023 11:14:46 INFO: Starting Wazuh indexer installation.
09/03/2023 11:29:24 ERROR: Wazuh indexer installation failed.
09/03/2023 11:29:24 INFO: --- Removing existing Wazuh installation ---
09/03/2023 11:29:24 INFO: Installation cleaned. Check the /var/log/wazuh-install.log file to learn more about the issue.

A second installation also failed, this time, because of the API, although it seems the changes of this PR worked correctly and the problem didn't come from the token download.

[root@centos9stream vagrant]# bash wazuh-install.sh -a -i
09/03/2023 11:33:37 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 11:33:37 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 11:33:39 WARNING: Hardware and system checks ignored.
09/03/2023 11:33:43 INFO: Wazuh development repository added.
09/03/2023 11:33:43 INFO: --- Configuration files ---
09/03/2023 11:33:43 INFO: Generating configuration files.
09/03/2023 11:33:45 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 11:33:45 INFO: --- Wazuh indexer ---
09/03/2023 11:33:45 INFO: Starting Wazuh indexer installation.
09/03/2023 11:35:58 INFO: Wazuh indexer installation finished.
09/03/2023 11:35:58 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 11:35:58 INFO: Starting service wazuh-indexer.
09/03/2023 11:36:39 INFO: wazuh-indexer service started.
09/03/2023 11:36:39 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 11:37:03 INFO: Wazuh indexer cluster initialized.
09/03/2023 11:37:03 INFO: --- Wazuh server ---
09/03/2023 11:37:03 INFO: Starting the Wazuh manager installation.
09/03/2023 11:38:34 INFO: Wazuh manager installation finished.
09/03/2023 11:38:34 INFO: Starting service wazuh-manager.
09/03/2023 11:39:00 INFO: wazuh-manager service started.
09/03/2023 11:39:00 INFO: Starting Filebeat installation.
09/03/2023 11:40:32 INFO: Filebeat installation finished.
09/03/2023 11:40:38 INFO: Filebeat post-install configuration finished.
09/03/2023 11:40:38 INFO: Starting service filebeat.
09/03/2023 11:40:39 INFO: filebeat service started.
09/03/2023 11:40:39 INFO: --- Wazuh dashboard ---
09/03/2023 11:40:39 INFO: Starting Wazuh dashboard installation.
09/03/2023 11:48:05 INFO: Wazuh dashboard installation finished.
09/03/2023 11:48:06 INFO: Wazuh dashboard post-install configuration finished.
09/03/2023 11:48:06 INFO: Starting service wazuh-dashboard.
09/03/2023 11:48:07 INFO: wazuh-dashboard service started.
09/03/2023 11:50:34 INFO: There was an error accessing the API. Retrying...
09/03/2023 11:51:06 INFO: There was an error accessing the API. Retrying...
09/03/2023 11:51:42 ERROR: The Wazuh API user wazuh does not exist
09/03/2023 11:51:42 ERROR: The Wazuh API user wazuh-wui does not exist
09/03/2023 11:53:17 ERROR: User  is not registered in Wazuh API
09/03/2023 11:53:17 INFO: --- Removing existing Wazuh installation ---
09/03/2023 11:53:17 INFO: Removing Wazuh manager.
09/03/2023 11:57:45 INFO: Wazuh manager removed.
09/03/2023 11:57:45 INFO: Removing Wazuh indexer.
09/03/2023 11:58:15 INFO: Wazuh indexer removed.
09/03/2023 11:58:15 INFO: Removing Wazuh indexer.
09/03/2023 11:58:16 INFO: Wazuh indexer removed.
09/03/2023 11:58:16 INFO: Removing Filebeat.
09/03/2023 11:58:20 INFO: Filebeat removed.
09/03/2023 11:58:20 INFO: Removing Wazuh dashboard.
09/03/2023 12:01:24 INFO: Wazuh dashboard removed.
09/03/2023 12:01:25 INFO: Installation cleaned. Check the /var/log/wazuh-install.log file to learn more about the issue.
[root@centos9stream vagrant]# 

A third installation has replicated the second error, this time with more debugging:

[root@centos9stream vagrant]# bash wazuh-install.sh -a -i -o
09/03/2023 12:18:21 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 12:18:21 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 12:18:24 INFO: --- Removing existing Wazuh installation ---
09/03/2023 12:18:24 INFO: Removing Wazuh indexer.
09/03/2023 12:18:24 INFO: Wazuh indexer removed.
09/03/2023 12:18:24 INFO: Wazuh GPG key was not found in the system.
09/03/2023 12:18:24 INFO: Installation cleaned.
09/03/2023 12:18:24 WARNING: Hardware and system checks ignored.
09/03/2023 12:18:28 INFO: Wazuh development repository added.
09/03/2023 12:18:28 INFO: --- Configuration files ---
09/03/2023 12:18:28 INFO: Generating configuration files.
09/03/2023 12:18:32 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 12:18:32 INFO: --- Wazuh indexer ---
09/03/2023 12:18:32 INFO: Starting Wazuh indexer installation.
09/03/2023 12:22:55 INFO: Wazuh indexer installation finished.
09/03/2023 12:22:55 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 12:22:55 INFO: Starting service wazuh-indexer.
09/03/2023 12:24:06 INFO: wazuh-indexer service started.
09/03/2023 12:24:06 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 12:24:36 INFO: Wazuh indexer cluster initialized.
09/03/2023 12:24:36 INFO: --- Wazuh server ---
09/03/2023 12:24:36 INFO: Starting the Wazuh manager installation.
09/03/2023 12:28:53 INFO: Wazuh manager installation finished.
09/03/2023 12:28:54 INFO: Starting service wazuh-manager.
09/03/2023 12:30:14 INFO: wazuh-manager service started.
09/03/2023 12:30:14 INFO: Starting Filebeat installation.
09/03/2023 12:32:46 INFO: Filebeat installation finished.
09/03/2023 12:32:53 INFO: Filebeat post-install configuration finished.
09/03/2023 12:32:53 INFO: Starting service filebeat.
09/03/2023 12:32:55 INFO: filebeat service started.
09/03/2023 12:32:55 INFO: --- Wazuh dashboard ---
09/03/2023 12:32:56 INFO: Starting Wazuh dashboard installation.
09/03/2023 12:40:48 INFO: Wazuh dashboard installation finished.
09/03/2023 12:40:48 INFO: Wazuh dashboard post-install configuration finished.
09/03/2023 12:40:48 INFO: Starting service wazuh-dashboard.
09/03/2023 12:40:49 INFO: wazuh-dashboard service started.
++ curl -s -u wazuh:wazuh -k -X POST 'https://localhost:55000/security/user/authenticate?raw=true' --max-time 300 --retry 5 --retry-delay 5
+ TOKEN_API='{"title": "Wazuh Internal Error", "detail": "Timeout executing API request", "dapi_errors": {"node01": {"error": "Timeout executing API request", "logfile": "WAZUH_HOME/logs/api.log"}}, "error": 3021}
{"title": "Wazuh Internal Error", "detail": "Timeout executing API request", "dapi_errors": {"node01": {"error": "Timeout executing API request", "logfile": "WAZUH_HOME/logs/api.log"}}, "error": 3021}
{"title": "Wazuh Internal Error", "detail": "Timeout executing API request", "dapi_errors": {"node01": {"error": "Timeout executing API request", "logfile": "WAZUH_HOME/logs/api.log"}}, "error": 3021}
{"title": "Wazuh Internal Error", "detail": "Timeout executing API request", "dapi_errors": {"node01": {"error": "Timeout executing API request", "logfile": "WAZUH_HOME/logs/api.log"}}, "error": 3021}
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNjc4MzY1NzUxLCJleHAiOjE2NzgzNjY2NTEsInN1YiI6IndhenVoIiwicnVuX2FzIjpmYWxzZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSJ9.AW9QnjwWDpFA1awujBrGw6n39WAWC2a6FDjMNY6Ef6aoN-8mhnH88cDqXkCq4Wu0QY0vlcaHoheUMN11XG2InX9KACZImz_d2TqBIJ9d9kTZz_hEhW7luuLUy7WWZ0gjRFgRQOMueqLOqYFjXnrew0tDAsSQVAUz-ysC86DkdVXnrcpz'
+ [[ {"title": "Wazuh Internal Error", "detail": "Timeout executing API request", "dapi_errors": {"node01": {"error": "Timeout executing API request", "logfile": "WAZUH_HOME/logs/api.log"}}, "error": 3021}
{"title": "Wazuh Internal Error", "detail": "Timeout executing API request", "dapi_errors": {"node01": {"error": "Timeout executing API request", "logfile": "WAZUH_HOME/logs/api.log"}}, "error": 3021}
{"title": "Wazuh Internal Error", "detail": "Timeout executing API request", "dapi_errors": {"node01": {"error": "Timeout executing API request", "logfile": "WAZUH_HOME/logs/api.log"}}, "error": 3021}
{"title": "Wazuh Internal Error", "detail": "Timeout executing API request", "dapi_errors": {"node01": {"error": "Timeout executing API request", "logfile": "WAZUH_HOME/logs/api.log"}}, "error": 3021}
eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNjc4MzY1NzUxLCJleHAiOjE2NzgzNjY2NTEsInN1YiI6IndhenVoIiwicnVuX2FzIjpmYWxzZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSJ9.AW9QnjwWDpFA1awujBrGw6n39WAWC2a6FDjMNY6Ef6aoN-8mhnH88cDqXkCq4Wu0QY0vlcaHoheUMN11XG2InX9KACZImz_d2TqBIJ9d9kTZz_hEhW7luuLUy7WWZ0gjRFgRQOMueqLOqYFjXnrew0tDAsSQVAUz-ysC86DkdVXnrcpz =~ Wazuh Internal Error ]]
+ '[' 0 -lt 10 ']'
+ common_logger 'There was an error accessing the API. Retrying...'
+ x_set=x
+ [[ -n x ]]
+ set +x
09/03/2023 12:42:36 INFO: There was an error accessing the API. Retrying...
++ curl -s -u wazuh:wazuh -k -X POST 'https://localhost:55000/security/user/authenticate?raw=true' --max-time 300 --retry 5 --retry-delay 5
+ TOKEN_API=eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNjc4MzY1NzU3LCJleHAiOjE2NzgzNjY2NTcsInN1YiI6IndhenVoIiwicnVuX2FzIjpmYWxzZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSJ9.AfIHlCSmUXCt-gIPpbnv-UTfn2xiBFW-uHL8XSkNnQkns48n5kVHwewPTjFvUsbI2V3BQeUr7wkIyvmad6dA0oi9AEY8b2b5NAHOm_3KYSv9jZm0sOARJ7rA8lrc1rdpUEY1nwrBD9YFXDsH4nIkidps4gUMnpbwbrS6_RsdmN1pCtSv
+ retries=1
+ sleep 1
+ [[ eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNjc4MzY1NzU3LCJleHAiOjE2NzgzNjY2NTcsInN1YiI6IndhenVoIiwicnVuX2FzIjpmYWxzZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSJ9.AfIHlCSmUXCt-gIPpbnv-UTfn2xiBFW-uHL8XSkNnQkns48n5kVHwewPTjFvUsbI2V3BQeUr7wkIyvmad6dA0oi9AEY8b2b5NAHOm_3KYSv9jZm0sOARJ7rA8lrc1rdpUEY1nwrBD9YFXDsH4nIkidps4gUMnpbwbrS6_RsdmN1pCtSv =~ Wazuh Internal Error ]]
+ [[ eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNjc4MzY1NzU3LCJleHAiOjE2NzgzNjY2NTcsInN1YiI6IndhenVoIiwicnVuX2FzIjpmYWxzZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSJ9.AfIHlCSmUXCt-gIPpbnv-UTfn2xiBFW-uHL8XSkNnQkns48n5kVHwewPTjFvUsbI2V3BQeUr7wkIyvmad6dA0oi9AEY8b2b5NAHOm_3KYSv9jZm0sOARJ7rA8lrc1rdpUEY1nwrBD9YFXDsH4nIkidps4gUMnpbwbrS6_RsdmN1pCtSv =~ Wazuh Internal Error ]]
+ [[ eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YXp1aCIsImF1ZCI6IldhenVoIEFQSSBSRVNUIiwibmJmIjoxNjc4MzY1NzU3LCJleHAiOjE2NzgzNjY2NTcsInN1YiI6IndhenVoIiwicnVuX2FzIjpmYWxzZSwicmJhY19yb2xlcyI6WzFdLCJyYmFjX21vZGUiOiJ3aGl0ZSJ9.AfIHlCSmUXCt-gIPpbnv-UTfn2xiBFW-uHL8XSkNnQkns48n5kVHwewPTjFvUsbI2V3BQeUr7wkIyvmad6dA0oi9AEY8b2b5NAHOm_3KYSv9jZm0sOARJ7rA8lrc1rdpUEY1nwrBD9YFXDsH4nIkidps4gUMnpbwbrS6_RsdmN1pCtSv =~ Invalid credentials ]]
+ set +x
09/03/2023 12:43:01 ERROR: The Wazuh API user wazuh does not exist
09/03/2023 12:43:01 ERROR: The Wazuh API user wazuh-wui does not exist
+ user_id=noid
+ '[' noid == noid ']'
+ common_logger -e 'User  is not registered in Wazuh API'
+ x_set=x
+ [[ -n x ]]
+ set +x
09/03/2023 12:46:15 ERROR: User  is not registered in Wazuh API
++ type -t installCommon_rollBack
+ [[ function == \f\u\n\c\t\i\o\n ]]
+ installCommon_rollBack
+ '[' -z '' ']'
+ common_logger '--- Removing existing Wazuh installation ---'
09/03/2023 12:46:15 INFO: --- Removing existing Wazuh installation ---
09/03/2023 12:49:24 INFO: Wazuh manager removed.
09/03/2023 12:49:54 INFO: Wazuh indexer removed.
09/03/2023 12:49:54 INFO: Removing Wazuh indexer.
09/03/2023 12:49:55 INFO: Wazuh indexer removed.
09/03/2023 12:49:55 INFO: Removing Filebeat.
09/03/2023 12:49:57 INFO: Filebeat removed.
09/03/2023 12:49:57 INFO: Removing Wazuh dashboard.
09/03/2023 12:50:54 INFO: Wazuh dashboard removed.
09/03/2023 12:50:54 INFO: Installation cleaned.
[root@centos9stream vagrant]# bash wazuh-install.sh -a -i -o

This error doesn't come from the changes of this PR, and it seems the installation fails because no user is passed on to passwords_getApiUserId because for some reason, neither wazuh or wazuh-wui exist.

Some more tests have been done in a different and newly created CentOS 9 Stream and the error has not been replicated, as seen in the following trace:

[root@centos9stream vagrant]# bash wazuh-install.sh -a -i -o
09/03/2023 15:29:01 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 15:29:01 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 15:29:06 INFO: --- Removing existing Wazuh installation ---
09/03/2023 15:29:06 INFO: Removing Wazuh manager.
09/03/2023 15:29:32 INFO: Wazuh manager removed.
09/03/2023 15:29:32 INFO: Removing Wazuh indexer.
09/03/2023 15:29:36 INFO: Wazuh indexer removed.
09/03/2023 15:29:36 INFO: Removing Wazuh indexer.
09/03/2023 15:29:37 INFO: Wazuh indexer removed.
09/03/2023 15:29:37 INFO: Removing Filebeat.
09/03/2023 15:29:39 INFO: Filebeat removed.
09/03/2023 15:29:39 INFO: Removing Wazuh dashboard.
09/03/2023 15:29:54 INFO: Wazuh dashboard removed.
09/03/2023 15:29:55 INFO: Installation cleaned.
09/03/2023 15:29:55 WARNING: Hardware and system checks ignored.
09/03/2023 15:30:00 INFO: Wazuh development repository added.
09/03/2023 15:30:00 INFO: --- Configuration files ---
09/03/2023 15:30:00 INFO: Generating configuration files.
09/03/2023 15:30:03 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 15:30:03 INFO: --- Wazuh indexer ---
09/03/2023 15:30:04 INFO: Starting Wazuh indexer installation.
09/03/2023 15:31:55 INFO: Wazuh indexer installation finished.
09/03/2023 15:31:55 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 15:31:55 INFO: Starting service wazuh-indexer.
09/03/2023 15:32:19 INFO: wazuh-indexer service started.
09/03/2023 15:32:19 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 15:32:29 INFO: Wazuh indexer cluster initialized.
09/03/2023 15:32:29 INFO: --- Wazuh server ---
09/03/2023 15:32:29 INFO: Starting the Wazuh manager installation.
09/03/2023 15:33:43 INFO: Wazuh manager installation finished.
09/03/2023 15:33:43 INFO: Starting service wazuh-manager.
09/03/2023 15:34:02 INFO: wazuh-manager service started.
09/03/2023 15:34:02 INFO: Starting Filebeat installation.
09/03/2023 15:34:22 INFO: Filebeat installation finished.
09/03/2023 15:34:24 INFO: Filebeat post-install configuration finished.
09/03/2023 15:34:24 INFO: Starting service filebeat.
09/03/2023 15:34:24 INFO: filebeat service started.
09/03/2023 15:34:24 INFO: --- Wazuh dashboard ---
09/03/2023 15:34:24 INFO: Starting Wazuh dashboard installation.
09/03/2023 15:37:15 INFO: Wazuh dashboard installation finished.
09/03/2023 15:37:15 INFO: Wazuh dashboard post-install configuration finished.
09/03/2023 15:37:15 INFO: Starting service wazuh-dashboard.
09/03/2023 15:37:16 INFO: wazuh-dashboard service started.
+ echo 'installCommon_readPasswordFileUsers changeall'
installCommon_readPasswordFileUsers changeall
+ for j in "${!fileapiusers[@]}"
+ supported=false
+ for i in "${!api_users[@]}"
+ [[ wazuh == \w\a\z\u\h ]]
+ passwords_checkPassword 'Y5*glmz4S.uMeICA?0KhKCvY7WeA1+le'
+ grep -q '[A-Z]'
+ echo 'Y5*glmz4S.uMeICA?0KhKCvY7WeA1+le'
+ grep -q '[a-z]'
+ echo 'Y5*glmz4S.uMeICA?0KhKCvY7WeA1+le'
+ grep -q '[0-9]'
+ echo 'Y5*glmz4S.uMeICA?0KhKCvY7WeA1+le'
+ grep -q '[.*+?-]'
+ echo 'Y5*glmz4S.uMeICA?0KhKCvY7WeA1+le'
+ '[' 32 -lt 8 ']'
+ '[' 32 -gt 64 ']'
+ api_passwords[i]='Y5*glmz4S.uMeICA?0KhKCvY7WeA1+le'
+ supported=true
+ for i in "${!api_users[@]}"
+ [[ wazuh-wui == \w\a\z\u\h ]]
+ '[' true = false ']'
+ for j in "${!fileapiusers[@]}"
+ supported=false
+ for i in "${!api_users[@]}"
+ [[ wazuh == \w\a\z\u\h\-\w\u\i ]]
+ for i in "${!api_users[@]}"
+ [[ wazuh-wui == \w\a\z\u\h\-\w\u\i ]]
+ passwords_checkPassword 'oEgl676fKiBmrGumz*vez.gziRovoQ45'
+ grep -q '[A-Z]'
+ echo 'oEgl676fKiBmrGumz*vez.gziRovoQ45'
+ grep -q '[a-z]'
+ echo 'oEgl676fKiBmrGumz*vez.gziRovoQ45'
+ echo 'oEgl676fKiBmrGumz*vez.gziRovoQ45'
+ grep -q '[0-9]'
+ grep -q '[.*+?-]'
+ echo 'oEgl676fKiBmrGumz*vez.gziRovoQ45'
+ '[' 32 -lt 8 ']'
+ '[' 32 -gt 64 ']'
+ api_passwords[i]='oEgl676fKiBmrGumz*vez.gziRovoQ45'
+ supported=true
+ '[' true = false ']'
+ set +x
09/03/2023 15:37:59 INFO: Initializing Wazuh dashboard web application.
09/03/2023 15:38:00 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 15:38:15 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 15:38:30 INFO: Wazuh dashboard web application initialized.
09/03/2023 15:38:30 INFO: --- Summary ---
09/03/2023 15:38:30 INFO: You can access the web interface https://<wazuh-dashboard-ip>
    User: admin
    Password: UoxWH7Es0n5iBpFW8AffdexB.ePBN8nm
09/03/2023 15:38:30 INFO: Installation finished.

Another test is going to be done with only 1Gb memory to try and replicate the error, as the main difference between the two tests was in the first one the machine was created on a host much more on the limit, memory wise.

The test with 1 GB has also been successful, so probably the first error came from a virtualization issue or the previous host.

[root@centos9stream vagrant]# bash wazuh-install.sh -a -i
09/03/2023 15:48:03 INFO: Starting Wazuh installation assistant. Wazuh version: 4.4.0
09/03/2023 15:48:03 INFO: Verbose logging redirected to /var/log/wazuh-install.log
09/03/2023 15:48:07 WARNING: Hardware and system checks ignored.
09/03/2023 15:48:13 INFO: Wazuh development repository added.
09/03/2023 15:48:13 INFO: --- Configuration files ---
09/03/2023 15:48:13 INFO: Generating configuration files.
09/03/2023 15:48:16 INFO: Created wazuh-install-files.tar. It contains the Wazuh cluster key, certificates, and passwords necessary for installation.
09/03/2023 15:48:16 INFO: --- Wazuh indexer ---
09/03/2023 15:48:16 INFO: Starting Wazuh indexer installation.
09/03/2023 15:50:54 INFO: Wazuh indexer installation finished.
09/03/2023 15:50:54 INFO: Wazuh indexer post-install configuration finished.
09/03/2023 15:50:54 INFO: Starting service wazuh-indexer.
09/03/2023 15:51:20 INFO: wazuh-indexer service started.
09/03/2023 15:51:20 INFO: Initializing Wazuh indexer cluster security settings.
09/03/2023 15:51:31 INFO: Wazuh indexer cluster initialized.
09/03/2023 15:51:31 INFO: --- Wazuh server ---
09/03/2023 15:51:31 INFO: Starting the Wazuh manager installation.
09/03/2023 15:52:49 INFO: Wazuh manager installation finished.
09/03/2023 15:52:49 INFO: Starting service wazuh-manager.
09/03/2023 15:53:10 INFO: wazuh-manager service started.
09/03/2023 15:53:10 INFO: Starting Filebeat installation.
09/03/2023 15:53:25 INFO: Filebeat installation finished.
09/03/2023 15:53:27 INFO: Filebeat post-install configuration finished.
09/03/2023 15:53:27 INFO: Starting service filebeat.
09/03/2023 15:53:27 INFO: filebeat service started.
09/03/2023 15:53:27 INFO: --- Wazuh dashboard ---
09/03/2023 15:53:27 INFO: Starting Wazuh dashboard installation.
09/03/2023 15:56:27 INFO: Wazuh dashboard installation finished.
09/03/2023 15:56:27 INFO: Wazuh dashboard post-install configuration finished.
09/03/2023 15:56:27 INFO: Starting service wazuh-dashboard.
09/03/2023 15:56:28 INFO: wazuh-dashboard service started.
09/03/2023 15:57:24 INFO: Initializing Wazuh dashboard web application.
09/03/2023 15:57:26 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 15:57:45 INFO: Wazuh dashboard web application not yet initialized. Waiting...
09/03/2023 15:58:00 INFO: Wazuh dashboard web application initialized.
09/03/2023 15:58:00 INFO: --- Summary ---
09/03/2023 15:58:00 INFO: You can access the web interface https://<wazuh-dashboard-ip>
    User: admin
    Password: NWvB8hyi?EILGrlQ.R.kKVpFSG82sw36
09/03/2023 15:58:00 INFO: Installation finished.

@verdx verdx marked this pull request as ready for review March 9, 2023 16:07
@snaow snaow merged commit 9e3756a into 4.4 Mar 10, 2023
@snaow snaow deleted the 2111-fix-wazuh-api-and-dashboard-aio-installation branch March 10, 2023 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when installing the Wazuh Dashboard using the Installation Assistant
4 participants