greenbone / gvmd

Greenbone Vulnerability Manager - The database backend for the Greenbone Community Edition
GNU Affero General Public License v3.0
290 stars 157 forks source link

Scans with custom nth day of month schedule fail at 0% when manually started #1976

Closed MitchDrage closed 1 year ago

MitchDrage commented 1 year ago

Expected behavior

Tasks that are scheduled to run on the nth day of the month should be able to be manually started.

Actual behavior

Manually starting one of these tasks will have the scan stop at 0% in the web interface, while actually running in the background. Once the background scan has completed, GSA still reports this scan as 'Stopped at 0%'.

Steps to reproduce

  1. Define a schedule using any of the nth day of each month: image
  2. Attach the schedule to a task and manually start a scan.
  3. All other repeat schedules appear to work without error, and if the schedule is detached from the task, the scan operates without issue.

GVM versions

gsa: 22.04.0

gvm: 22.4.2

openvas-scanner: 22.4.5

gvm-libs:

Environment

Operating system:

Linux olucust002 5.15.0-71-generic #78-Ubuntu SMP Tue Apr 18 09:00:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS"

Installation method / source: Community Containers

Logfiles

gvmd_1           | event task:MESSAGE:2023-05-01 15h42.42 AEST:602: Status of task <redacted> (f89d2708-0463-439e-939c-39d53c0c82fa) has changed to Requested
gvmd_1           | event task:MESSAGE:2023-05-01 15h42.42 AEST:602: Task <redacted> (f89d2708-0463-439e-939c-39d53c0c82fa) has been requested to start by admin
gvmd_1           | event task:MESSAGE:2023-05-01 15h42.54 AEST:634: Status of task <redacted> (f89d2708-0463-439e-939c-39d53c0c82fa) has changed to Stopped
ospd-openvas_1   | OSPD[8] 2023-05-01 05:43:09,882: INFO: (ospd.command.command) Scan 7f0b65a6-e690-482a-b7ce-4b115d624fbc added to the queue in position 2.
ospd-openvas_1   | OSPD[8] 2023-05-01 05:43:13,060: INFO: (ospd.ospd) Currently 1 queued scans.
ospd-openvas_1   | OSPD[8] 2023-05-01 05:43:13,261: INFO: (ospd.ospd) Starting scan 7f0b65a6-e690-482a-b7ce-4b115d624fbc.
mqtt-broker_1    | 1682919823: New connection from 172.27.0.4:41600 on port 1883.
mqtt-broker_1    | 1682919823: New client connected from 172.27.0.4:41600 as 7209b463-587d-4797-bd52-5d0dd5261043 (p5, c1, k0).

(Key note is that the scan is marked as failed, and then the scan commences in the background and is not visible in GSA)

cfi-gb commented 1 year ago

1964 includes the following description which might have already improved this:

This addresses a problem with starting scheduled task manually.

MitchDrage commented 1 year ago

Thank you @cfi-gb. That looks a lot like a fix for this issue, but I wouldn't be able to tell until it's released. Apologies for asking, but is there a version and/or date planned for this fix to move in to release?

cfi-gb commented 1 year ago

Unfortunately i'm not involved into anything around release management so i'm not able to answer this question.

MitchDrage commented 1 year ago

I can confirm that as of GVMD 22.5.0, this issue has been resolved. Fix came in https://github.com/greenbone/gvmd/pull/1964 as suggested.