Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automation references the wrong table name causing errors #5315

Closed
bernisys opened this issue Apr 27, 2023 · 2 comments
Closed

Automation references the wrong table name causing errors #5315

bernisys opened this issue Apr 27, 2023 · 2 comments
Labels
automation Automation related issue bug Undesired behaviour confirmed Bug is confirm by dev team porting required Requires porting to develop resolved A fixed issue
Milestone

Comments

@bernisys
Copy link
Contributor

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. ;)

@bernisys bernisys added bug Undesired behaviour unverified Some days we don't have a clue labels Apr 27, 2023
@TheWitness
Copy link
Member

Thanks for reporting this. I'll be working on the 1.2.x branch a little this weekend.

@TheWitness TheWitness changed the title automation library references "ghost" Table: analytics_report_templates automation library references "ghost" Table Apr 29, 2023
TheWitness added a commit that referenced this issue Apr 29, 2023
automation library references "ghost" Table
@TheWitness TheWitness added resolved A fixed issue automation Automation related issue confirmed Bug is confirm by dev team and removed unverified Some days we don't have a clue labels Apr 29, 2023
@TheWitness TheWitness added this to the v1.2.25 milestone Apr 29, 2023
@TheWitness
Copy link
Member

Fixed.

@TheWitness TheWitness added the porting required Requires porting to develop label Jun 11, 2023
netniV added a commit that referenced this issue Jun 11, 2023
@netniV netniV changed the title automation library references "ghost" Table Automation references the wrong table name causing errors Sep 3, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automation Automation related issue bug Undesired behaviour confirmed Bug is confirm by dev team porting required Requires porting to develop resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

2 participants