Skip to content

When removing graphs, RRA files may be left behind #5868

@morganfw

Description

@morganfw

Describe the bug

When try to remove Orphaned Graphs from GUI, following error is written to the log:

2024-10-17 08:55:23 - MAINT <path_rra>/myrrd_73499.rrd ERROR: RRDfile Maintenance unable to delete from /var/www/html/cacti/rra!
2024-10-17 08:55:23 - CMDPHP PHP ERROR WARNING Backtrace: (/poller_maintenance.php[98]:rrdfile_purge(), /poller_maintenance.php[272]:remove_files(), /poller_maintenance.php[560]:unlink(), CactiErrorHandler())
2024-10-17 08:55:23 - ERROR PHP WARNING: unlink(/var/www/html/cacti/rra/<path_rra>/myrrd_73499.rrd): No such file or directory in file: /var/www/html/cacti/poller_maintenance.php on line: 560

we think the path cannot be found because <path_rra> is added to the path string.

If we check in the path the file exists:

cacti:/var/www/html/cacti/rra# ls -latr myrrd_73497.rrd
-rwxrwxr-x 1 www-data www-data 95608 Oct 17 07:20 myrrd_73497.rrd

If we check on Console - System Utilities - RRDfile Cleaner then click on Rescan, the table will be populated.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'Console - Management - Graphs'

  2. Flag on 'Orphaned'

  3. Select all Orphaned Graphs - Choose an action "Delete" and click "Go"

  4. Error in Logs - cacti.log:

2024-10-17 08:55:23 - MAINT <path_rra>/myrrd_73499.rrd ERROR: RRDfile Maintenance unable to delete from /var/www/html/cacti/rra!
2024-10-17 08:55:23 - CMDPHP PHP ERROR WARNING Backtrace: (/poller_maintenance.php[98]:rrdfile_purge(), /poller_maintenance.php[272]:remove_files(), /poller_maintenance.php[560]:unlink(), CactiErrorHandler())
2024-10-17 08:55:23 - ERROR PHP WARNING: unlink(/var/www/html/cacti/rra/<path_rra>/myrrd_73499.rrd): No such file or directory in file: /var/www/html/cacti/poller_maintenance.php on line: 560
  1. If we check in the path the file exists:
cacti:/var/www/html/cacti/rra# ls -latr myrrd_73497.rrd
-rwxrwxr-x 1 www-data www-data 95608 Oct 17 07:20 myrrd_73497.rrd
  1. No Orphaned Graphs in Cacti GUI (see screenshot)

  2. If we check on Console - System Utilities - RRDfile Cleaner then click on Rescan, the table will be populated (see screenshot)

Expected behavior

rrd file deleted, no error in cacti.log

Screenshots

image

image

Desktop (please complete the following information)

  • OS: [e.g. iOS]

  • Browser Chrome, Firefox and Edge on Windows 11

  • Version [e.g. 22]

Smartphone (please complete the following information)

  • Device: [e.g. iPhone6]

  • OS: [e.g. iOS8.1]

  • Browser [e.g. stock browser, safari]

  • Version [e.g. 22]

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourconfirmedBug is confirm by dev teamresolvedA fixed issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions