Help with non-existent lists

I have a problem with a lot of "xiaomi" domain lists that I found, they seemed to really work, but both with Update gravity, and with "pihole -r", I get again the same lists that the vast majority stay at:

[i] Target: xxx.xxxx.xxxx
[✗] Status: Not found
[✗] List download failed: no cached list available

With which this generates erroneous lists that always give errors when restarting and turning off the Raspberry Pi, I cannot delete them one by one because it tells me that it is read-only or that the database is locked (errors that I have seen here and everything leads me to the "pihole -r" command), but whatever I choose, the reconfiguration loads those non-existent domains again... I'm already crazy lost from attempts without results.

Please, as I can delete all the lists without any of them being loaded by a complete Wipe, what command to use if it exists.

The command pihole -r is not a complete wipe. It can either Repair your Pi-hole (if the installation is broken in some way) or Reconfigure your Pi-hole (if you need to enter new networking parameters, for example). Adlists and custom rules are not overwritten. So perhaps try a Repair and see if helps.

Please create a debug log and post just the token URL here so it can be looked at. You can create a debug log and automatically send it to the Pi-hole team with the command

pihole -d -c -a

or use Tools > Generate debug log > Upload debug log and provide Debug Token Execute database integrity check > Generate debug log

The only thing that I have achieved with the three repairs that I did last night is that "my.wifi" disappears from the statistics as a domain and the AX3000 router from the devices, so now the statistics are much more real.

But actually I think I need to change the permissions to root or similar of the files that contain the lists. I don't think it's necessary to update the lists very often, but if you do, since it contains (many) wrong or non-existent lists, the gravity or -r command takes much longer.

I can pass you the debugging file, but if there is a way to do what I'm talking about, which would be to delete those domains that are hindering my pihole installation, I think everything would definitely be perfect.

Token: https://tricorder.pi-hole.net/0zlNMM0c/ (i can't see this, it's okey?)

Thanks. You have some domains entered in the Domains section. The first 3 are blacklisted and the rest are whitelisted. These are all okay.

You also have a number of adlists URLs in the Adlists section. These are the 32 entries at the top that start with https://. These are also all okay.

The problem is that after those lists URLs you have 437 entries which are actual domain names. These should not be in the Adlists section because they are not adlist URLs. If you want to block those domains they should be in the Domains section.

To remove these do the following:

  • Click on the Adlists section
  • Select Show All entries in the dropdown box
  • Tick the box just underneath that to select everything in there
  • Now carefully go down the list and untick all 32 of the https:// entries because these are all okay
  • Leave everything after those ticked
  • Now scroll the page back up and find the Delete icon which looks like a trash can, just underneath where it says Show All entries
  • Click that to delete the domain entries. It will take a few moments
  • Once done, confirm that you just have the https:// lines left in there

Now go to Tools > Update Gravity and click Update to do a fresh update of the database with the good lists that were left behind. Leave it on that screen until it says that it has finished.

Once it has finished, go to Tools > Pi-hole diagnosis and select Show All entries there too. Select all your error messages, if any are present, and delete them. This time they will stay deleted.

If you still want to do something with those domains that you deleted from the Adlists section, your debug log still has a copy of them. You can see it by entering the command below into a Pi-hole command line terminal window

sudo less -R /var/log/pihole/pihole_debug.log

You can move up and down with your arrow keys. You will see the domains part way down. From there you can copy individual domains and enter them into your Domains section and blacklist or whitelist them as needed.

Yes that's okay, only Pi-hole staff and individuals they have selected can access the uploaded debug logs, to ensure security and privacy. The logs are automatically deleted after 48 hours too. Your own copy of your debug log (the one in your /var/log/pihole) remains available for you to look at for as long as you want or until it is overwritten by the next one you create.

2 Likes

There are lots of messages in your error-pihole.log file which agree, such as

2023-08-18 00:37:16: mod_fastcgi.c.487) FastCGI-stderr:PHP Warning:  SQLite3Stmt::execute(): Unable to execute statement: attempt to write a readonly database in /var/www/html/admin/scripts/pi-hole/php/message.php on line 47
2023-08-18 00:38:05: mod_fastcgi.c.487) FastCGI-stderr:PHP Warning:  SQLite3Stmt::execute(): Unable to execute statement: attempt to write a readonly database in /var/www/html/admin/scripts/pi-hole/php/groups.php on line 1131
2023-08-18 00:54:05: mod_fastcgi.c.487) FastCGI-stderr:PHP Warning:  SQLite3::exec(): attempt to write a readonly database in /var/www/html/admin/scripts/pi-hole/php/teleporter.php on line 95

I once had this problem but a reboot fixed it. Did you try a pihole -r and Repair, even if it takes a long time?

The permissions and ownership for the main database are as follows:

-rw-rw-r--   1 pihole pihole 254967808 Aug 18 10:03 gravity.db

What does yours say? Check it with the command below in a Pi-hole terminal window

ls -l /etc/pihole/gravity.db
1 Like

When I perform any action like the one that tells me to delete the entries in Adlist except for https, I always get this type of message, even when I try to delete in pihole diagnosis, identical:

1

And according to the command that you gave me, the permissions seem to be fine, maybe you have to look at the permissions of all the files that contain lists, groups or configuration? Honestly, I'm pretty lost with this and since I don't know how to guide myself, I don't know what to try or look for now.

11

I suspect that whatever caused all those domains to be added to be added to Adlists has also caused this change of the database. How did they get in there? That might give a clue. Did you interact with the database directly in the terminal? Did you have unexpected power loss of your Pi?

Your debug log database checks show no integrity errors, so it looks like it is just a permissions error. Once that is fixed you will be able to remove those domains from the Adlist section (if the fix does not already do this).

A Pi-hole staff member or another user who has experienced this will be able to advise on what can cause this gravity permissions error and how to best fix it.

1 Like

What are the permissions for /etc/pihole directory?

Execute ls -ld /etc/pihole and post the output.

Yes, there was an unexpected power failure, if by turning off from the Pihole web menu and waiting a bit and removing the cable. Because whatever, I only get HDMI image on the Raspberry when shutdown and start from 0, if I'm seeing pihole and I connect the HDMI input I don't see image from Raspberry OS, so I need to turn it off as I tell it if I want to see or do something.

I did this twice, but I haven't touched permissions or anything, I don't know how to do it, I've tried some internet command line, but they don't work for me, the file etc/pihole/adlists.list has a permission less than "write" I think other files, it is logical that I can not delete or add anything without that permission.

The problematic lists entered as the https, add copy&paste and update gravity, in the first one I already observed the number of errors that were produced and therefore lengthens the gravity process a lot.

1

/etc/pihole $ ls -ld /etc/
drwxr-xr-x 124 root root 12288 ago 18 20:22 /etc/

/etc/pihole $ ls -ld custom.list
-rw-rw-r-- 1 root root 0 ago 14 19:41 custom.list

/etc/pihole $ ls -ld gravity.db
-rw-rw-r-- 1 pihole pihole 73457664 ago 17 23:49 gravity.db

I still don't get anything, I don't understand it, really...

The permissions I have for custom.list are slightly different but I don't think it should matter.

-rw-r--r--   1 root   root          72 Jul  9 01:36 custom.list

Your permissions are -rw-rw-r-- (664). If you want to try it, set the permissions to -rw-r--r-- (644) with the command

sudo chmod 644 /etc/pihole/custom.list

Can you please run the following command. It will send a copy of your /etc/pihole file permissions and ownerships to Pi-hole for analysis. It will give you a token URL, please post that here.

ls -la /etc/pihole | pihole tricorder
1 Like

This is normal (note: this is a completely unrelated issue).

When you turn your Raspberry Pi on without a HDMI cable, the system turns off the HDMI output, but it's possible to configure your system to force HDMI output, even without the cable.

You need to add hdmi_force_hotplug=1 to your /boot/config.txt file. Save the file and restart the Raspberry Pi.

More details here: https://www.raspberrypi.com/documentation/computers/config_txt.html#hdmi_force_hotplug

https://tricorder.pi-hole.net/Wkl5zJCU/

It seems that with permissions absolutely nothing I do works.

Thanks for the permissions list. I see the problem and have tested it and get the same problem.

read-only

The permissions on your /etc/pihole and on your /etc/pihole/gravity.db are wrong. Yours are read-only for the group, but they should be read+write. Run the following commands to fix them.

sudo chmod 775 /etc/pihole/
sudo chmod 664 /etc/pihole/gravity.db

Now it will be working and you will able to delete your domain adlists using the process I described earlier on.

working

If you want to confirm permissions before and after the change, these commands will do it.

YOUR INCORRECT PERMISSIONS

$ stat -c "%a %n" /etc/pihole/
755 /etc/pihole/
$ stat -c "%a %n" /etc/pihole/gravity.db
644 /etc/pihole/gravity.db

AFTER THE FIX

$ stat -c "%a %n" /etc/pihole/
775 /etc/pihole/
$ stat -c "%a %n" /etc/pihole/gravity.db
664 /etc/pihole/gravity.db
3 Likes

Thank you, friend!!!!!!!!

It worked!, I was about to format the SD and do a new installation, but I preferred a few more attempts of this and it's always nice to solve things like this instead of starting from 0.

Thanks a lot!!!.

1 Like

It is possible to add said line through the console?, I have tried and I get to see the .txt, but I don't know if you can add said line to it.

Thank you.

That's good! Do you know what might have caused the permissions to become wrong? Would it be the same reason you ended up with lots of domains in your Adlists section? Did you run a script or something maybe? I am just curious how it happened.

You can edit the file using the nano editor:

On the command line, type: sudo nano /boot/config.txt (Caution: this can be dangerous. Be careful when changing system files. Make sure you just change what you need.)

The file will open. Use the arrow keys to scroll down the file.
You will probably find a line with the command (but commented), like this: #hdmi_force_hotplug=1.

Remove the # from the line. It will read like: hdmi_force_hotplug=1

Read twice before saving. Make sure you just changed what you want.
Save the changes pressing CTRL + S and close the editor using CTRL + X.
Reboot.

1 Like

Not the truth that I did not execute anything strange that I know of, consciously at least not. The Domains ended just because of my mistake, I put them in for confusion, maybe that's a pihole bug and I create the permissions mismatch? It would be a matter of trying it on a new installation.

I don't touch anything else for now that everything is going well for me, also because of this mess, the mi.wifi domain of the routers does not appear to me as the outstanding leader of blocked hits in the statistics, with which the blocked traffic is more real than before . The thing would be to verify that this domain continues to be blocked, since the Xiaomi routers constantly ping that domain, but I don't know if they send information.

Thanks mate, I'll try this later. This is more comfortable for me than dropping the laptop that I already have installed on a vertical base and with the cables collected and I would have to connect to the HDMI of the Pi that is in a telecommunications box and and so learn to do more things with the system :stuck_out_tongue_winking_eye:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.