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

After running successfully for months: Fatal error: Uncaught Error: Call to a member function fetchArray() on bool in /home/admin/BirdNET-Pi/scripts/todays_detections.php:43 #1193

Open
mkjn72 opened this issue Apr 30, 2024 · 2 comments

Comments

@mkjn72
Copy link

mkjn72 commented Apr 30, 2024

After running it very successfully for months I now see this error in the 'Today's detection' page:

Fatal error: Uncaught Error: Call to a member function fetchArray() on bool in /home/admin/BirdNET-Pi/scripts/todays_detections.php:43 Stack trace: #0 /home/admin/BirdNET-Pi/homepage/views.php(150): include() #1 {main} thrown in /home/admin/BirdNET-Pi/scripts/todays_detections.php on line 43

Have looked into this a bit. Did a completely new install and tried to migrate files according to this link https://github.com/mcguirepr89/BirdNET-Pi/wiki/Backup-and-Restore-the-Database

I find that the problem seems to be in de birds.db file. As soon as I copy this over the error re-occurs. But I do not have the expertise to invetigate this further. Is there a way to repair this DB file? Or how do I go about trying to resolve the issue. It would really be a shame to lose all historic recordings and information..

Many thanks in advance for any assistance you might offer

@christopherlock
Copy link

Bundled with BirdNET-Pi is a tool to help you administer the sqlite database. Can you see anything here? http://YOUR_PI_HOSTNAME.local/scripts/adminer.php?sqlite=

If so, try running the same SQL query that BirdNET-Pi is running. What happens when you run SELECT COUNT(*) FROM detections on the detections table?

Perhaps another thing to try is deleting some of the most recent data that might be corrupt? Hard to say without looking at the database.

@hestonhamilton
Copy link

hestonhamilton commented Jun 3, 2024

I am seeing the same error on my home page as of today -

Database is busy
Fatal error: Uncaught Error: Call to a member function execute() on bool in /home/admin/BirdNET-Pi/scripts/overview.php:32 Stack trace: #0 /home/admin/BirdNET-Pi/homepage/views.php(424): include() #1 {main} thrown in /home/admin/BirdNET-Pi/scripts/overview.php on line 32

I tried looking at the original DB but I didn't see anything unusual.

birdpi:~$ sqlite3 birds.db
SQLite version 3.34.1 2021-01-20 14:10:07
Enter ".help" for usage hints.
sqlite> .schema
CREATE TABLE detections (
  Date DATE,
  Time TIME,
  Sci_Name VARCHAR(100) NOT NULL,
  Com_Name VARCHAR(100) NOT NULL,
  Confidence FLOAT,
  Lat FLOAT,
  Lon FLOAT,
  Cutoff FLOAT,
  Week INT,
  Sens FLOAT,
  Overlap FLOAT,
  File_Name VARCHAR(100) NOT NULL);
CREATE INDEX "detections_Com_Name" ON "detections" ("Com_Name");
CREATE INDEX "detections_Date_Time" ON "detections" ("Date" DESC, "Time" DESC);
sqlite> PRAGMA integrity_check;
ok
sqlite> .tables
detections
sqlite> SELECT COUNT(*) FROM detections;
180177

I made a copy of the DB and deleted all rows in the detection table and the server is not producing the error on the empty copy.

I also tried creating a new DB and dumping/importing the data from the old DB, that seemed to work as well but I'm not sure why. It seems like some part of the DB must be corrupt but I'm not sure how to identify it. The integrity_check came back ok.

Update: The behavior seemed to persist even after today's detections were deleted from the DB. I deleted all recordings for the day in BirdSongs/{June-2024,Processed} but only when the files under BirdSongs/Extracted were also deleted did the analyzer seem to start behaving normally. Prior to this it was analyzing a single audio file and then hanging every time I restarted core services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants