greenbone / gsa

Greenbone Security Assistant - The web frontend for the Greenbone Community Edition
GNU Affero General Public License v3.0
212 stars 95 forks source link

GSA falling to install #2317

Closed Msec-hue closed 3 years ago

Msec-hue commented 4 years ago

Expected behavior

When installing GSA from the source installation, it should compile the source code.

Actual behavior

I get the below when reaching the 7% mark, due to the function start_unix_http_daemon.

[ 7%] Built target gsa-ng [ 11%] Created translation .json files [ 40%] Built target gettext-json -- Found Git: /usr/bin/git (found version "2.27.0") [ 40%] Built target revisiontag [ 44%] Building C object gsad/src/CMakeFiles/gsad.dir/gsad.c.o /opt/gvm/src/gsa/gsad/src/gsad.c: In function ‘start_unix_http_daemon’: /opt/gvm/src/gsa/gsad/src/gsad.c:2602:20: error: passing argument 5 of ‘MHD_start_daemon’ from incompatible pointer type [-Werror=incompatible-pointer-types] 2602 0, NULL, NULL, handler, http_handlers, MHD_OPTION_NOTIFY_COMPLETED, ^~~
int ()(void , struct MHD_Connection , const char , const char , const char , const char , size_t , void ) {aka int ()(void , struct MHD_Connection , const char , const char , const char , const char , long unsigned int , void )}
In file included from /opt/gvm/src/gsa/gsad/src/gsad_params.h:29, from /opt/gvm/src/gsa/gsad/src/gsad_user.h:28, from /opt/gvm/src/gsa/gsad/src/gsad_base.h:29, from /opt/gvm/src/gsa/gsad/src/gsad.c:71: /usr/include/microhttpd.h:2425:1: note: expected ‘MHD_AccessHandlerCallback’ {aka ‘enum MHD_Result ()(void , struct MHD_Connection , const char , const char , const char , const char , long unsigned int , void )’} but argument is of type ‘int ()(void , struct MHD_Connection , const char , const char , const char , const char , size_t , void )’ {aka ‘int ()(void , struct MHD_Connection , const char , const char , const char , const char , long unsigned int , void **)’} 2425 MHD_start_daemon (unsigned int flags, ^~~~ /opt/gvm/src/gsa/gsad/src/gsad.c: In function ‘start_http_daemon’: /opt/gvm/src/gsa/gsad/src/gsad.c:2636:30: error: passing argument 5 of ‘MHD_start_daemon’ from incompatible pointer type [-Werror=incompatible-pointer-types] 2636 flags, port, NULL, NULL, handler, http_handlers, ^~~
int ()(void , struct MHD_Connection , const char , const char , const char , const char , size_t , void ) {aka int ()(void , struct MHD_Connection , const char , const char , const char , const char , long unsigned int , void )}
In file included from /opt/gvm/src/gsa/gsad/src/gsad_params.h:29, from /opt/gvm/src/gsa/gsad/src/gsad_user.h:28, from /opt/gvm/src/gsa/gsad/src/gsad_base.h:29, from /opt/gvm/src/gsa/gsad/src/gsad.c:71: /usr/include/microhttpd.h:2425:1: note: expected ‘MHD_AccessHandlerCallback’ {aka ‘enum MHD_Result ()(void , struct MHD_Connection , const char , const char , const char , const char , long unsigned int , void )’} but argument is of type ‘int ()(void , struct MHD_Connection , const char , const char , const char , const char , size_t , void )’ {aka ‘int ()(void , struct MHD_Connection , const char , const char , const char , const char , long unsigned int , void **)’} 2425 MHD_start_daemon (unsigned int flags, ^~~~ /opt/gvm/src/gsa/gsad/src/gsad.c: In function ‘start_https_daemon’: /opt/gvm/src/gsa/gsad/src/gsad.c:2668:30: error: passing argument 5 of ‘MHD_start_daemon’ from incompatible pointer type [-Werror=incompatible-pointer-types] 2668 flags, port, NULL, NULL, &handle_request, http_handlers, ^~~~~~~
int ()(void , http_connection_t , const char , const char , const char , const char , size_t , void ) {aka int ()(void , struct MHD_Connection , const char , const char , const char , const char , long unsigned int , void )}

In file included from /opt/gvm/src/gsa/gsad/src/gsad_params.h:29, from /opt/gvm/src/gsa/gsad/src/gsad_user.h:28, from /opt/gvm/src/gsa/gsad/src/gsad_base.h:29, from /opt/gvm/src/gsa/gsad/src/gsad.c:71: /usr/include/microhttpd.h:2425:1: note: expected ‘MHD_AccessHandlerCallback’ {aka ‘enum MHD_Result ()(void , struct MHD_Connection , const char , const char , const char , const char , long unsigned int , void )’} but argument is of type ‘int ()(void , http_connection_t , const char , const char , const char , const char , size_t , void )’ {aka ‘int ()(void , struct MHD_Connection , const char , const char , const char , const char , long unsigned int , void )’} 2425 | MHD_start_daemon (unsigned int flags, | ^~~~ cc1: all warnings being treated as errors make[2]: ** [gsad/src/CMakeFiles/gsad.dir/build.make:63: gsad/src/CMakeFiles/gsad.dir/gsad.c.o] Error 1 make[1]: [CMakeFiles/Makefile2:400: gsad/src/CMakeFiles/gsad.dir/all] Error 2 make: *** [Makefile:152: all] Error 2

Steps to reproduce

1.Go the gsa downloaded directory downloaded from github

  1. run "make" in the build folder and we get the error

GVM versions

gsa: (gsad --version)

*gvm: 9.0.1* (gvmd --version)

openvas-scanner: (openvassd --version)

*gvm-libs:11.0.1*

*openvas:7.0.1*

Environment

Operating system:Kali GNU/linux Rolling 2020.2 The Kali is a Vmware image

*Installation method / source:source installation* (packages, source installation)

Logfiles

no logs

8Cris1 commented 4 years ago

Same issue

cfi-gb commented 4 years ago

@Msec-hue @8Cris1 As a workaround adding -DCMAKE_BUILD_TYPE=RELEASE to the cmake .. call should allow to build GSA.

rephlex commented 4 years ago

@Msec-hue @8Cris1 As a workaround adding -DCMAKE_BUILD_TYPE=RELEASE to the cmake .. call should allow to build GSA.

This is confirmed working using gsa-20.08 master and running ubuntu:devel as of today

tuxmaster5000 commented 4 years ago

The same option is needed to build it for CentOS 7. (Tested with 20.8.0 of gsa)

brennnaaannn commented 3 years ago

@Msec-hue @8Cris1 As a workaround adding -DCMAKE_BUILD_TYPE=RELEASE to the cmake .. call should allow to build GSA.

This is confirmed working using gsa-20.08 master and running ubuntu:devel as of today

Confirmed this resolves issue and allows build on Kali today.

This link has some information as to why this is happening on libmicrohttpd12 0.9.71-1

https://gitlab.com/jeanfi/psensor/-/issues/24

ghost commented 3 years ago

hi, during the build of the gsa i find the same error:

[ 16%] Building C object gsad/src/CMakeFiles/gsad.dir/gsad.c.o
/opt/gvm/src/gsa/gsad/src/gsad.c: In function ‘start_unix_http_daemon’:
/opt/gvm/src/gsa/gsad/src/gsad.c:2567:20: error: passing argument 5 of ‘MHD_start_daemon’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2567 |     0, NULL, NULL, handler, http_handlers, MHD_OPTION_NOTIFY_COMPLETED,
      |                    ^~~~~~~
      |                    |
      |                    int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, size_t *, void **) {aka int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int *, void **)}
In file included from /opt/gvm/src/gsa/gsad/src/gsad_params.h:28,
                 from /opt/gvm/src/gsa/gsad/src/gsad_user.h:27,
                 from /opt/gvm/src/gsa/gsad/src/gsad_base.h:28,
                 from /opt/gvm/src/gsa/gsad/src/gsad.c:70:
/usr/include/microhttpd.h:2428:45: note: expected ‘MHD_AccessHandlerCallback’ {aka ‘enum MHD_Result (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int *, void **)’} but argument is of type ‘int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, size_t *, void **)’ {aka ‘int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int *, void **)’}
 2428 |                   MHD_AccessHandlerCallback dh, void *dh_cls,
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/opt/gvm/src/gsa/gsad/src/gsad.c: In function ‘start_http_daemon’:
/opt/gvm/src/gsa/gsad/src/gsad.c:2601:30: error: passing argument 5 of ‘MHD_start_daemon’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2601 |     flags, port, NULL, NULL, handler, http_handlers,
      |                              ^~~~~~~
      |                              |
      |                              int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, size_t *, void **) {aka int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int *, void **)}
