ravenclaw900 / DietPi-Dashboard

A lightweight, standalone web dashboard for DietPi
GNU General Public License v3.0
127 stars 17 forks source link

service tabs is empty #891

Closed GitzJoey closed 2 weeks ago

GitzJoey commented 2 months ago

hi just recently (after dietpi upgrade 9.6.1 the service tab of dashboard suddenly become blank image

here's the console output image

tested in Firefox and Edge, both yield the same

from journalctl image

MichaIng commented 1 month ago

Is this the nightly or stable version of dietpi-dashboard? I checked the code but could not find where this error message is produced. Best match is: https://github.com/ravenclaw900/DietPi-Dashboard/blob/main/src/page_handlers.rs#L240

However, that would mean that it tried to run systemctl get failed name, while it should have done something like systemctl start apache2 if you use start/stop services with this page.

Also not sure where the frontent calls eval(), but it is generated.

Also, a DietPi update does not update the dashboard (unless you did not have v0.6.2 yet, which as a security patch). Dud you try to restart it already?

systemctl restart dietpi-dashboard
GitzJoey commented 1 month ago

based on the footer image

and yes restart, even reboot already done but still empty

this might be the source, i'm not sure its usefull image

i found that this issue is caused when Vue.js devtools addons is enabled image

I also tried to disable all the addons in my FF the error is gone but the services stilll empty image

tried in edge (without any addons) also failed image

I tried to turn on debug, i only have incoming body is empty image

somehow the websocket for service is returning empty array image

GitzJoey commented 1 month ago

I found the issue, is because dietpi-services status returning something like this image

once i fix the fail2ban, and running properly and the dietpi-services status returning without any error, the websocket now returning array

would be good if can catch this or maybe returning some error messages

can close this issue, thanks for the attentions

MichaIng commented 1 month ago

Oh, so it does not gracefully deal with the status output for failed services. But also, the output indeed looks weird. I was expecting it to show "fail2ban failed (Result: exit-code)" on the first line, and this "x fail2ban.service - Fail2Ban Service" stuff on a next line. I guess that way, also the dashboard would catch it properly. Basically some characters, including the newline, are missing.

... checking back the dietpi-services code: Indeed the shortened line is replaced with the full output in case of a failure, instead of appending the full output. For the dashboard, it would make sense to append the full output, so that the dashboard can scrape the "correct" lines by their prefix. Or better some machine-readable flag like we added it for dietpi-software, with a more consistent and simpler to parse output.