arevindh / pihole-speedtest

Pihole Speedtest Mod
https://arevindh.github.io/pihole-speedtest/
MIT License
218 stars 22 forks source link

Does not show graph display on dashboard. Console errors. #11

Closed navisayslisten closed 5 years ago

navisayslisten commented 5 years ago

Pi-hole Version v4.1.1 Web Interface Version v4.1.1 FTL Version v4.1.2 Browsers: Chrome v71, Firefox Quantum v65

I initially thought this was a Chrome issue only, but I had the wrong debug window open.

Uncaught TypeError: Cannot read property 'length' of null at Object.acquireContext (Chart.bundle.min.js:10) at t.construct (Chart.bundle.min.js:10) at new t (Chart.bundle.min.js:10) at speedtest.js:39

Refused to load the image 'blob:http://pi.hole/b623d4e5-73f7-494a-b85f-277511bead6e' because it violates the following Content Security Policy directive: "default-src 'self' data: fonts.gstatic.com api.github.com pihole.speedtestcustom.com". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.

speedtest.js:26 Uncaught TypeError: Cannot read property 'update' of undefined at Object.<anonymous> (speedtest.js:26) at j (jquery.min.js:2) at Object.fireWith [as resolveWith] (jquery.min.js:2) at x (jquery.min.js:4) at XMLHttpRequest.<anonymous> (jquery.min.js:4) (anonymous) @ speedtest.js:26 j @ jquery.min.js:2 fireWith @ jquery.min.js:2 x @ jquery.min.js:4 (anonymous) @ jquery.min.js:4 load (async) send @ jquery.min.js:4 ajax @ jquery.min.js:4 updateSpeedTestData @ speedtest.js:10 (anonymous) @ speedtest.js:34 setInterval (async) (anonymous) @ speedtest.js:32

Graph does not display at all. The Speedtests page works fine though.

arevindh commented 5 years ago

Can you try running sudo pihole -a -sn and try again

navisayslisten commented 5 years ago

Command works but I get the same errors. No graph displays. I now have two results in the Speedtest page table.

arevindh commented 5 years ago

Can you try posting content of http://pi.hole/admin/api.php?getSpeedData24hrs&PHP (Please remove any sensitive data like your public IP address)

navisayslisten commented 5 years ago

Yes, sorry this took a while to respond to. The result of that query is [] an empty array on a white page.

arevindh commented 5 years ago

Can you try to reinstall (uninstall and Install ) https://github.com/arevindh/pihole-speedtest/wiki Also set enable hourly speedtest after that

navisayslisten commented 5 years ago

I followed the uninstall instructions, then followed the install instructions again, then ran sudo pihole -a -sn

The graphs still do not display on the dashboard, and the console errors are identical. The speedtest page now shows 3 results in the table.

The result of the query you gave me now returns with a result

[{"id":3,"start_time":"2019-01-10 11:31:03","stop_time":"2019-01-10 11:31:32","from_server":"MyISP","from_ip":"xx.xx.xx.xx","server":"MyISP","server_dist":3.15,"server_ping":101.292,"download":218.32,"upload":254.52,"share_url":"speedtesturl"}]

navisayslisten commented 5 years ago

After updating the speedtest schedule under Settings, the graph now displays. ~Maybe 24 hours has a bug? I set it to 30 days.~

After clicking around a bit and messing with settings, the issue is definitely the schedule defaulting to Disabled. When that option is set to disabled (which it is by default) the graph goes away. I would expect that if I turn off scheduling for a bit I could still have access to the graph on the dashboard, even if it's empty.

arevindh commented 5 years ago

I’m closing this issue because it has been inactive for a few months. This probably means that it is not reproducible or it has been fixed in a newer version. If it’s an enhancement and hasn’t been taken on for so long, then it seems no one has the time to implement this.

Please reopen if you still encounter this issue with the latest stable version and then please use the this link

biplobsd commented 3 years ago

Can you try posting content of http://pi.hole/admin/api.php?getSpeedData24hrs&PHP (Please remove any sensitive data like your public IP address)

I getting [] this. and no graph on dashboard. Also did https://github.com/arevindh/pihole-speedtest/issues/11#issuecomment-453200125

arevindh commented 3 years ago

@biplobsd https://github.com/arevindh/pihole-speedtest/issues/48#issuecomment-663933976

biplobsd commented 3 years ago

Testing with 2020-08-13 19:45:36 2020-08-13 19:45:53 BD Networks 103.231.228.6 Cosmopolitan Communications Limited 03.619 92.233 92.4352 https://www.speedtest.net/result/c/84c1fec1-8912-400a-9067-79139078c8e1

@biplobsd #48 (comment)

biplobsd commented 3 years ago

