Secure-Compliance-Solutions-LLC / GVM-Docker

Greenbone Vulnerability Management Docker Image with OpenVAS
https://securecompliance.gitbook.io/projects/
MIT License
247 stars 91 forks source link

[Bug] Config, past scans etc gone after update to latest #298

Open markdesilva opened 3 years ago

markdesilva commented 3 years ago

Describe the bug Upgraded to latest 21.4.3-v2 from 21.4.0, all configs and previous scan reports, etc are gone.

Using new volume env: --volume ./storage/postgres-db:/opt/database --volume ./storage/openvas-plugins:/var/lib/openvas/plugins --volume ./storage/gvm:/var/lib/gvm --volume ./storage/ssh:/etc/ssh

To Reproduce Steps to reproduce the behavior:

  1. Start container with new volume envs
  2. Log into gvm
  3. No data, no scan configs, no past scans etc

Expected behavior See all scan configs, past scans, etc.

Screenshots NA

Host Device:

Image in use:

Additional context Add any other context about the problem here.

markdesilva commented 3 years ago

I'm probably doing something wrong. Previously all files were linked from gvm-data. I moved the relevant directories (plugins, database, etc) to under ./storage and ran the docker and I get this error:

2021-11-13 09:16:13,807 INFO exited: postgresql (exit status 1; not expected)

Do I need to upgrade from 21.4.0 to 21.4.2 and move my way to the latest?

markdesilva commented 3 years ago

Found the postgres error logs.

2021-11-13 10:15:07.249 UTC [114] FATAL: database files are incompatible with server 2021-11-13 10:15:07.249 UTC [114] DETAIL: The data directory was initialized by PostgreSQL version 12, which is not compatible with this version 13.3.

How do I upgrade the database?

Thank you.

markdesilva commented 3 years ago

Does this still work?

docker run --tty --rm --volume gvm-data:/data --name temp securecompliance/gvm:upgrade-database