Gvmd database rebuild fails/database out of sync

Hi all,
the database rebuild on 21.4.2 will fails with:
Failed to rebuild NVT cache.
On the gvmd log I se this:

md main:MESSAGE:2021-08-02 10h29.31 utc:162224: Greenbone Vulnerability Manager version 21.4.2 (DB revision 242)
md manage: INFO:2021-08-02 10h29.31 utc:162224: Rebuilding NVTs.
md manage: INFO:2021-08-02 10h35.44 utc:162224: Updating VTs in database … 75305 new VTs, 0 changed VTs
md manage:WARNING:2021-08-02 10h35.45 utc:162224: update_nvts_from_vts: SHA-256 hash of the VTs in the database (d1132db397145714774daf08589bffb77f90917a3c452bdaa64bdd6379b0f420) does not match the one from the scanner (416a65efb492492d6e10a59d3e24412e2e5712456aa9cc29cb48d9f8ea119194).

How can I get the database back in synchronization with the scanner?


Normally, right after those lines in the logs you should have something saying:

md main:MESSAGE:2021-07-08 02h35.04 utc:7932: Rebuilding all NVTs because of a hash value mismatch

In which case you just need to wait for the DB to be reconstructed.

If not, then it means your NVT db is corrupted. In that case:

  1. Stop gvmd & ospd
  2. purge your NVT db directory (usually $GVMDIR/var/lib/openvas/plugins)
  3. Launch greenbone-nvt-sync
  4. Restart ospd & gvmd

This should fix your problem.


The messages should be also gone with the next gvmd release which is including:

Thanks @all.