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

gravity doesn't exit if there is a storage problem. #5244

Open
jpgpi250 opened this issue Apr 2, 2023 · 3 comments
Open

gravity doesn't exit if there is a storage problem. #5244

jpgpi250 opened this issue Apr 2, 2023 · 3 comments
Assignees

Comments

@jpgpi250
Copy link
Contributor

jpgpi250 commented Apr 2, 2023

Versions

Pi-hole version is v5.16.2 (Latest: v5.16.2)
AdminLTE version is v5.19 (Latest: v5.19)
FTL version is update/dnsmasq vDev-879708d (Latest: v5.22)

Platform

Raspberry pi 3B
Linux raspberrypi 6.1.19-v7+ #1637 SMP Tue Mar 14 11:04:52 GMT 2023 armv7l GNU/Linux

Expected behavior

exit 1 on error, generate warning message

Actual behavior / bug

gravity continues, regardless problem

Steps to reproduce

using GRAVITY_TMPDIR=/home/pi/tmp (setupVars.conf)
fstab entry for the mount point, configured to small (on purpose)

tmpfs /home/pi/tmp tmpfs nodev,noauto,nosuid,size=32M 0 0

sudo mount /home/pi/tmp
run pihole -g
error message (repeats after every list as soon space runs out, thus multiple messages):

sed: couldn't write 16 items to stdout: No space left on device
tee: /home/pi/tmp/tmp.PmGM1s9bMg.ph-non-domains: No space left on device

final message:

  [✗] Unable to fill gravity table in database /etc/pihole/gravity.db_temp
  /home/pi/tmp/tmp.gIRXzLCIDD.gravity:1386090: expected 2 columns but found 1 - filling the rest with NULL
/home/pi/tmp/tmp.gIRXzLCIDD.gravity:1386090: INSERT failed: NOT NULL constraint failed: gravity.adlist_id

gravity completes (no exit 1), dashboard says "adlists updated 00:05 (hh:mm) ago, but actually using old database (updated field in info table is modified, regardless of success)

Debug Token

debug has been created after changing the TMPFS size, and build gravity with success.
https://tricorder.pi-hole.net/FblkfEu9/

Screenshots

image

image

Additional context

trying to run gravity.sh on TMPFS, the to save the SD card, works fine, unless available TMPFS storage is to small, current adlists require 96Mb

I think this line:

num_domains=$(grep -E "^(${valid_domain_pattern}|${abp_domain_pattern})$" "${src}" | tee >(sed "s/$/,${adlistID}/" >> "${target}") | wc -l)

needs error checking.

@dschaper
Copy link
Member

dschaper commented Apr 4, 2023

So, gravity doesn't actually complete, the old database is still in use?

You're mainly saying that the display is incorrect?

And can you do another debug run, the token URL has expired.

@jpgpi250
Copy link
Contributor Author

jpgpi250 commented Apr 4, 2023

So, gravity doesn't actually complete, the old database is still in use?

yes

You're mainly saying that the display is incorrect?

  • the display is incorrect, says update x minutes ago, but the old database is used

  • gravity doesn't exit when there is a storage problem

    Pi-hole version is v5.16.2 (Latest: v5.16.2)
    AdminLTE version is v5.19 (Latest: v5.19)
    FTL version is update/dnsmasq vDev-879708d (Latest: v5.22)

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

@dschaper
Copy link
Member

dschaper commented Apr 4, 2023

Okay, I'll take a look in a bit.

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

2 participants