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

[BUG] Statistics page blank and throws error when 0 queries blocked #202

Open
rmbleeker opened this issue Mar 15, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@rmbleeker
Copy link

rmbleeker commented Mar 15, 2024

Describe the bug
The statistics page is blank and at the bottom an error pops up telling me to check my internet connection (which is fine) or that the API key has been set properly (it has). I suspect the cause of the error is instead a bug in the JSON parser in the app, or some of the returned JSON code is not properly quoted/escaped.

To Reproduce
Steps to reproduce the behaviour:

  1. Have a working Pi-Hole with 0 queries blocked and a 0,00% block percentage on the Home page
  2. Click on Statistics
  3. See blank page with error

Expected behaviour
I would expect to see the normal statistics page with the "Top permitted", "Top blocked" and "Top client" sections, only the "Top blocked" section should probably be empty since there are no sites blocked by this Pi-Hole unit yet.

Screenshots

Smartphone (please complete the following information):

  • Device: OnePlus 6
  • OS: Android 11
  • Browser: Firefox
  • Version 123.1.0

Additional context
I have a setup where I run 2 Raspberry Pi 4's each with Pi-Hole and Unbound, in order to have a fallback DNS server in case the first one stops working. The secondary Pi-Hole is rarely used and often has not have to block any DNS queries. The primary Pi-Hole rarely has an empty "queries blocked" list, maybe right after a reboot, so I have not seen the described behaviour there.

Error message

lb.f: Illegal input: Unexpected JSON token at offset 262: Expected start of the object '{', but had ':' instead at path: $.top_ads
JSON input: .....92.in-addr.arpa":48},"top_ads":[],"top_sources":{"192.168.1......
	at mb.i.a(SourceFile:355)
	at lb.b.emit(SourceFile:163)
	at s4.v.collect(SourceFile:191)
	at lb.c.collect(SourceFile:48)
	at v6.tb.l(SourceFile:73)
	at v6.sd.m(SourceFile:82)
	at db.g.b(SourceFile:246)
	at va.a.invokeSuspend(SourceFile:365)
	at va.a.invoke(SourceFile:72)
	at rb.k.f(SourceFile:36)
	at rb.k.c(SourceFile:28)
	at va.c.invokeSuspend(SourceFile:175)
	at va.c.invoke(SourceFile:41)
	at rb.k.f(SourceFile:36)
	at rb.k.c(SourceFile:28)
	at rb.k.d(SourceFile:8)
	at bb.n.invokeSuspend(SourceFile:134)
	at bb.n.invoke(SourceFile:47)
	at rb.k.f(SourceFile:36)
	at rb.k.c(SourceFile:28)
	at rb.k.a(SourceFile:24)
	at rb.d.a(SourceFile:196)
	at wa.c.a(SourceFile:178)
	at com.tien.piholeconnect.repository.PiHoleRepositoryImpl$getStatistics$2.invokeSuspend(SourceFile:126)
	at fc.a.resumeWith(SourceFile:9)
	at cf.l0.run(SourceFile:113)
	at k.j.run(SourceFile:17)
	at jf.i.run(SourceFile:3)
	at jf.a.run(SourceFile:92)
Caused by: qf.p: Unexpected JSON token at offset 262: Expected start of the object '{', but had ':' instead at path: $.top_ads
JSON input: .....92.in-addr.arpa":48},"top_ads":[],"top_sources":{"192.168.1......
	at v6.qb.e(SourceFile:33)
	at v6.qb.d(SourceFile:35)
	at qf.a.s(SourceFile:59)
	at qf.a.t(SourceFile:13)
	at qf.a.u(SourceFile:113)
	at qf.a.D(SourceFile:42)
	at qf.h0.j(SourceFile:47)
	at qf.e0.b(SourceFile:45)
	at of.a.e(SourceFile:18)
	at of.a.deserialize(SourceFile:6)
	at qf.e0.z(SourceFile:69)
	at v6.vb.w(SourceFile:11)
	at qf.e0.w(SourceFile:49)
	at com.tien.piholeconnect.model.PiHoleStatistics$$serializer.deserialize(SourceFile:1)
	at com.tien.piholeconnect.model.PiHoleStatistics$$serializer.deserialize(SourceFile:2)
	at qf.e0.z(SourceFile:69)
	at mb.i.a(SourceFile:230)
	... 28 more
@rmbleeker rmbleeker added the bug Something isn't working label Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants