Postgres: version 10.6
OS: Ubuntu 18.04.1 LTS
When I remove a "class" entry or the entire reports file, I would expect the corresponding link off the home page in the "reports" box to disappear, similar to "organization" -> "reports"
The link is still there. Following it gives a "page not found"
I can see not automatically deleting the report history/results just because the py file or the class is missing - that could protect me from myself on upgrades / editing reports.
Maybe a button under "Organization" -> "Reports" that does a "report cleanup" and removes reports from the database that don't exist anymore?
Also hitting this issue. Would like to be able to clean up the reports from the "Reports" box on the homepage.
Tertiary confirmation. Ran into this recently, and with report renames the issue is ever present on the Netbox landing page.
As a workaround fix you can delete the old/invalid report results in the extras_reportresult database table. I'd only recommend this if you're comfortable with direct database interaction, but that table isn't depended upon by anything else (currently) so deleting them from that table is safe and will clear the front page results up.
Hitting same issue as well. Restart of Netbox doesn't work either.
Your workaround works @tyler-8, thank you! (I had to restart Netbox twice for changes to take effect, don't know why)
Here are the commands I executed :
netbox=> SELECT * FROM extras_reportresult;
id | report | created | failed | data | user_id
----+------------------------------+-------------------------------+--------+--------------------------------------------------------------------------------------+---------
1 | duplicate_ips.UniqueIPReport | 2019-08-20 08:51:50.772057+02 | f | {"test_unique_ip": {"log": [], "info": 0, "failure": 0, "success": 0, "warning": 0}} |
(1 row)
netbox=> DELETE FROM extras_reportresult WHERE extras_reportresult.id = 1;
DELETE 1
netbox=> SELECT * FROM extras_reportresult;
id | report | created | failed | data | user_id
----+--------+---------+--------+------+---------
(0 rows)
As stated, it is only a workaround. A fix would be appreciated!
Edit: it seems that restarting Netbox doesn't change anything. I guess the table in database is checked periodically for updating the UI, so wait for a while and you shouldn't see reports on the homepage anymore.
You don't see the Changes in the UI, because they are cached in redis.
bash-5.0# python manage.py invalidate all
fixed it for me.
Most helpful comment
As a workaround fix you can delete the old/invalid report results in the
extras_reportresultdatabase table. I'd only recommend this if you're comfortable with direct database interaction, but that table isn't depended upon by anything else (currently) so deleting them from that table is safe and will clear the front page results up.