Skip to content

Automation references the wrong table name causing errors #5315

@bernisys

Description

@bernisys

Describe the bug

When setting a "monthly" or "monthly on day" schedule for a network scan automation, you will get SQL errors in the logs, telling that the "analytics_report_templates" table does not exist.

Indeed it is referenced only on that particular place in the code, i found it nowhere else.
Probably a relic from the past? - might be, so the lines can probably be removed.

Here's the code that causes the error, starting around line 3899 in lib/api_automation.php:

                db_execute_prepared('UPDATE analytics_report_templates
			SET next_start = ?
			WHERE id = ?',
				array(date('Y-m-d H:i', $next), $network_id));

We're on cacti 1.2.23, code part is still present in 24 and wasn't touched for a long time.

To Reproduce

Steps to reproduce the behavior:

  1. Go to Automation -> Networks
  2. Create any discovery with a schedule of "Monthly" or "Monthly on Day"
  3. activate it
  4. check logs for: "CMDPHP ERROR: A DB Exec Failed!, Error: Table 'cacti.analytics_report_templates' doesn't exist"

Expected behavior

Obviously, errors should not appear. ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    automationAutomation related issuebugUndesired behaviourconfirmedBug is confirm by dev teamporting requiredRequires porting to developresolvedA fixed issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions