Cannot build database

Hi,

how can i fix this:

  [✓] Storing downloaded domains in new gravity database
  [i] Building tree...
  [✗] Unable to build gravity tree in /etc/pihole/gravity_temp.db
  Error: database or disk is full
  [i] Number of gravity domains: 2223113 ( unique domains)
  [i] Number of exact blacklisted domains: 0
  [i] Number of regex blacklist filters: 0
  [i] Number of exact whitelisted domains: 195
  [i] Number of regex whitelist filters: 0
  [✓] Cleaning up stray matter

What is the output of the command

du -h

4.0K    ./.gnupg/private-keys-v1.d
8.0K    ./.gnupg
16K     ./.unbound
4.0K    ./.local/share/nano
8.0K    ./.local/share
12K     ./.local
204K    .

Sorry, my fault, it should be

df -h

That is a lot less output than would be expected. Was that the entire output?

yes, the whole output

Filesystem      Size  Used Avail Use% Mounted on
/dev/root        59G  1.8G   55G   4% /
devtmpfs        459M     0  459M   0% /dev
tmpfs           464M   84K  463M   1% /dev/shm
tmpfs           464M  6.3M  457M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           464M     0  464M   0% /sys/fs/cgroup
tmpfs           100M   16K  100M   1% /tmp
tmpfs            70M  1.4M   69M   2% /var/log
tmpfs           150M     0  150M   0% /var/cache/apt/archives
tmpfs            20M     0   20M   0% /var/tmp
/dev/mmcblk0p1  253M   53M  200M  21% /boot
tmpfs            93M     0   93M   0% /run/user/999
tmpfs            93M     0   93M   0% /run/user/1000

If a want to create the db, I get the error:

  [i] Storing downloaded domains in new gravity database...
  [✗] Unable to fill gravity table in database /etc/pihole/gravity_temp.db
  /tmp/tmp.nkof8cgYVY.gravity:101083: expected 2 columns but found 3 - extras ignored
/tmp/tmp.nkof8cgYVY.gravity:155679: expected 2 columns but found 3 - extras ignored
/tmp/tmp.nkof8cgYVY.gravity:164641: expected 2 columns but found 3 - extras ignored
/tmp/tmp.nkof8cgYVY.gravity:544715: expected 2 columns but found 3 - extras ignored
/tmp/tmp.nkof8cgYVY.gravity:840257: expected 2 columns but found 3 - extras ignored
/tmp/tmp.nkof8cgYVY.gravity:879942: expected 2 columns but found 3 - extras ignored
/tmp/tmp.nkof8cgYVY.gravity:907071: expected 2 columns but found 3 - extras ignored
/tmp/tmp.nkof8cgYVY.gravity:910741: expected 2 columns but found 3 - extras ignored
/tmp/tmp.nkof8cgYVY.gravity:913223: expected 2 columns but found 3 - extras ignored
/tmp/tmp.nkof8cgYVY.gravity:1134318: expected 2 columns but found 1 - filling the rest with NULL
/tmp/tmp.nkof8cgYVY.gravity:1134318: INSERT failed: NOT NULL constraint failed: gravity.adlist_id
  [✓] Cleaning up stray matter

What is the output of ls -lha /etc/pihole/*.db

pi@raspberrypi:~ $ ls -lha /etc/pihole/*.db
-rw-rw-r-- 1 pihole pihole 3.0M Feb  3 19:52 /etc/pihole/gravity.db
-rw-r--r-- 1 root   root    33M Feb  3 19:55 /etc/pihole/gravity_temp.db
-rw-r--r-- 1 pihole pihole 2.3M Feb  3 15:42 /etc/pihole/macvendor.db
-rw-r--r-- 1 pihole pihole 188K Feb  3 20:26 /etc/pihole/pihole-FTL.db
pi@raspberrypi:~ $

Any solution?

It seems that on your first try, your entire disk was full. This doesn’t seem to be the case any more. Please try running a database repair (= complete recreation):

pihole -g -r

Yes, I can rebuild the DB, but if I want to add several block lists such as https://v.firebog.net/hosts/lists.php then I’ll get the error again. I do not have the problem at another rpi with pihole.

Is there any possibility to assign more disk space?

You have the Linux parted tool to resize disk partitions.
You have the Linux resize2fs tool to resize the EXT4 file system on the root partition (or any EXT2/3/4 file system).
You’d most likely have to connect your storage to another computer that boots Linux.
Or boot from a Linux live CD/USB stick as its not recommended to resize partitions that you’ve booted from already.

pi@noads:~ $ apt show parted
[..]
Description: disk partition manipulator
 GNU Parted is a program that allows you to create, destroy, resize,
 move, and copy disk partitions. This is useful for creating space
 for new operating systems, reorganizing disk usage, and copying data
 to new hard disks.
[..]

pi@noads:~ $ apt show e2fsprogs
[..]
Description: ext2/ext3/ext4 file system utilities
 The ext2, ext3 and ext4 file systems are successors of the original ext
 ("extended") file system. They are the main file system types used for
 hard disks on Debian and other Linux systems.
 .
 This package contains programs for creating, checking, and maintaining
 ext2/3/4-based file systems.  It also includes the "badblocks" program,
 which can be used to scan for bad blocks on a disk or other storage device.

pi@noads:~ $ apt show gparted
[..]
Description: GNOME partition editor
 GParted uses libparted to detect and manipulate devices and partition
 tables while several (optional) filesystem tools provide support for
 filesystems not included in libparted.

ok, but how do I assign “/etc/pihole/gravity_temp.db” more space?

Or is there a way to reset the “/etc/pihole/gravity_temp.db”?

You dont have to assign more space.
The db (database) file will just grow as large as the EXT4 filesystem will allow:

The ext4 filesystem can support volumes with sizes up to 1 exbibyte (EiB) and single files with sizes up to 16 tebibytes (TiB) with the standard 4 KiB block size.[12]

Or until the root partition “/” runs full:

df -h /

I dont know of a safe way yet with V5.0 but recon the devs would know.

As shown above, there is enough space available…

I have no clue what caused the 59GB to run full.
Are you sure thats happening now ?

ls -lh /etc/pihole/*.db

df -h

Hold on!