Skip to content

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

@guedou

Description

@guedou

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions