-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
Unable to mount pihole database with ERROR: ATTACH DATABASE failed with SQL ERROR: database EXTERNAL_PIHOLE is already in use #513
Comments
Hi there! Thank you for the detailed description. I haven't tried mounting the whole directory and I know it should not make a difference, but can you try mounting the DB file directly? The new release bug should be fixed in the next release (#509). Thanks in advance, |
Oddly enough, mounting the DB directly instead fixed the issue. |
actually this didn't fix the issue so I'm reopening it (sorry). For some reason my page was cached and was appearing to show devices, but after reload this morning I'm back to just the router and docker image along with the unable to open file error in the log file - |
Did a bit of digging this morning and verified I can open the database in the docker container - |
I'm glad to hear that mounting the DB directly works - I'll close this issue as resolved then |
Mounting the db directly did not fix the issue unfortunately. |
I released a new version which might have fixed this issue. Would be great if you could give it a try. Thanks, |
Tried the new version with the same results as shown below. 07:08:47 [Plugins] Executing: SELECT n.hwaddr AS Object_PrimaryID, 'null' AS Object_SecondaryID, datetime() AS DateTime, na.ip AS Watched_Value1, n.lastQuery AS Watched_Value2, na.name AS Watched_Value3, n.macVendor AS Watched_Value4, 'null' AS Extra, n.hwaddr AS ForeignKey FROM EXTERNAL_PIHOLE.Network AS n LEFT JOIN EXTERNAL_PIHOLE.Network_Addresses AS na ON na.network_id = n.id WHERE n.hwaddr NOT LIKE 'ip-%' AND n.hwaddr <> '00:00:00:00:00:00' AND na.ip <> null; cd /etc cd pihole ~/containers/pialert/pialert/logs $ docker exec -it pialert sh sqlite3 /etc/pihole/pihole-FTL.dbSQLite version 3.40.1 2022-12-28 14:03:47 1|02:42:a3:aa:6e:10|br-72af1969fd3d|1701259680|0|0|| This is back to mounting the directory and the live build, not the dev with the build from two days ago. |
on my build I would like to note that it appears to open the db on the first run... but not on subsequent runs. Built on 2023-12-16 Pi-hole [v5.17.2] 13:39:39 [MAIN] waiting to start next loop
13:39:44 [2023-12-18 13:39:44-05:00] START Run: PIHOLE
13:39:44 [Plugins] Executing: SELECT n.hwaddr AS Object_PrimaryID, 'null' AS Object_SecondaryID, datetime() AS DateTime, na.ip AS Watched_Value1, n.lastQuery AS Watched_Value2, na.name AS Watched_Value3, n.macVendor AS Watched_Value4, 'null' AS Extra, n.hwaddr AS ForeignKey FROM EXTERNAL_PIHOLE.Network AS n LEFT JOIN EXTERNAL_PIHOLE.Network_Addresses AS na ON na.network_id = n.id WHERE n.hwaddr NOT LIKE 'ip-%' AND n.hwaddr <> '00:00:00:00:00:00' AND na.ip <> null;
13:39:44 [Plugins] No output received from the plugin PIHOLE - enable LOG_LEVEL=debug and check logs
13:39:44 [2023-12-18 13:39:44-05:00] END Run: PIHOLE
13:39:44 [MAIN] waiting to start next loop
13:39:49 [MAIN] waiting to start next loop
13:39:54 [MAIN] waiting to start next loop Then the next time I manually launch it or it runs on a schedule:
I also observed that when pialert was 'attached' to the database, I could not clear the network table in pihole, it said the database was locked. (Pihole couldn't get a lock on the database either). |
Hitting this issue also on the latest build. I've binded the file correctly and looking within the container I see the following:
I can cat the file, etc within the container also so I don't believe it's a permissions issue, but in the logs when I test this it fails consistently with:
|
I have the same Problem...
|
This should be fixed in the |
Updated to the latest dev version this morning and can confirm the devices now import successfully from pihole. so thank you so much for fixing that. However, the devices page header shows 70+ devices but connected only shows 2 devices, the pi and the router and selecting all devices doesn't actually show any of the devices at all. |
@Absoblogginlutely thanks for checking. Can you provide screenshots and logs to illustrate the issue more? It's possible the input from PiHole isn't processed correctly (e.g.: a device name may break the HTML code, or the validation for IP addresses etc.) so for that I need a bit more information to determine if there is a bug somewhere in the UI. |
Sure, my main screen looks like this - Log file with ip switched out for a.b.c. and waiting lines snipped attached. |
@Absoblogginlutely thanks for that. At first - can you make sure all your scans are running on the same schedule? For example in my case all scans run on a 5 minute interval. If you have different intervals you will get the pattern you see in the second screenshot. |
Scans are now synched up and the header of the main page now shows all devices online, which fixes part of the issue now, however the connected area is still blank where I'd expect it to show devices |
@Absoblogginlutely this is now probably a different issue and might be related to: https://github.com/jokob-sk/Pi.Alert/issues/523 Can you check that thread and the browser dev tools if the issues are similar and you have IP v6 addresses on your network? |
Released -> Closing |
Describe the issue
Pihole database is not importing into my configuration.
Pihole is running in another container on the same host. Pihole database is mapped and visible in the pialert container with ls -al /
Same issue in non dev container - I tried the dev image to see if that would make any difference.
FYI The dev version tells me I'm up to date but the main version tells me that i'm out of date running 20231110
As a result I just have my docker host and my router listed in the config and neither of the devices have a name listed.
Paste your
pialert.conf
(remove personal info)Paste your
docker-compose.yml
and.env
(remove personal info)docker-compose.yml
.env
Not used.
Screenshots
[If applicable, add screenshots to help explain your problem.]
Paste last few lines from
pialert.log
The text was updated successfully, but these errors were encountered: