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 may sometimes create empty graphs #2719

Closed
stormonts opened this issue Jun 6, 2019 · 10 comments
Closed

Automation may sometimes create empty graphs #2719

stormonts opened this issue Jun 6, 2019 · 10 comments
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@stormonts
Copy link

Every time we add a new device to Cacti, graphs are created via automation rules including an "Empty graph" that can't be deleted. All of our automation rules show matching devices and objects, so we can't tell what specifically is creating these "empty graphs" or why. When we select them and then either click on Delete or re-apply suggested names, we get the message shown below. The "Empty graphs" can be seen in the background of the image.

image

@cigamit
Copy link
Member

cigamit commented Jun 8, 2019

Need more information, you may have to send a database dump to developers at cacti dot net.

@cigamit
Copy link
Member

cigamit commented Jun 8, 2019

Note also that 1.2.4 has been released.

@cigamit cigamit added the unverified Some days we don't have a clue label Jun 8, 2019
@stormonts
Copy link
Author

Problem still exists in 1.2.4. Whole DB dump is 120 MB; guessing only part of that is needed for analysis.

@netniV
Copy link
Member

netniV commented Jun 10, 2019

Is that compressed?

@stormonts
Copy link
Author

No, I'm an idiot and can't read. Zipped it is 14 meg. Where should I send it?

@netniV
Copy link
Member

netniV commented Jun 12, 2019

developers@cacti.net and reference the issue number so we know which issue the email relates to.

@cigamit
Copy link
Member

cigamit commented Jun 22, 2019

@stormonts, did @netniV help you on this one yet?

@cigamit
Copy link
Member

cigamit commented Jun 22, 2019

I've taken a look at this and am about to commit a patch. I'll need you to manually remove the file in the graph_local table.

cigamit added a commit that referenced this issue Jun 22, 2019
Empty graphs being created automatically but we can't delete them
@cigamit
Copy link
Member

cigamit commented Jun 22, 2019

Update made, you need to run the following query to remove the bad graphs.

DELETE gl 
FROM graph_local AS gl 
LEFT JOIN graph_templates_graph AS gtg 
ON gl.id = gtg.local_graph_id 
WHERE gtg.local_graph_id IS NULL;

@cigamit cigamit added bug Undesired behaviour resolved A fixed issue and removed unverified Some days we don't have a clue labels Jun 22, 2019
@cigamit cigamit added this to the v1.2.5 milestone Jun 23, 2019
@ddb4github
Copy link
Contributor

How about diff below, then we can delete them by WebUI:

--- graphs.php.orig     2019-06-26 21:47:52.001432337 +0800
+++ graphs.php  2019-06-26 21:48:26.221159679 +0800
@@ -1990,7 +1990,7 @@
        $sql_order = get_order_string();
        $sql_limit = ' LIMIT ' . ($rows*(get_request_var('page')-1)) . ',' . $rows;

-       $graph_list = db_fetch_assoc("SELECT gtg.id, gtg.local_graph_id, gtg.height, gtg.width,
+       $graph_list = db_fetch_assoc("SELECT gtg.id, gl.id AS local_graph_id, gtg.height, gtg.width,
                gtg.title_cache, gt.name, gl.host_id,
                IF(gl.graph_template_id=0, 0, IF(gl.snmp_query_id=0, 2, 1)) AS graph_source
                FROM graph_local AS gl

Before Fixing

image

After Fixing

image

@netniV netniV closed this as completed Jun 27, 2019
@netniV netniV changed the title Empty graphs being created automatically but we can't delete them Automation may sometimes create empty graphs Jul 14, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

4 participants