In file included from /opt/gvm/src/gsa/gsad/src/gsad_params.h:28,
                 from /opt/gvm/src/gsa/gsad/src/gsad_user.h:27,
                 from /opt/gvm/src/gsa/gsad/src/gsad_base.h:28,
                 from /opt/gvm/src/gsa/gsad/src/gsad.c:70:
/usr/include/microhttpd.h:2428:45: note: expected ‘MHD_AccessHandlerCallback’ {aka ‘enum MHD_Result (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int *, void **)’} but argument is of type ‘int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, size_t *, void **)’ {aka ‘int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int *, void **)’}
 2428 |                   MHD_AccessHandlerCallback dh, void *dh_cls,
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/opt/gvm/src/gsa/gsad/src/gsad.c: In function ‘start_https_daemon’:
/opt/gvm/src/gsa/gsad/src/gsad.c:2633:30: error: passing argument 5 of ‘MHD_start_daemon’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2633 |     flags, port, NULL, NULL, &handle_request, http_handlers,
      |                              ^~~~~~~~~~~~~~~
      |                              |
      |                              int (*)(void *, http_connection_t *, const char *, const char *, const char *, const char *, size_t *, void **) {aka int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int *, void **)}
In file included from /opt/gvm/src/gsa/gsad/src/gsad_params.h:28,
                 from /opt/gvm/src/gsa/gsad/src/gsad_user.h:27,
                 from /opt/gvm/src/gsa/gsad/src/gsad_base.h:28,
                 from /opt/gvm/src/gsa/gsad/src/gsad.c:70:
/usr/include/microhttpd.h:2428:45: note: expected ‘MHD_AccessHandlerCallback’ {aka ‘enum MHD_Result (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int *, void **)’} but argument is of type ‘int (*)(void *, http_connection_t *, const char *, const char *, const char *, const char *, size_t *, void **)’ {aka ‘int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int *, void **)’}
 2428 |                   MHD_AccessHandlerCallback dh, void *dh_cls,
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
cc1: all warnings being treated as errors
make[2]: *** [gsad/src/CMakeFiles/gsad.dir/build.make:82: gsad/src/CMakeFiles/gsad.dir/gsad.c.o] Errore 1
make[1]: *** [CMakeFiles/Makefile2:394: gsad/src/CMakeFiles/gsad.dir/all] Errore 2
make: *** [Makefile:149: all] Errore 2

@brennnaaannn i don't understand how to solve this bug, can you help me? with kali. Thanks

brennnaaannn commented 3 years ago

@brennnaaannn i don't understand how to solve this bug, can you help me? with kali. Thanks

@othin87 It seems like the same error we have been mentioning in this thread. Have you added "-DCMAKE_BUILD_TYPE=RELEASE" to the cmake before re-attempting the build?

ghost commented 3 years ago

@brennnaaannn i don't understand how to solve this bug, can you help me? with kali. Thanks

@othin87 It seems like the same error we have been mentioning in this thread. Have you added "-DCMAKE_BUILD_TYPE=RELEASE" to the cmake before re-attempting the build?

you mean : gvm@KaliGVM20:~/src/gsa/build$ cmake -DCMAKE_INSTALL_PREFIX=/opt/gvm .. ? i've done before launch make but i've the same problem

rephlex commented 3 years ago

@brennnaaannn i don't understand how to solve this bug, can you help me? with kali. Thanks

@othin87 It seems like the same error we have been mentioning in this thread. Have you added "-DCMAKE_BUILD_TYPE=RELEASE" to the cmake before re-attempting the build?

you mean : gvm@KaliGVM20:~/src/gsa/build$ cmake -DCMAKE_INSTALL_PREFIX=/opt/gvm .. ? i've done before launch make but i've the same problem

cmake .. -DCMAKE_INSTALL_PREFIX=/opt/gvm -DCMAKE_BUILD_TYPE=RELEASE make make install

ghost commented 3 years ago

@brennnaaannn i don't understand how to solve this bug, can you help me? with kali. Thanks

@othin87 It seems like the same error we have been mentioning in this thread. Have you added "-DCMAKE_BUILD_TYPE=RELEASE" to the cmake before re-attempting the build?

you mean : gvm@KaliGVM20:~/src/gsa/build$ cmake -DCMAKE_INSTALL_PREFIX=/opt/gvm .. ? i've done before launch make but i've the same problem

cmake .. -DCMAKE_INSTALL_PREFIX=/opt/gvm -DCMAKE_BUILD_TYPE=RELEASE make make install

Thank you mate

bjoernricks commented 3 years ago

This issue will be fixed with https://github.com/greenbone/gsa/pull/2625