immauss / openvas

Containers for running the Greenbone Vulnerability Manager. Run as a single container with all services or separate single applications containers via docker-compose.
GNU Affero General Public License v3.0
354 stars 102 forks source link

Problem with latest version on Centos7 #190

Closed Hezk closed 1 year ago

Hezk commented 1 year ago

Hi there! The docker has a problem when tries to create a DB from usr/lib/base-db.xz I am using last docker version and Centos 7. Full log:

starting container at: Tue Jun 20 07:17:32 UTC 2023 Setting up container filesystem cp: cannot stat '/usr/local/var/lib/': No such file or directory cp: cannot stat '/var/lib/gvm/': No such file or directory cp: cannot stat '/var/lib/notus/': No such file or directory cp: cannot stat '/var/lib/openvas/': No such file or directory Using default gvm logging config Using default gvm logging config Using default openvas logging config Choosing container start method from:

Starting gvmd & openvas in a single container !! Wait for redis socket to be created... Testing redis status... Redis ready. Creating postgresql.conf and pg_hba.conf Starting PostgreSQL... waiting for server to start....2023-06-20 07:17:33.866 UTC [99] LOG: redirecting log output to logging collector process 2023-06-20 07:17:33.866 UTC [99] HINT: Future log output will appear in directory "/data/var-log/postgresql". done server started pg exit with 0 . Checking for existing DB Loading Default Database Running first start configuration... Generating certs... Using /tmp/tmp.rq7dsc0aTH to temporarily store files. Creating new certificate infrastructure in automatic mode. Generating private key. Generated private key in /tmp/tmp.rq7dsc0aTH/cakey.pem. Generating certificate. Generating self signed certificate. Generated self signed certificate in /tmp/tmp.rq7dsc0aTH/cacert.pem. CA certificate generated. Installing certificate and key. Install destinations do not exist as directories, attempting to create them. Setting up directories Installed private key to /var/lib/gvm/private/CA/cakey.pem. Installed certificate to /var/lib/gvm/CA/cacert.pem. CA certificate and key installed. Generating private key. Generated private key in /tmp/tmp.rq7dsc0aTH/serverkey.pem. Generating certificate. Generating certificate request. Generated certificate request in /tmp/tmp.rq7dsc0aTH/serverrequest.pem. Signing certificate request. Signed certificate request in /tmp/tmp.rq7dsc0aTH/serverrequest.pem with CA certificate in /var/lib/gvm/CA/cacert.pem to generate certificate in /tmp/tmp.rq7dsc0aTH/servercert.pem Server certificate generated. Installing certificate and key. Installed private key to /var/lib/gvm/private/CA/serverkey.pem. Installed certificate to /var/lib/gvm/CA/servercert.pem. Server certificate and key installed. Generating private key. Generated private key in /tmp/tmp.rq7dsc0aTH/clientkey.pem. Generating certificate. Generating certificate request. Generated certificate request in /tmp/tmp.rq7dsc0aTH/clientrequest.pem. Signing certificate request. Signed certificate request in /tmp/tmp.rq7dsc0aTH/clientrequest.pem with CA certificate in /var/lib/gvm/CA/cacert.pem to generate certificate in /tmp/tmp.rq7dsc0aTH/clientcert.pem Client certificate generated. Installing certificate and key. Installed private key to /var/lib/gvm/private/CA/clientkey.pem. Installed certificate to /var/lib/gvm/CA/clientcert.pem. Client certificate and key installed. Removing temporary directory /tmp/tmp.rq7dsc0aTH. ######################################## Creating a base DB from /usr/lib/base-db.xz ######################################## ERROR: relation "host_details_by_host" already exists ERROR: relation "host_identifiers_by_host" already exists ERROR: relation "host_identifiers_by_value" already exists ERROR: relation "host_max_severities_by_host" already exists ERROR: relation "host_oss_by_host" already exists ERROR: relation "nvt_selectors_by_family_or_nvt" already exists ERROR: relation "nvt_selectors_by_name" already exists ERROR: relation "nvts_by_creation_time" already exists ERROR: relation "nvts_by_cvss_base" already exists ERROR: relation "nvts_by_family" already exists ERROR: relation "nvts_by_modification_time" already exists ERROR: relation "nvts_by_name" already exists ERROR: relation "nvts_by_solution_type" already exists ERROR: relation "permissions_by_name" already exists ERROR: relation "permissions_by_resource" already exists ERROR: relation "report_counts_by_report_and_override" already exists ERROR: relation "report_host_details_by_report_host_and_name" already exists ERROR: relation "report_hosts_by_report_and_host" already exists ERROR: relation "reports_by_task" already exists ERROR: relation "result_nvt_reports_by_report" already exists ERROR: relation "results_by_date" already exists ERROR: relation "results_by_host_and_qod" already exists ERROR: relation "results_by_nvt" already exists ERROR: relation "results_by_report" already exists ERROR: relation "results_by_task" already exists ERROR: relation "tag_resources_by_resource" already exists ERROR: relation "tag_resources_by_resource_uuid" already exists ERROR: relation "tag_resources_by_tag" already exists ERROR: relation "tag_resources_trash_by_tag" already exists ERROR: relation "tls_certificate_locations_by_host_ip" already exists ERROR: relation "tls_certificate_origins_by_origin_id_and_type" already exists ERROR: relation "vt_refs_by_vt_oid" already exists ERROR: relation "vt_severities_by_vt_oid" already exists NOTICE: relation "vt_severities" already exists, skipping Unpacking base feeds data from /usr/lib/var-lib.tar.xz Base DB and feeds collected on: Sun Jun 4 02:32:54 UTC 2023 Checking DB Version Current GVMd database version is 250 NOTICE: relation "vt_severities" already exists, skipping NOTICE: relation "vt_severities" already exists, skipping Migrate the database if needed.

Thanks for your time & work

Hezk commented 1 year ago

I'm doing some tests whith kali linux last release and there's the same problem

immauss commented 1 year ago

Can you please tell me how you are starting the container? Are you stating from a blank storage? Does it work if you don't use persistent storage ?

Thanks, Scott

Hezk commented 1 year ago

I ran these commands:

I tried it with and without persistent volume. I Also tried it on new virtual machine and old Centos 7, removing the docker and volumes. Same result.

immauss commented 1 year ago

Does the container finish starting, or does it die there?

Hezk commented 1 year ago

Yes it does, die there, no more log output after that and the gui neither works, I can't reach it through the browser.

immauss commented 1 year ago

Any reason you are stuck to CentOS 7? It is getting rather long in the tooth. I've tested on 8 and Rocky 9 as well as several flavors of Ubuntu, with no issue on the latest.

Hezk commented 1 year ago

I'm forced to use CentOS 7 because production necessities. I have the same problem in last Kali linux release, where there is not a big problem cause I can install it without docker.

In any case thanks for your effort and great work. Do you have buy me a coffe or something similar for donations?

immauss commented 1 year ago

You said you have the same problem with the non-container version on Kali? can you provide more details on what fails here? They are very different implementations, so maybe that will help jog my memory

Hezk commented 1 year ago

The non-container version on Kali goes fine, I have no problem with it. I have the same problem that I have in CentOS 7 with the container in Kali linux.

immauss commented 1 year ago

There have been some significant changes from GB lately, and they have all been integrated into the latest image. Would you mind trying 22.4.20 or the latest and see if it has the same issues?

Thanks, -Scott

immauss commented 1 year ago

Please open a new issue if you still need help with this.

-Scott