gvmd icon indicating copy to clipboard operation
gvmd copied to clipboard

--delete-scanner doesn't check if a scanner is used

Open guedou opened this issue 1 year ago • 1 comments

The --delete-scanner doesn't check if a scanner is used before deleting it. This causes GSA and the API to break.

Expected behavior

An error message is displayed if the scanner is assigned to a task.

Actual behavior

The scanner is deleted and GSA and the API breaks. The only fix that I found is to correct the task entry in PostgreSQL.

Steps to reproduce

1 . create a new scanner 2. create a track using this scanner 3. list tasks with GSA or the API

GVM versions

gsa:

docker compose -p openvas exec gsa gsad --version
Greenbone Security Assistant 22.08.0

gvm:

docker compose -p openvas exec gvmd gvmd --version
Greenbone Vulnerability Manager 23.6.2
Manager DB revision 255
Copyright (C) 2009-2021 Greenbone AG
License: AGPL-3.0-or-later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Environment

Linux Debian with a Docker Compose deployment.

guedou avatar Jun 27 '24 10:06 guedou

Seems to be another variant of #2067 (there the user suggested to delete the associated task if the scanner is getting deleted).

cfi-gb avatar Jun 27 '24 11:06 cfi-gb