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
427 stars 30 forks source link

[Error] Cannot update using one-liner command. Error: stepping, attempt to write a readonly database (8) #372

Closed AnsonCNS closed 1 month ago

AnsonCNS commented 1 month ago

Is there an existing issue for this?

Current Behavior

Hi there,

I'm getting the following error when trying to update PiAlert using the one-liner command bash -c "$(wget -qLO - https://github.com/leiweibau/Pi.Alert/raw/main/install/pialert_update.sh)". I have already disabled scans as suggested by #356.

############################################################
 Pi.Alert Update
############################################################
Sun 25 Aug 20:32:19 AEST 2024
Logfile: pialert_update_2024-08-25_20-32.log

- Checking Python...
Python 3 is installed on your system
mac-vendor-lookup is already installed
fritzconnection is already installed
routeros_api is already installed
pyunifi is already installed
- Stopping Pi.Alert...
No timeout is set. Pi.Alert restarts itself with the next scan after 10min.
arp-scan: no process found
/home/rpi4/pialert/back/pialert-cli: line 217: /home/rpi4/pialert/back/../config/setting_stoppialert: Permission denied

Pi.Alert v2024-08-09
---------------------------------------------------------
Executing user: rpi4

Test Reporting...
    Sending report by email...
    Skip PUSHSAFER...
    Skip PUSHOVER...
    Skip Telegram...
    Skip NTFY...
    Save report to file...

DONE!!!

Configured Pi.Alert scans are disabled
Error: stepping, attempt to write a readonly database (8)

Environment

Raspberry Pi 4

Anything else?

No response

leiweibau commented 1 month ago

You can do the following:

sudo rm /home/rpi4/pialert/config/setting_stoppialert
cd /home/rpi4/pialert/back/
./pialert-cli disable_scan
sudo killall arp-scan

Wait a few seconds. In the case that ICMP monitoring or web service monitoring is active, you should check the status box (settings page) of Pi.Alert to see if the scan is still active. If no scan is active here, run the updater again.

bash -c "$(wget -qLO - https://github.com/leiweibau/Pi.Alert/raw/main/install/pialert_update.sh)"

With the instructions on the Help / FAQ page, most problems should be able to be avoided.

instuctions
AnsonCNS commented 1 month ago

Thanks for the quick reply.

I followed your instructions and the readonly error went away when running the update command.

However, it showed some errors about cannot clean up previous version. (sorry I was unable to screenshot the error message)

I then tried to rerun the update command, but I get the following error.

Sun 25 Aug 22:03:07 AEST 2024
Logfile: pialert_update_2024-08-25_22-03.log

- Checking Python...
Python 3 is installed on your system
mac-vendor-lookup is already installed
fritzconnection is already installed
routeros_api is already installed
pyunifi is already installed
- Stopping Pi.Alert...
environment: line 86: /home/rpi4/pialert/back/pialert-cli: No such file or directory

The back directory is now gone and I cannot access the PiAlert page (it gives a 403 Forbidden error)

leiweibau commented 1 month ago

The installation is now corrupted. Without knowing about the errors, I advise you to take the following steps.

cd /home/rpi4/pialert/back/
./pialert-cli disable_scan 30
AnsonCNS commented 1 month ago

That worked. Thanks heaps!