Whenever I try to sync nvt with “sudo -u gvm -g gvm greenbone-nvt-sync” command, I get the following error “/var/lib/openvas/feed-update.lock” and due to that my scan are failing with the two errors

  1. Interrupting scan because GVM is exiting.
  2. VTs list is empty

screenshot below


Anyone can help me here???

Can you describe your install method and environment? Is this a new installation or are you supporting a legacy installation? This matters since there are old Bash feed-sync scripts and new Python-based ones.

Also, if you are trying to run Greenbone with very thin resource (CPU/RAM) the feed-sync may not have enough resources to run. Maybe the process is killed by OOM killer but the lock is never released. See this thread

You can find out which one you are running by checking the script’s file path, and then checking the shebang header to determine which script is in use. To my knowledge, the new scripts only need to be run with sudo, you don’t need to set the user and group.

  1. Check the feed-sync executable path:
which <feed-sync-filename>
  1. Check the shebang line:
head -1 /path/to/feed-sync-filename

If you see #!/bin/bash, then you are using the old bash scripts. You should upgrade to the new Python-based greenbone-feed-sync.

When greenbone-feed-sync issues the warning it can’t lock /var/lib/openvas/feed-update.lock then in most cases gvmd is loading the feed data currently. This means you need to wait until gvmd has finished loaded the data.