@biplobsd [#48 (comment)](https://github.com/arevindh/pihole-speedtest/issues/48#issuecomment-663933976

Still same

biplobsd commented 3 years ago

image

arevindh commented 3 years ago

And the output of that command ?

biplobsd commented 3 years ago

And the output of that command ?

pi@raspberrypi:~ $ sudo "/var/www/html/admin/scripts/pi-hole/speedtest/speedtest-official.sh" Testing with 2020-08-13 19:54:51 2020-08-13 19:55:06 BD Networks 103.231.228.6 Cosmopolitan Communications Limited 03.243 92.9259 90.5763 https://www.speedtest.net/result/c/7845cb01-c97d-4824-a4f7-1a731b564e5c pi@raspberrypi:~ $

arevindh commented 3 years ago

Can you now check the output of http://pi.hole/admin/api.php?getSpeedData24hrs&PHP

Make sure that you are logged in

biplobsd commented 3 years ago

Can you now check the output of http://pi.hole/admin/api.php?getSpeedData24hrs&PHP

Make sure that you are logged in

[]

arevindh commented 3 years ago

Can you post the output of ls -alh /etc/pihole/

biplobsd commented 3 years ago

Can you post the output of ls -alh /etc/pihole/

pi@raspberrypi:/opt/pihole $ ls -alh /etc/pihole/ total 84M drwxrwxr-x 3 pihole pihole 4.0K Aug 13 21:17 . drwxr-xr-x 120 root root 12K Aug 13 20:52 .. -rw-r--r-- 1 root root 118 Aug 10 19:32 adlists.list -rw-r--r-- 1 root root 118 Aug 8 19:02 adlists.list.old -rw-r--r-- 1 root root 23 Aug 10 22:04 custom.list -rw-r--r-- 1 pihole pihole 924 Aug 13 20:41 dhcp.leases -rw-r--r-- 1 root root 596 Aug 10 19:53 dns-servers.conf -rw-r--r-- 1 root root 18 Aug 13 19:49 GitHubVersions -rw-rw-r-- 1 pihole pihole 52M Aug 12 11:06 gravity.db -rw-r--r-- 1 root root 1.1K Aug 10 19:53 install.log -rw-r--r-- 1 root root 1.1M Aug 11 17:57 list.0.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 2.2K Aug 11 17:58 list.10.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 2.1K Aug 11 17:58 list.11.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 134K Aug 11 17:59 list.12.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 1.4M Aug 11 17:59 list.13.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 403K Aug 11 17:59 list.14.sysctl.org.domains -rw-r--r-- 1 root root 0 Aug 11 17:59 list.15.zeustracker.abuse.ch.domains -rw-r--r-- 1 root root 249K Aug 11 18:00 list.16.adaway.org.domains -rw-r--r-- 1 root root 539K Aug 11 18:00 list.17.v.firebog.net.domains -rw-r--r-- 1 root root 581K Aug 10 19:56 list.1.mirror1.malwaredomains.com.domains -rw-r--r-- 1 root root 57K Aug 11 18:01 list.20.pgl.yoyo.org.domains -rw-r--r-- 1 root root 230 Aug 11 18:01 list.21.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 13K Aug 11 18:01 list.22.reddestdream.github.io.domains -rw-r--r-- 1 root root 209K Aug 11 18:01 list.23.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 1.5K Aug 11 18:01 list.24.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 14K Aug 11 18:02 list.25.v.firebog.net.domains -rw-r--r-- 1 root root 57K Aug 11 18:02 list.26.v.firebog.net.domains -rw-r--r-- 1 root root 58K Aug 11 18:02 list.27.v.firebog.net.domains -rw-r--r-- 1 root root 31K Aug 11 18:02 list.29.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 521 Aug 10 19:56 list.2.s3.amazonaws.com.domains -rw-r--r-- 1 root root 9.6K Aug 11 18:02 list.30.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 44K Aug 11 18:02 list.31.s3.amazonaws.com.domains -rw-r--r-- 1 root root 50K Aug 11 18:02 list.32.mirror.cedia.org.ec.domains -rw-r--r-- 1 root root 22K Aug 11 18:03 list.33.www.malwaredomainlist.com.domains -rw-r--r-- 1 root root 43K Aug 11 18:03 list.34.bitbucket.org.domains -rw-r--r-- 1 root root 2.3M Aug 11 18:03 list.35.v.firebog.net.domains -rw-r--r-- 1 root root 1.1M Aug 11 18:03 list.36.v.firebog.net.domains -rw-r--r-- 1 root root 324K Aug 11 18:03 list.38.v.firebog.net.domains -rw-r--r-- 1 root root 47K Aug 11 18:04 list.39.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 43K Aug 10 19:56 list.3.s3.amazonaws.com.domains -rw-r--r-- 1 root root 1.2M Aug 11 17:57 list.4.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 249K Aug 11 17:58 list.5.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 3.7M Aug 11 17:58 list.6.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 3.2M Aug 11 17:58 list.7.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 812K Aug 11 17:58 list.8.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 6.0K Aug 11 17:58 list.9.raw.githubusercontent.com.domains -rw-r--r-- 1 root root 20 Aug 13 21:10 localbranches -rw-r--r-- 1 root root 46 Aug 11 18:04 local.list -rw-r--r-- 1 root root 41 Aug 13 21:10 localversions -rw-r--r-- 1 root root 234 Aug 10 19:53 logrotate -rw-r--r-- 1 pihole pihole 2.4M Aug 10 19:53 macvendor.db drwxr-xr-x 2 root root 4.0K Aug 8 19:31 migration_backup -rw-rw-r-- 1 pihole root 15 Aug 10 19:53 pihole-FTL.conf -rw-r--r-- 1 pihole pihole 12M Aug 13 21:17 pihole-FTL.db -rw-r--r-- 1 root root 917 Aug 13 21:10 setupVars.conf -rw-r--r-- 1 root root 668 Aug 10 19:53 setupVars.conf.update.bak -rw-r--r-- 1 root root 3.0K Aug 13 21:13 speedtest.db -rw-r--r-- 1 root root 3.0K Aug 13 19:55 speedtest.db_old pi@raspberrypi:/opt/pihole $

arevindh commented 3 years ago

Can check if there is anything saved in the DB ?

Use the below code to check, post output [ you may need to delete those IP address before pasting]

cd /etc/pihole/
sqlite3 speedtest.db
select * from speedtest limit 2;
biplobsd commented 3 years ago

Can check if there is anything saved in the DB ?

Use the below code to check, post output [ you may need to delete those IP address before pasting]

cd /etc/pihole/
sqlite3 speedtest.db
select * from speedtest limit 2;

pi@raspberrypi:/etc/pihole $ sqlite3 speedtest.db SQLite version 3.27.2 2019-02-25 16:06:06 Enter ".help" for usage hints. sqlite> select * from speedtest limit 2; 1|2020-08-13 21:12:31|2020-08-13 21:13:57|BD Networks|103.231.231.90|MetroNet Bangladesh Ltd (Dhaka)|0.85|90.089|4.83|4.39|http://www.speedtest.net/result/9908005861.png 2|2020-08-13 10:22:50|2020-08-13 10:23:11|BD Networks|103.231.228.6|MetroNet Bangladesh Ltd|0.0|2.749|92.5077|94.2482|https://www.speedtest.net/result/c/b6048b0a-44ab-4cfd-9082-b30c226dfef3 sqlite>

biplobsd commented 3 years ago

My time zone is Asia/Dhaka (+06, +0600) Is there any problem with this?

arevindh commented 3 years ago

yes there might be.

Have you ran sudo dpkg-reconfigure tzdata

Also change chart duration to 7 days in chart settings

biplobsd commented 3 years ago

image

pi@raspberrypi:/etc/pihole $ sudo dpkg-reconfigure tzdata

Current default time zone: 'America/New_York' Local time is now: Thu Aug 13 11:44:23 EDT 2020. Universal Time is now: Thu Aug 13 15:44:23 UTC 2020.

pi@raspberrypi:/etc/pihole $ sudo "/var/www/html/admin/scripts/pi-hole/speedtest/speedtest-official.sh" Testing with 2020-08-13 11:44:50 2020-08-13 11:45:06 BD Networks 103.231.228.6 Bangla Trac Communications Ltd. 0 2.502 93.2074 94.1453 https://www.speedtest.net/result/c/2ef37ead-f7e2-4b92-9053-c516caa5ca2a pi@raspberrypi:/etc/pihole $ sudo "/var/www/html/admin/scripts/pi-hole/speedtest/speedtest-official.sh" Testing with 2020-08-13 11:45:14 2020-08-13 11:45:31 BD Networks 103.231.228.6 Inspire Broadband 0 4.897 93.4408 93.2391 https://www.speedtest.net/result/c/02b2d2ed-6995-48f8-bbc5-9f5eb5dd590e pi@raspberrypi:/etc/pihole $ sudo "/var/www/html/admin/scripts/pi-hole/speedtest/speedtest-official.sh" Testing with 2020-08-13 11:45:38 2020-08-13 11:45:58 BD Networks 103.231.228.6 Aamra Technologies Limited 0 2.652 93.9308 94.2717 https://www.speedtest.net/result/c/216d3be2-caab-4f38-9fcb-6cf4f47bf441 pi@raspberrypi:/etc/pihole $ sudo "/var/www/html/admin/scripts/pi-hole/speedtest/speedtest-official.sh" Testing with 2020-08-13 11:46:14 2020-08-13 11:46:33 BD Networks 103.231.228.6 Inspire Broadband 0 3.739 93.4673 93.6839 https://www.speedtest.net/result/c/e267a002-d9b5-4ca5-8c4a-ef461c536872 pi@raspberrypi:/etc/pihole $

biplobsd commented 3 years ago

Working...!!!! But my time zone is not correct!

biplobsd commented 3 years ago

I added a line date_default_timezone_set('Asia/Dhaka'); in /var/www/html/admin/api_speedtest.php

Now seems like all ok!.,😊😁