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

[BUG] how to remove zombie data? #696

Open
xinmans opened this issue Sep 24, 2024 · 6 comments
Open

[BUG] how to remove zombie data? #696

xinmans opened this issue Sep 24, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@xinmans
Copy link

xinmans commented Sep 24, 2024

there is a zombie data wich not have any disk information, how to remove it from dashboard?

i use the delete device in “…” menu, but no response, how ?
IMG_4142

@xinmans xinmans added the bug Something isn't working label Sep 24, 2024
@kapsh
Copy link

kapsh commented Oct 4, 2024

Can't say how that happened, but removing sounds like a lot of pain.

First you need to find scrutiny internal database. Assuming you running omnibus docker image it will be in ./config/scrutiny.db alongside docker-compose file.
BACK IT UP right now, because everything below is my guesswork.
Access db as sqlite3 --header scrutiny.db (install sqlite client if needed).
Run query select * from devices; and find wrong device in output. Normal device_name values are sdb, sdc, etc, incorrect would be empty string or null.
Run delete from devices where device_name is null or device_name = ''; to drop it.
Check web interface again and if everything broke ­— restore that backup.

@xinmans
Copy link
Author

xinmans commented Oct 5, 2024

not work
sqlite> select * from devices where device_name is null or device_name = '';
sqlite>

Dashboard
Drive health at a glance
/DEV/ -
Last Updated on May 01, 2024 - 08:00
STATUS
Passed
TEMPERATURE
39°C
CAPACITY
0 B
POWERED ON
2 years

@xinmans
Copy link
Author

xinmans commented Oct 5, 2024

this no null device_name,but dashboard show /DEV/- column, what's wrong? What's the views sql of Dashboard?

sqlite> select host_id,device_name from devices;
host_id|device_name
truenas-d1581|sde
truenas-d1581|sdg
truenas-d1581|sdh
truenas-d1581|sdf
truenas-d1581|sdi
truenas-d1581|sdc
truenas-d1581|sdb
truenas-d1581|sdd
ubuntu-woniu|sda
ubuntu-woniu|sdb
ubuntu-woniu|sdc
ubuntu-woniu|sdd
pve-amd|nvme0
pve-synsea|sda
pve-d1581|nvme1
ubuntu-woniu|sde
pve-synsea|sdc
pve-d1581|nvme0
pbs|sdd
pbs|sdb
pbs|sdc
pbs|sde

@kdruelle
Copy link

I think something happened during the deletion it removed the entry in SQLite db but they are remaining data in influxdb for the device.

if it finds some data in influxdb that are not linked to a device in SQLite it create a zombie device in the frontend. See here :

summaries[deviceWWN.(string)] = &models.DeviceSummary{}

@xinmans
Copy link
Author

xinmans commented Nov 15, 2024

could you please fix this bug
don't show the device data which not in SQLite db but in influxdb

@kdruelle
Copy link

kdruelle commented Nov 19, 2024

I'm not the maintainer I don't know if there is valid reason to do so.
But to deal with you issue you can delete data from influxDB for that device wwn with something like :

influx delete --bucket metrics --start 2014-11-19T10:14:57.843274736+01:00 --stop 2024-11-19T10:15:01.028711314+01:00 --predicate device_wwn=$YOUR_DEVICE_WWM --org scrutiny -t YOUR_TOKEN

influx delete --bucket metrics_weekly --start 2014-11-19T10:14:57.843274736+01:00 --stop 2024-11-19T10:15:01.028711314+01:00 --predicate device_wwn=$YOUR_DEVICE_WWM --org scrutiny -t YOUR_TOKEN

influx delete --bucket metrics_monthly --start 2014-11-19T10:14:57.843274736+01:00 --stop 2024-11-19T10:15:01.028711314+01:00 --predicate device_wwn=$YOUR_DEVICE_WWM --org scrutiny -t YOUR_TOKEN

influx delete --bucket metrics_yearly --start 2014-11-19T10:14:57.843274736+01:00 --stop 2024-11-19T10:15:01.028711314+01:00 --predicate device_wwn=$YOUR_DEVICE_WWM --org scrutiny -t YOUR_TOKEN

It worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants