Skip to content

Unable to mount pihole database with ERROR: ATTACH DATABASE failed with SQL ERROR: database EXTERNAL_PIHOLE is already in use #513

@Absoblogginlutely

Description

@Absoblogginlutely

Describe the issue

When submitting an issue ❗enable debug❗ and have a look at the docs

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

# ls -al /etc/pihole/pihole-FTL.db
-rw-rw-r-- 1 999 pi 16306176 Dec  2 10:04 /etc/pihole/pihole-FTL.db

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)

#-----------------AUTOGENERATED FILE-----------------#
#                                                    #
#         Generated:  2023-12-02_09-47-35            #
#                                                    #
#   Config file for the LAN intruder detection app:  #
#      https://github.com/jokob-sk/Pi.Alert          #
#                                                    #
#-----------------AUTOGENERATED FILE-----------------#


# General
#---------------------------
LOG_LEVEL='debug'
LOG_LEVEL__metadata="{}"
TIMEZONE='America/New_York'
TIMEZONE__metadata="{}"
PLUGINS_KEEP_HIST=250
PLUGINS_KEEP_HIST__metadata="{}"
PIALERT_WEB_PROTECTION=True
PIALERT_WEB_PROTECTION__metadata="{}"
PIALERT_WEB_PASSWORD='e<snip>9'
PIALERT_WEB_PASSWORD__metadata="{}"
INCLUDED_SECTIONS=['new_devices','down_devices','events']
INCLUDED_SECTIONS__metadata="{}"
REPORT_DASHBOARD_URL='http://pi.alert:20211'
REPORT_DASHBOARD_URL__metadata="{}"
DIG_GET_IP_ARG='-4 myip.opendns.com @resolver1.opendns.com'
DIG_GET_IP_ARG__metadata="{}"
UI_LANG='English'
UI_LANG__metadata="{}"
UI_PRESENCE=['online','offline','archived']
UI_PRESENCE__metadata="{}"
DAYS_TO_KEEP_EVENTS=90
DAYS_TO_KEEP_EVENTS__metadata="{}"
HRS_TO_KEEP_NEWDEV=0
HRS_TO_KEEP_NEWDEV__metadata="{}"
DBCLNP_NOTIFI_HIST=100
DBCLNP_NOTIFI_HIST__metadata="{}"
API_CUSTOM_SQL='SELECT * FROM Devices WHERE dev_PresentLastScan = 0'
API_CUSTOM_SQL__metadata="{}"
NETWORK_DEVICE_TYPES=['AP','Gateway','Firewall','Hypervisor','Powerline','Switch','WLAN','PLC','Router','USB LAN Adapter','USB WIFI Adapter','Internet']
NETWORK_DEVICE_TYPES__metadata="{}"


# ARPSCAN
#---------------------------
SCAN_SUBNETS=['192.168.29.0/24 --interface=eth0']
SCAN_SUBNETS__metadata="{}"
ARPSCAN_RUN='disabled'
ARPSCAN_RUN__metadata="{\"function\": \"RUN\", \"type\": \"text.select\", \"default_value\": \"schedule\", \"options\": [\"disabled\", \"once\", \"schedule\", \"always_after_scan\", \"on_new_device\"], \"localized\": [\"name\", \"description\"], \"events\": [\"run\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"When to run\"}, {\"language_code\": \"es_es\", \"string\": \"Cuando ejecutar\"}, {\"language_code\": \"de_de\", \"string\": \"Wann ausf\\u00fchren\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Specify when your Network-discovery scan will run. Typical setting would be <code>schedule</code> and then you specify a cron-like schedule in the <a href=\\\"#ARPSCAN_RUN_SCHD\\\"><code>ARPSCAN_RUN_SCHD</code>setting</a> \"}, {\"language_code\": \"es_es\", \"string\": \"Especifique cu\\u00e1ndo se ejecutar\\u00e1 su an\\u00e1lisis de descubrimiento de red. La configuraci\\u00f3n t\\u00edpica ser\\u00eda <code>schedule</code> y luego se especifica una programaci\\u00f3n similar a cron en la configuraci\\u00f3n <a href=\\\"#ARPSCAN_RUN_SCHD\\\"><code>ARPSCAN_RUN_SCHD</code></a> \"}, {\"language_code\": \"de_de\", \"string\": \"Ausw\\u00e4hlen wann der Netzwerkscan laufen soll. Typischerweise wird <code>schedule</code> ausgew\\u00e4hlt und ein cron-Intervall in der <a href=\\\"#ARPSCAN_RUN_SCHD\\\"><code>ARPSCAN_RUN_SCHD</code>Einstellung</a> gesetzt.\"}]}"
ARPSCAN_CMD='python3 /home/pi/pialert/front/plugins/arp_scan/script.py userSubnets={subnets}'
ARPSCAN_CMD__metadata="{\"function\": \"CMD\", \"type\": \"readonly\", \"default_value\": \"python3 /home/pi/pialert/front/plugins/arp_scan/script.py userSubnets={subnets}\", \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Command\"}, {\"language_code\": \"es_es\", \"string\": \"Comando\"}, {\"language_code\": \"de_de\", \"string\": \"Befehl\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Command to run. This should not be changed\"}, {\"language_code\": \"es_es\", \"string\": \"Comando para ejecutar. Esto no debe ser cambiado\"}, {\"language_code\": \"de_de\", \"string\": \"Auszuf\\u00fchrender Befehl. Dieser sollte nicht ge\\u00e4ndert werden\"}]}"
ARPSCAN_RUN_TIMEOUT=300
ARPSCAN_RUN_TIMEOUT__metadata="{\"function\": \"RUN_TIMEOUT\", \"type\": \"integer\", \"default_value\": 300, \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Run timeout\"}, {\"language_code\": \"es_es\", \"string\": \"Tiempo l\\u00edmite de ejecuci\\u00f3n\"}, {\"language_code\": \"de_de\", \"string\": \"Zeitlimit\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Maximum time in seconds to wait for the script to finish. If this time is exceeded the script is aborted.\"}, {\"language_code\": \"es_es\", \"string\": \"Tiempo m\\u00e1ximo en segundos para esperar a que finalice el script. Si se supera este tiempo, se cancela el script.\"}, {\"language_code\": \"de_de\", \"string\": \"Maximale Zeit in Sekunden, die auf den Abschluss des Skripts gewartet werden soll. Bei \\u00dcberschreitung dieser Zeit wird das Skript abgebrochen.\"}]}"
ARPSCAN_RUN_SCHD='*/5 * * * *'
ARPSCAN_RUN_SCHD__metadata="{\"function\": \"RUN_SCHD\", \"type\": \"text\", \"default_value\": \"*/5 * * * *\", \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Schedule\"}, {\"language_code\": \"es_es\", \"string\": \"Schedule\"}, {\"language_code\": \"de_de\", \"string\": \"Zeitplan\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Only enabled if you select <code>schedule</code> in the <a href=\\\"#ARPSCAN_RUN\\\"><code>ARPSCAN_RUN</code> setting</a>. Make sure you enter the schedule in the correct cron-like format (e.g. validate at <a href=\\\"https://crontab.guru/\\\" target=\\\"_blank\\\">crontab.guru</a>). For example entering <code>*/3 * * * *</code> will run the scan every 3 minutes. Will be run NEXT time the time passes. <br/> It's recommended to use the same schedule interval for all plugins responsible for discovering new devices.\"}, {\"language_code\": \"es_es\", \"string\": \"Solo est\\u00e1 habilitado si selecciona <code>schedule</code> en la configuraci\\u00f3n <a href=\\\"#ARPSCAN_RUN\\\"><code>ARPSCAN_RUN</code></a>. Aseg\\u00farese de ingresar la programaci\\u00f3n en el formato similar a cron correcto (por ejemplo, valide en <a href=\\\"https://crontab.guru/\\\" target=\\\"_blank\\\">crontab.guru</a>). Por ejemplo, ingresar <code>*/3 * * * *</code> ejecutar\\u00e1 el escaneo cada 3 minutos. Se ejecutar\\u00e1 la PR\\u00d3XIMA vez que pase el tiempo. <br/> Se recomienda utilizar el mismo intervalo de programaci\\u00f3n para todos los complementos que analizan su red.\"}, {\"language_code\": \"de_de\", \"string\": \"Nur aktiv, wenn <code>schedule</code> in der <a href=\\\"#ARPSCAN_RUN\\\"><code>ARPSCAN_RUN</code> Einstellung</a> ausgew\\u00e4hlt wurde. Sichergehen, dass das Intervall in einem korrekten cron-\\u00e4hnlichen Format angegeben wurde (z.B. auf <a href=\\\"https://crontab.guru/\\\" target=\\\"_blank\\\">crontab.guru</a> testen). <code>*/3 * * * *</code> w\\u00fcrde den Scan alle 3 Minuten starten. Wird erst beim N\\u00c4CHSTEN Intervall ausgef\\u00fchrt. <br/>Es wird empfohlen, das Intervall aller Plugins, welche nach neuen Ger\\u00e4ten suchen, auf den gleichen Wert zu setzen.\"}]}"
ARPSCAN_WATCH=['Watched_Value1','Watched_Value2']
ARPSCAN_WATCH__metadata="{\"function\": \"WATCH\", \"type\": \"text.multiselect\", \"default_value\": [\"Watched_Value1\", \"Watched_Value2\"], \"options\": [\"Watched_Value1\", \"Watched_Value2\", \"Watched_Value3\", \"Watched_Value4\"], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Watched\"}, {\"language_code\": \"es_es\", \"string\": \"Watched\"}, {\"language_code\": \"de_de\", \"string\": \"\\u00dcberwacht\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Send a notification if selected values change. Use <code>CTRL + Click</code> to select/deselect. <ul> <li><code>Watched_Value1</code> is IP</li><li><code>Watched_Value2</code> is Vendor</li><li><code>Watched_Value3</code> is Interface </li><li><code>Watched_Value4</code> is N/A </li></ul>\"}, {\"language_code\": \"es_es\", \"string\": \"Env\\u00eda una notificaci\\u00f3n si los valores seleccionados cambian. Utilice <code>CTRL + clic</code> para seleccionar/deseleccionar. <ul> <li><code>Valor_observado1</code> es IP</li><li><code>Valor_observado2</code> es Proveedor</li><li><code>Valor_observado3</code> es Interfaz </li><li><code>Valor_observado4</code> es N/A </li></ul>\"}, {\"language_code\": \"de_de\", \"string\": \"Sende eine Benachrichtigung, wenn ein ausgw\\u00e4hlter Wert sich \\u00e4ndert. <code>STRG + klicken</code> zum aus-/abw\\u00e4hlen. <ul> <li><code>Watched_Value1</code> ist die IP</li><li><code>Watched_Value2</code> ist der Hersteller</li><li><code>Watched_Value3</code> ist das Interface </li><li><code>Watched_Value4</code> ist nicht in Verwendung </li></ul>\"}]}"
ARPSCAN_REPORT_ON=['new']
ARPSCAN_REPORT_ON__metadata="{\"function\": \"REPORT_ON\", \"type\": \"text.multiselect\", \"default_value\": [\"new\"], \"options\": [\"new\", \"watched-changed\", \"watched-not-changed\", \"missing-in-last-scan\"], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Report on\"}, {\"language_code\": \"es_es\", \"string\": \"Informar sobre\"}, {\"language_code\": \"de_de\", \"string\": \"Benachrichtige wenn\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"When should notification be sent out.\"}, {\"language_code\": \"es_es\", \"string\": \"Cu\\u00e1ndo debe enviarse una notificaci\\u00f3n.\"}, {\"language_code\": \"de_de\", \"string\": \"Wann Benachrichtigungen gesendet werden sollen.\"}]}"
ARPSCAN_ARGS='sudo arp-scan --ignoredups --retry=6'
ARPSCAN_ARGS__metadata="{\"function\": \"ARGS\", \"type\": \"text\", \"default_value\": \"sudo arp-scan --ignoredups --retry=6\", \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Arguments\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Arguments to run arps-scan with. Recommended and tested only with the setting: <br/> <code>sudo arp-scan --ignoredups --retry=6</code>.\"}]}"


# PIHOLE
#---------------------------
PIHOLE_RUN='schedule'
PIHOLE_RUN__metadata="{\"function\": \"RUN\", \"events\": [\"run\"], \"type\": \"text.select\", \"default_value\": \"disabled\", \"options\": [\"disabled\", \"once\", \"schedule\", \"always_after_scan\", \"on_new_device\"], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"When to run\"}, {\"language_code\": \"es_es\", \"string\": \"Cuando ejecutar\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Specify when your PiHole device import from the PiHole databse will run. The typical setting would be <code>schedule</code> and then you specify a cron-like schedule in the <a href=\\\"#PIHOLE_RUN_SCHD\\\"><code>PIHOLE_RUN_SCHD</code>setting</a>. If enabled, you must map the pihole db into your container to the <code>:/etc/pihole/pihole-FTL.db</code> mount path as specified in the <code>DB_PATH</code> setting.\"}, {\"language_code\": \"es_es\", \"string\": \"Especifique cu\\u00e1ndo se ejecutar\\u00e1 la importaci\\u00f3n de su dispositivo PiHole desde la base de datos de PiHole. La configuraci\\u00f3n t\\u00edpica ser\\u00eda <code>schedule</code> y luego especifica una programaci\\u00f3n similar a cron en la configuraci\\u00f3n <a href=\\\"#PIHOLE_RUN_SCHD\\\"><code>PIHOLE_RUN_SCHD</code></a>. Si est\\u00e1 habilitado, debe asignar la base de datos pihole en su contenedor a la ruta de montaje <code>:/etc/pihole/pihole-FTL.db</code> como se especifica en la configuraci\\u00f3n <code>DB_PATH</code>.\"}]}"
PIHOLE_CMD='SELECT n.hwaddr AS Object_PrimaryID, {s-quote}null{s-quote} 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, {s-quote}null{s-quote} 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 {s-quote}ip-%{s-quote} AND n.hwaddr <> {s-quote}00:00:00:00:00:00{s-quote} AND na.ip <> null;'
PIHOLE_CMD__metadata="{\"function\": \"CMD\", \"type\": \"text\", \"default_value\": \"SELECT n.hwaddr AS Object_PrimaryID, {s-quote}null{s-quote} 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, {s-quote}null{s-quote} 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 {s-quote}ip-%{s-quote} AND n.hwaddr <> {s-quote}00:00:00:00:00:00{s-quote} AND na.ip <> null;\", \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"SQL to run\"}, {\"language_code\": \"es_es\", \"string\": \"Consulta SQL\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"This SQL query is used to populate the coresponding UI tables under the Plugins section. This particular one selects data from a mapped PiHole SQLite database and maps it to the corresponding Plugin columns.\"}, {\"language_code\": \"es_es\", \"string\": \"Esta consulta SQL se usa para completar las tablas de IU correspondientes en la secci\\u00f3n Complementos. Este en particular selecciona datos de una base de datos PiHole SQLite asignada y los asigna a las columnas correspondientes del complemento.\"}]}"
PIHOLE_DB_PATH='/etc/pihole/pihole-FTL.db'
PIHOLE_DB_PATH__metadata="{\"function\": \"DB_PATH\", \"type\": \"text\", \"default_value\": \"/etc/pihole/pihole-FTL.db\", \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"DB Path\"}, {\"language_code\": \"es_es\", \"string\": \"Ruta de la base de datos\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Required setting for the <code>sqlite-db-query</code> plugin type. Is used to mount an external SQLite database and execute the SQL query stored in the <code>CMD</code> setting.\"}, {\"language_code\": \"es_es\", \"string\": \"Configuraci\\u00f3n requerida para el tipo de complemento <code>sqlite-db-query</code>. Se utiliza para montar una base de datos SQLite externa y ejecutar la consulta SQL almacenada en la configuraci\\u00f3n <code>CMD</code>.\"}]}"
PIHOLE_RUN_SCHD='*/30 * * * *'
PIHOLE_RUN_SCHD__metadata="{\"function\": \"RUN_SCHD\", \"type\": \"text\", \"default_value\": \"*/30 * * * *\", \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Schedule\"}, {\"language_code\": \"es_es\", \"string\": \"Programar\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Only enabled if you select <code>schedule</code> in the <a href=\\\"#ARPSCAN_RUN\\\"><code>ARPSCAN_RUN</code> setting</a>. Make sure you enter the schedule in the correct cron-like format (e.g. validate at <a href=\\\"https://crontab.guru/\\\" target=\\\"_blank\\\">crontab.guru</a>). For example entering <code>*/30 * * * *</code> will run the scan every 30 minutes. Will be run NEXT time the time passes. <br/> It's recommended to use the same schedule interval for all plugins responsible for discovering new devices.\"}, {\"language_code\": \"es_es\", \"string\": \"Solo est\\u00e1 habilitado si selecciona <code>schedule</code> en la configuraci\\u00f3n <a href=\\\"#ARPSCAN_RUN\\\"><code>ARPSCAN_RUN</code></a>. Aseg\\u00farese de ingresar la programaci\\u00f3n en el formato similar a cron correcto (por ejemplo, valide en <a href=\\\"https://crontab.guru/\\\" target=\\\"_blank\\\">crontab.guru</a>). Por ejemplo, ingresar <code>*/30 * * * *</code> ejecutar\\u00e1 el escaneo cada 30 minutos. Se ejecutar\\u00e1 la PR\\u00d3XIMA vez que pase el tiempo. <br/> Se recomienda utilizar el mismo intervalo de programaci\\u00f3n para todos los complementos que analizan su red.\"}]}"
PIHOLE_WATCH=['Watched_Value1','Watched_Value2']
PIHOLE_WATCH__metadata="{\"function\": \"WATCH\", \"type\": \"text.multiselect\", \"default_value\": [\"Watched_Value1\", \"Watched_Value2\"], \"options\": [\"Watched_Value1\", \"Watched_Value2\", \"Watched_Value3\", \"Watched_Value4\"], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Watched\"}, {\"language_code\": \"es_es\", \"string\": \"Visto\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Send a notification if selected values change. Use <code>CTRL + Click</code> to select/deselect. <ul> <li><code>Watched_Value1</code> is IP</li><li><code>Watched_Value2</code> is Last Query</li><li><code>Watched_Value3</code> is Name </li><li><code>Watched_Value4</code> is N/A </li></ul>\"}, {\"language_code\": \"es_es\", \"string\": \"Env\\u00ede una notificaci\\u00f3n si los valores seleccionados cambian. Utilice <code>CTRL + clic</code> para seleccionar/deseleccionar. <ul> <li><code>Watched_Value1</code> es IP</li><li><code>Watched_Value2</code> es Proveedor</li><li><code>Watched_Value3</code> is es Interfaz</li><li><code>Watched_Value4</code> es N/A</li></ul>\"}]}"
PIHOLE_REPORT_ON=['new']
PIHOLE_REPORT_ON__metadata="{\"function\": \"REPORT_ON\", \"type\": \"text.multiselect\", \"default_value\": [\"new\"], \"options\": [\"new\", \"watched-changed\", \"watched-not-changed\", \"missing-in-last-scan\"], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Report on\"}, {\"language_code\": \"es_es\", \"string\": \"Informar sobre\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"When should notification be sent out.\"}, {\"language_code\": \"es_es\", \"string\": \"\\u00bfCu\\u00e1ndo se debe enviar la notificaci\\u00f3n?.\"}]}"


# UNDIS
#---------------------------
UNDIS_RUN='disabled'
UNDIS_RUN__metadata="{\"function\": \"RUN\", \"events\": [\"run\"], \"type\": \"text.select\", \"default_value\": \"disabled\", \"options\": [\"disabled\", \"once\", \"always_after_scan\"], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"When to run\"}, {\"language_code\": \"es_es\", \"string\": \"Cu\\u00e1ndo ejecuta\"}, {\"language_code\": \"de_de\", \"string\": \"Wann ausf\\u00fchren\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"When enabled, ONCE is the preferred option. It runs at startup and after every save of the config here.<br> Changes will only show in the devices <b> after the next scan!</b>\"}, {\"language_code\": \"es_es\", \"string\": \"Cuando est\\u00e1 habilitado, ONCE es la opci\\u00f3n preferida. Se ejecuta al inicio y despu\\u00e9s de cada guardado de la configuraci\\u00f3n aqu\\u00ed.<br> \\u00a1Los cambios solo se mostrar\\u00e1n en los dispositivos <b> despu\\u00e9s del pr\\u00f3ximo escaneo!</b>\"}, {\"language_code\": \"de_de\", \"string\": \"Wenn dieses Plugin aktiviert ist, ist <code>once</code> die bevorzugte Methode. Das Plugin wird dann bei jedem Start und nach jedem Speichern der Einstellungen ausgef\\u00fchrt.</br>\\u00c4nderungen scheinen in den Ger\\u00e4ten erst <b>nach dem n\\u00e4chsten Scan</b> auf!\"}]}"
UNDIS_CMD='python3 /home/pi/pialert/front/plugins/undiscoverables/script.py devices={devices}'
UNDIS_CMD__metadata="{\"function\": \"CMD\", \"type\": \"text\", \"default_value\": \"python3 /home/pi/pialert/front/plugins/undiscoverables/script.py devices={devices}\", \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Command\"}, {\"language_code\": \"es_es\", \"string\": \"Comando\"}, {\"language_code\": \"de_de\", \"string\": \"Befehl\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Command to run. This can not be changed\"}, {\"language_code\": \"es_es\", \"string\": \"Comando a ejecutar. Esto no se puede cambiar\"}, {\"language_code\": \"de_de\", \"string\": \"Befehl zum Ausf\\u00fchren. Dies kann nicht ge\\u00e4ndert werden\"}]}"
UNDIS_RUN_TIMEOUT=10
UNDIS_RUN_TIMEOUT__metadata="{\"function\": \"RUN_TIMEOUT\", \"type\": \"integer\", \"default_value\": 10, \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Run timeout\"}, {\"language_code\": \"es_es\", \"string\": \"Tiempo l\\u00edmite de ejecuci\\u00f3n\"}, {\"language_code\": \"de_de\", \"string\": \"Zeitlimit\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Maximum time in seconds to wait for the script to finish. If this time is exceeded the script is aborted.\"}, {\"language_code\": \"es_es\", \"string\": \"Tiempo m\\u00e1ximo en segundos para esperar a que finalice el script. Si se supera este tiempo, el script se cancela.\"}, {\"language_code\": \"de_de\", \"string\": \"Maximale Zeit in Sekunden, die auf den Abschluss des Skripts gewartet werden soll. Bei \\u00dcberschreitung dieser Zeit wird das Skript abgebrochen.\"}]}"
UNDIS_WATCH='[]'
UNDIS_WATCH__metadata="{\"function\": \"WATCH\", \"type\": \"readonly\", \"default_value\": [], \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Watched\"}, {\"language_code\": \"es_es\", \"string\": \"Visto\"}, {\"language_code\": \"de_de\", \"string\": \"\\u00dcberwacht\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Undiscoverable Devices can not change their status, no watch is enabled.\"}, {\"language_code\": \"es_es\", \"string\": \"Los dispositivos no detectables no pueden cambiar su estado, ning\\u00fan reloj est\\u00e1 habilitado.\"}, {\"language_code\": \"de_de\", \"string\": \"Status von nicht erkennbaren Ger\\u00e4ten k\\u00f6nnen sich nicht \\u00e4ndern, keine \\u00dcberwachung aktiviert.\"}]}"
UNDIS_REPORT_ON='[]'
UNDIS_REPORT_ON__metadata="{\"function\": \"REPORT_ON\", \"type\": \"readonly\", \"default_value\": [], \"options\": [\"new\", \"watched-changed\", \"watched-not-changed\", \"missing-in-last-scan\"], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Report on\"}, {\"language_code\": \"es_es\", \"string\": \"Informar sobre\"}, {\"language_code\": \"de_de\", \"string\": \"Benachrichtige wenn\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"No notifications will be sent.\"}, {\"language_code\": \"es_es\", \"string\": \"No se enviar\\u00e1n notificaciones.\"}, {\"language_code\": \"de_de\", \"string\": \"Keine Benachrichtigungen werden versendet.\"}]}"
UNDIS_devices_to_import=['dummy_router']
UNDIS_devices_to_import__metadata="{\"function\": \"devices_to_import\", \"type\": \"list\", \"default_value\": [\"dummy_router\"], \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"UnDiscoverable Devices\"}, {\"language_code\": \"es_es\", \"string\": \"Dispositivo no detectable\"}, {\"language_code\": \"de_de\", \"string\": \"Nicht erkennbare Ger\\u00e4te\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Devices to be added to the devices list.\"}, {\"language_code\": \"es_es\", \"string\": \"Dispositivos que se a\\u00f1adir\\u00e1n a la lista de dispositivos.\"}, {\"language_code\": \"de_de\", \"string\": \"Ger\\u00e4te, welche der Ger\\u00e4teliste hinzugef\\u00fcgt werden.\"}]}"


