leiweibau / Pi.Alert

Scan the devices connected to your WIFI / LAN and alert you the connection of unknown devices. It also warns if a "always connected" device disconnects. In addition, it is possible to check web services for availability. For this purpose HTTP status codes and the response time of the service are evaluated.
https://leiweibau.net
GNU General Public License v3.0
342 stars 25 forks source link

Permissions being reset on database #250

Closed Vorteth closed 5 months ago

Vorteth commented 5 months ago

Twice now the database permissions were reset which caused it to stop processing updates to the database.

I noticed it this morning and looking at the events log it seemed to s top on 1/28th at 11:45pm since that is the last event I see before it reconnected today after fixing the permissions.

I had originally thought it was perhaps the updates that did it, but that timeline doesn't match up.

image

Vorteth commented 5 months ago

For the record running the permissions fix fixed it, more hoping you have an idea of WHY it might be breaking.

I did add a second > into the crontab for the logging so I can see a bigger log and hopefully pinpoint where the failure is happening.

leiweibau commented 5 months ago

The status box on the settings page should primarily serve as an indicator for the correct permissions. Here you will find the line with the date of the last change to the database file. This should be as up-to-date as possible, i.e. within the 2-3 minute time window of the last scan. Neither in the backend nor in the frontend is there a function that changes the file permission of the database. For now, I can only imagine an external influence. It would be interesting to know what the changed permissions are. I will have another look at the code later to check whether I can offer you a quick fix if the error recurs.

leiweibau commented 5 months ago

Since I have not yet experienced this error and cannot reproduce it, you are welcome to test this extended pialert.py version. Commit

pialert.py This file must be saved in the directory $HOME/pialert/back/. Make a backup of the old version first.

Vorteth commented 5 months ago

Thank you for looking, I'll take a look at that.

I agree, I have no idea what caused it so I'm keeping a very close eye on everything.

I'll let you if I see it again.