wazuh / wazuh-packages

Wazuh - Tools for packages creation
https://wazuh.com
GNU General Public License v2.0
100 stars 90 forks source link

Failure to build from source occasionally #2800

Closed lmdeaton1 closed 5 months ago

lmdeaton1 commented 6 months ago
Wazuh version Component Install type Install method Platform
4.7.2 Server Build Manager Sources RHEL7 x86_64

I am trying to get the Wazuh server built with the ZeroMQ functionality enabled. In doing this, I am regularly trying to build the wazuh source into an RPM for running on RHEL7. Occasionally, when I run the generate_rpm_package.sh script, I will hit an autoconf missing file issue as below. If I simply run the build again, the issue goes away without any change to how I was calling the generate_rpm_package.sh script. Here is how I am calling the generate_rpm_package.sh script

sudo ./generate_rpm_package.sh -b v4.7.2 --packages-branch v4.7.2 -t manager --sources /home/vagrant/wazuh

Here's the output when it cannot get past the autoconf failure.

cd external/libplist/ && make clean && rm -rf bin/* make[1]: Entering directory /build_wazuh/rpmbuild/BUILD/wazuh-manager-4.7.2/src/external/libplist' make[1]: *** No rule to make targetclean'. Stop. make[1]: Leaving directory /build_wazuh/rpmbuild/BUILD/wazuh-manager-4.7.2/src/external/libplist' make: [clean-external] Error 2 (ignored) cd external/libpcre2/ && make distclean && rm include/* make[1]: Entering directory/build_wazuh/rpmbuild/BUILD/wazuh-manager-4.7.2/src/external/libpcre2' make[1]: No rule to make target distclean'. Stop. make[1]: Leaving directory/build_wazuh/rpmbuild/BUILD/wazuh-manager-4.7.2/src/external/libpcre2' make: [clean-external] Error 2 (ignored) rm -rf external/popt/build/ rm -rf external/rpm//builddir cd external/libarchive/ && make clean make[1]: Entering directory `/build_wazuh/rpmbuild/BUILD/wazuh-manager-4.7.2/src/external/libarchive' cd . && /bin/sh /build_wazuh/rpmbuild/BUILD/wazuh-manager-4.4.0/src/external/libarchive/build/autoconf/missing automake-1.16 --foreign /bin/sh: /build_wazuh/rpmbuild/BUILD/wazuh-manager-4.4.0/src/external/libarchive/build/autoconf/missing: No such file or directory make[1]: [Makefile.in] Error 1 make[1]: Leaving directory `/build_wazuh/rpmbuild/BUILD/wazuh-manager-4.7.2/src/external/libarchive' make: *** [clean-external] Error 2 error: Bad exit status from /usr/local/var/tmp/rpm-tmp.8T2gpn (%build)

I don't understand why it is looking for the wazuh-manager-4.4.0 directory in the output above.

jnasselle commented 5 months ago

Hi @lmdeaton1 ,

Moving this issue to wazuh/wazuh-packages repo and answering from there

jnasselle commented 5 months ago

Hi @lmdeaton1 ,

I assume you're making changes to the source code to fix https://github.com/wazuh/wazuh/issues/19600 and also changes should be made to wazuh-packages to add ZEROMQ flag to make call https://documentation.wazuh.com/current/development/makefile.html. Am I right?

lmdeaton1 commented 5 months ago

I'm using 4.7.2, so the limits related issue in https://github.com/wazuh/wazuh/issues/19600 does not exist. I am just trying to build with ZeroMQ by enabling the USE_ZEROMQ and then using the generate_rpm_package.sh script. I'm currently running into issues getting the zeromq libraries to install cleanly within the docker container, but I'm still working on that issue. The above issue is just something I hit occasionally when running this script over and over.

lmdeaton1 commented 5 months ago

I'm attempting to add downloading of the appropriate zeromq libs to the Makefile using the target below, but running into dependency issues with the czmq related libaries within the docker container.

.PHONY: add_czmq add_czmq: echo Adding czmq libraries echo wazuh lib output path ${WAZUH_LIB_OUTPUT_PATH} TMP_PATH=$(CURDIR) yum repolist cd /etc/yum.repos.d/ wget --no-check-certificate -O zeromq.repo https://download.opensuse.org/repositories/network:messaging:zeromq:release-stable/RHEL_7/network:messaging:zeromq:release-stable.repo echo 'priority=1' >> zeromq.repo cat zeromq.repo cp zeromq.repo /etc/yum.repos.d cat /etc/yum.repos.d/zeromq.repo yum update echo '** Modified Repo list *****' yum repolist yum install -y czmq-devel cd ${TMP_PATH} echo DONE Adding czmq libraries

Dependency issues I'm encountering:

---> Package scl-utils.x86_64 0:20120927-29.el6_9 will be installed --> Finished Dependency Resolution Error: Package: liblz4-1_4-1.4.0+svn124-1.1.x86_64 (network_messaging_zeromq_release-stable) Requires: libc.so.6(GLIBC_2.14)(64bit) Error: Package: libmicrohttpd-0.9.33-9.1.x86_64 (network_messaging_zeromq_release-stable) Requires: libgnutls.so.28(GNUTLS_3_0_0)(64bit) Error: Package: libbsd0-0.8.3-4.1.x86_64 (network_messaging_zeromq_release-stable) Requires: libc.so.6(GLIBC_2.16)(64bit) Error: Package: libzmq5-4.3.4-37.6.x86_64 (network_messaging_zeromq_release-stable) Requires: libc.so.6(GLIBC_2.14)(64bit) Error: Package: libpgm-5_2-0-5.2.122-13.1.x86_64 (network_messaging_zeromq_release-stable) Requires: libc.so.6(GLIBC_2.17)(64bit) Error: Package: libmicrohttpd-0.9.33-9.1.x86_64 (network_messaging_zeromq_release-stable) Requires: libgnutls.so.28()(64bit) Error: Package: libzmq5-4.3.4-37.6.x86_64 (network_messaging_zeromq_release-stable) Requires: libstdc++.so.6(GLIBCXX_3.4.19)(64bit) Error: Package: libmicrohttpd-0.9.33-9.1.x86_64 (network_messaging_zeromq_release-stable) Requires: libc.so.6(GLIBC_2.17)(64bit) Error: Package: czmq-devel-4.2.1-17.7.x86_64 (network_messaging_zeromq_release-stable) Requires: systemd-devel >= 200.0.0 Error: Package: libczmq4-4.2.1-17.7.x86_64 (network_messaging_zeromq_release-stable) Requires: libc.so.6(GLIBC_2.17)(64bit) Error: Package: libmicrohttpd-0.9.33-9.1.x86_64 (network_messaging_zeromq_release-stable) Requires: libgnutls.so.28(GNUTLS_1_4)(64bit) Error: Package: libzmq5-4.3.4-37.6.x86_64 (network_messaging_zeromq_release-stable) Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) Error: Package: czmq-devel-4.2.1-17.7.x86_64 (network_messaging_zeromq_release-stable) Requires: libcurl-devel >= 7.28.0 Available: libcurl-devel-7.19.7-53.el6_9.i686 (base) libcurl-devel = 7.19.7-53.el6_9 Available: libcurl-devel-7.19.7-54.el6_10.i686 (updates) libcurl-devel = 7.19.7-54.el6_10

jnasselle commented 5 months ago

Hi @lmdeaton1 ,

Compilation from sources is failing with USE_ZEROMQ flag as I mentioned here https://github.com/wazuh/wazuh/issues/19600#issuecomment-1915420905.

This will make it so that even if you could resolve the libs installation in the building container, the Wazuh Manager compilation will fail.

Sorry about the bad news.

On the other hand, we are currently reworking wazuh-analysisd here. I'll ask the dev team about ZEROMQ support on this one.

jnasselle commented 5 months ago

Closing as not planned since this is a duplicate/consequence of https://github.com/wazuh/wazuh/issues/19600