# MAINT
#---------------------------
MAINT_RUN='schedule'
MAINT_RUN__metadata="{\"function\": \"RUN\", \"events\": [\"run\"], \"type\": \"text.select\", \"default_value\": \"schedule\", \"options\": [\"disabled\", \"once\", \"schedule\", \"always_after_scan\", \"on_new_device\"], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"When to run\"}, {\"language_code\": \"es_es\", \"string\": \"Cu\\u00e1ndo ejecutar\"}, {\"language_code\": \"de_de\", \"string\": \"Wann laufen\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"When the maintenance tasks should run. A daily or weekly <code>SCHEDULE</code> is a good option.\"}]}"
MAINT_CMD='python3 /home/pi/pialert/front/plugins/maintenance/maintenance.py'
MAINT_CMD__metadata="{\"function\": \"CMD\", \"type\": \"readonly\", \"default_value\": \"python3 /home/pi/pialert/front/plugins/maintenance/maintenance.py\", \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Command\"}, {\"language_code\": \"es_es\", \"string\": \"Comando\"}, {\"language_code\": \"de_de\", \"string\": \"Befehl\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Command to run. This can not be changed\"}, {\"language_code\": \"es_es\", \"string\": \"Comando a ejecutar. Esto no se puede cambiar\"}, {\"language_code\": \"de_de\", \"string\": \"Befehl zum Ausf\\u00fchren. Dies kann nicht ge\\u00e4ndert werden\"}]}"
MAINT_RUN_SCHD='0 2 * * 3'
MAINT_RUN_SCHD__metadata="{\"function\": \"RUN_SCHD\", \"type\": \"text\", \"default_value\": \"0 2 * * 3\", \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Schedule\"}, {\"language_code\": \"es_es\", \"string\": \"Schedule\"}, {\"language_code\": \"de_de\", \"string\": \"Schedule\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Only enabled if you select <code>schedule</code> in the <a href=\\\"#MAINT_RUN\\\"><code>MAINT_RUN</code> setting</a>. Make sure you enter the schedule in the correct cron-like format (e.g. validate at <a href=\\\"https://crontab.guru/\\\" target=\\\"_blank\\\">crontab.guru</a>). For example entering <code>0 4 * * *</code> will run the scan after 4 am in the <a onclick=\\\"toggleAllSettings()\\\" href=\\\"#TIMEZONE\\\"><code>TIMEZONE</code> you set above</a>. Will be run NEXT time the time passes.\"}, {\"language_code\": \"es_es\", \"string\": \"Solo est\\u00e1 habilitado si selecciona <code>schedule</code> en la configuraci\\u00f3n <a href=\\\"#MAINT_RUN\\\"><code>MAINT_RUN</code></a>. Aseg\\u00farese de ingresar la programaci\\u00f3n en el formato similar a cron correcto (por ejemplo, valide en <a href=\\\"https://crontab.guru/\\\" target=\\\"_blank\\\">crontab.guru</a>). Por ejemplo, ingresar <code>0 4 * * *</code> ejecutar\\u00e1 el escaneo despu\\u00e9s de las 4 a.m. en el <a onclick=\\\"toggleAllSettings()\\\" href=\\\"#TIMEZONE\\\"><code>TIMEZONE</ c\\u00f3digo> que configur\\u00f3 arriba</a>. Se ejecutar\\u00e1 la PR\\u00d3XIMA vez que pase el tiempo.\"}, {\"language_code\": \"de_de\", \"string\": \"Nur aktiviert, wenn Sie <code>schedule</code> in der <a href=\\\"#CSVBCKP_RUN\\\"><code>CSVBCKP_RUN</code>-Einstellung</a> ausw\\u00e4hlen. Stellen Sie sicher, dass Sie den Zeitplan im richtigen Cron-\\u00e4hnlichen Format eingeben (z. B. validieren unter <a href=\\\"https://crontab.guru/\\\" target=\\\"_blank\\\">crontab.guru</a>). Wenn Sie beispielsweise <code>0 4 * * *</code> eingeben, wird der Scan nach 4 Uhr morgens in der <a onclick=\\\"toggleAllSettings()\\\" href=\\\"#TIMEZONE\\\"><code>TIMEZONE</ ausgef\\u00fchrt. Code> den Sie oben festgelegt haben</a>. Wird das N\\u00c4CHSTE Mal ausgef\\u00fchrt, wenn die Zeit vergeht.\"}]}"
MAINT_RUN_TIMEOUT=30
MAINT_RUN_TIMEOUT__metadata="{\"function\": \"RUN_TIMEOUT\", \"type\": \"integer\", \"default_value\": 30, \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Run timeout\"}, {\"language_code\": \"es_es\", \"string\": \"Tiempo l\\u00edmite de ejecuci\\u00f3n\"}, {\"language_code\": \"de_de\", \"string\": \"Zeit\\u00fcberschreitung\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"Maximum time in seconds to wait for the script to finish. If this time is exceeded the script is aborted.\"}, {\"language_code\": \"es_es\", \"string\": \"Tiempo m\\u00e1ximo en segundos para esperar a que finalice el script. Si se supera este tiempo, el script se cancela.\"}, {\"language_code\": \"de_de\", \"string\": \"Maximale Zeit in Sekunden, die auf den Abschluss des Skripts gewartet werden soll. Bei \\u00dcberschreitung dieser Zeit wird das Skript abgebrochen.\"}]}"
MAINT_LOG_LENGTH=250000
MAINT_LOG_LENGTH__metadata="{\"function\": \"LOG_LENGTH\", \"type\": \"integer\", \"default_value\": 250000, \"options\": [], \"localized\": [\"name\", \"description\"], \"name\": [{\"language_code\": \"en_us\", \"string\": \"Log length\"}], \"description\": [{\"language_code\": \"en_us\", \"string\": \"How many last <code>pialert.log</code> lines to keep. If <code>LOG_LEVEL</code> is set to <code>debug</code> the app generates about 10000 lines per hour, so when debugging an issue the recommended setting should cover the bug occurence timeframe. For example for a bug with a 3 day periodical appearence the value <code>1000000</code> should be sufficient. Setting this value to <code>1000000</code> generates approximatelly a 50MB <code>pialert.log</code> file. Set to <code>0</code> to disable log purging.\"}]}"


#-------------------IMPORTANT INFO-------------------#
#   This file is ingested by a python script, so if  #
#        modified it needs to use python syntax      #
#-------------------IMPORTANT INFO-------------------#

Paste your docker-compose.yml and .env (remove personal info)

docker-compose.yml

version: "3"
services:
  pialert:
    container_name: pialert
    # use the below line if you want to test the latest dev image
    # image: "jokobsk/pi.alert_dev:latest"
    image: "jokobsk/pi.alert_dev:latest"
    network_mode: "host"
    restart: unless-stopped
    volumes:
      - ./pialert/config:/home/pi/pialert/config
      - ./pialert/db:/home/pi/pialert/db
      # (optional) useful for debugging if you have issues setting up the container
      - ./pialert/logs:/home/pi/pialert/front/log
      - /home/docker/containers/pihole/etc-pihole:/etc/pihole
    environment:
      - TZ=America/New_York

.env

Not used.

Screenshots

[If applicable, add screenshots to help explain your problem.]

Paste last few lines from pialert.log

09:56:32 [MAIN] waiting to start next loop
09:56:37 [Config] No old setting names found in the file. No changes made.
09:56:37 [Import Config] checking config file
09:56:37 [Import Config] lastImportedConfFile     :1701528460.1413934
09:56:37 [Import Config] fileModifiedTime         :1701528460.1413934
09:56:37 [Import Config] skipping config file import
09:56:37 [2023-12-02 09:56:37-05:00] START Run: PIHOLE
09:56:37 [Plugins] setTyp: subnets
09:56:37 [Plugin utils] Flattening the below array
09:56:37 ['192.168.29.0/24 --interface=eth0']
09:56:37 [Plugin utils] isinstance(arr, list) : False | isinstance(arr, str) : True
09:56:37 [Plugins] Resolved value: 192.168.29.0/24 --interface=eth0
09:56:37 [Plugins] Convert to Base64: True
09:56:37 [Plugins] base64 value: b'MTkyLjE2OC4y-sniphere-0ZXJmYWNlPWV0aDA='
09:56:37 [Plugins] Timeout: 10
09:56:37 [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;
09:56:37 [Plugins] ⚠ ERROR: DB_PATH setting (/etc/pihole/pihole-FTL.db) for plugin PIHOLE. Did you mount it correctly?
09:56:37 [Plugins] ⚠ ERROR: ATTACH DATABASE failed with SQL ERROR: database EXTERNAL_PIHOLE is already in use
09:56:37 [2023-12-02 09:56:37-05:00] END Run: PIHOLE
09:56:37 [API] Update API starting
09:56:37 [MAIN] waiting to start next loop
09:56:42 [Config] No old setting names found in the file. No changes made.
09:56:42 [Import Config] checking config file
09:56:42 [Import Config] lastImportedConfFile     :1701528460.1413934
09:56:42 [Import Config] fileModifiedTime         :1701528460.1413934
09:56:42 [Import Config] skipping config file import
09:56:42 [API] Update API starting
09:56:42 [MAIN] waiting to start next loop

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't workingnext release/in dev image 🚀This is coming in the next release or was already released if the issue is Closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions