[Buggy builds] luci_statistics Error while Showing Graphs

Well the error happened again, I checked the permissions, they were default. never touched anything at all. I suspect something may be going on somewhere inside Luci Statistics.

Anyway, I unplugged ExtRoot again, rebooted without ExtRoot, copied everything from /rom, /usr, /proc to ExtRoot and when I rebooted it's working again, dont know for how long but we'll see.

I dont think the problem is within the config. I am using the same config as before, no changes except the directory is now /stats for collectd. rrd shows graphs from /tmp as usual and everything is working.

Right now:

it's TZ ... or less likely hostname... seen them change?

What is TZ? And no hostname did not change so far. Also the graphs screen is working so far after copying stuff to ExtRoot.

1 Like

Well... just about everything else has been ruled out.... the graph code uses hostname and time..... to operate.... TZ mean't to suggest some erroneous clock skew.....

Only things that fit with your symptoms..... well... the cache code could too...... if if uses time...... you can disable the cache.... but I dunno how that would effect statistics specifically.....

One way to find out I suppose..... Glad to hear it's working.... Fingers crossed it stays that way....

I reckon next time set it up.... then do the extroot copy configuration.

I dont understand why timezone may have a problem with translating a webpage. I mean the error clearly indicates that it cant show a certain page becasue of the template and it says Permission denied error but in fact the permission seems okay from SSH.

So it is possible the permissions get screwed somehow for LuCI and it cant access the template for that reason and says "Permission denied". Maybe a bug somewhere? I am using a Snapshot build after all. Or maybe the Flash can be causing issues with the filesystem but it seems unlikely becasue no other problems have popped out yet.

Edit 3: Found the source of the issue. If I install luci-app-vpn-policy-routing then the graphs screen throws permission denied error and wont show any graphs. I am not sure why it is doing it but maybe something gets broken if you are using ExtRoot and install a LuCI based package into ExtRoot. It could be a bug but I am not sure.

1 Like

Had exact same issue and via GUI uninstalled "luci-app-statistics" (without dependencies checked) then reboot, installed it again and rebooted. Seems to be working now.

I also use "luci-app-vpn-policy-routing".

Yes, I was about to edit my last reply becasue I fixed it by force reinstalling it. RRD graphs were not working for me either so a force reinstall did the trick anyway. But as of right now, I am using the stable builds, too many bugs for daily use in Snapshots and I need a stable connection for a few weeks. Thanks for confirming though.

FWIW: I updated to Davidc502's build "OpenWrt SNAPSHOT r9886-399aa0b933 / LuCI Master (f138fc93)" when I experience the issue so maybe it was the same Snapshot.

I was using self compiled firmware because of some patches but I think I am gonna wait for 19.xx version.

The problem is caused by luci-app-vpn-policy-routing. This package contains directory entries with wrong permissions, clobbering the system default permissions of /usr and /etc. Since the package is not part of any official repo as far as I can see, it will not get fixed by 19.x or any other release.

This is something @stangri needs to look into.

@stangri - when listing the contents of luci-app-vpn-policy-routing_git-19.099.68053-6c028c8-38_all.ipk, there seem to be some "weird" permissions set for directories:

jow@j220 $ find . | xargs /bin/ls -ld
drwxr-xr-x 4 jow jow  4096 Apr 23 10:16 .
drwxr-s--- 3 jow jow  4096 Jan 30 13:21 ./etc
drwxr-s--- 2 jow jow  4096 Jan 30 13:21 ./etc/uci-defaults
-rw-r----- 1 jow jow   233 Jan 30 13:21 ./etc/uci-defaults/40_luci-vpn-policy-routing
drwxr-sr-x 3 jow jow  4096 Jan 30 13:21 ./usr
drwxr-sr-x 3 jow jow  4096 Jan 30 13:21 ./usr/lib
drwxr-sr-x 3 jow jow  4096 Jan 30 13:21 ./usr/lib/lua
drwxr-sr-x 5 jow jow  4096 Jan 30 13:21 ./usr/lib/lua/luci
drwxr-s--- 2 jow jow  4096 Jan 30 13:21 ./usr/lib/lua/luci/controller
-rw-r----- 1 jow jow   251 Jan 30 13:21 ./usr/lib/lua/luci/controller/vpn-policy-routing.lua
drwxr-s--- 3 jow jow  4096 Jan 30 13:21 ./usr/lib/lua/luci/model
drwxr-s--- 2 jow jow  4096 Jan 30 13:21 ./usr/lib/lua/luci/model/cbi
-rw-r----- 1 jow jow 14568 Jan 30 13:21 ./usr/lib/lua/luci/model/cbi/vpn-policy-routing.lua
drwxr-s--- 3 jow jow  4096 Jan 30 13:21 ./usr/lib/lua/luci/view
drwxr-s--- 2 jow jow  4096 Jan 30 13:21 ./usr/lib/lua/luci/view/vpn-policy-routing
-rw-r----- 1 jow jow  2384 Jan 30 13:21 ./usr/lib/lua/luci/view/vpn-policy-routing/map-vpn-policy-routing.htm
-rw-r----- 1 jow jow   431 Jan 30 13:21 ./usr/lib/lua/luci/view/vpn-policy-routing/status.htm

Note the permissions for files (-rw-r----- instead of -rw-r--r--) and directories (drwxr-s--- instead of drwxr-xr-x). Maybe you didn't set your umask to 022 while building these packages?

3 Likes

fwiw, i ran into this issue ... on a build that I thought had been previously problem free... and nothing had changed.....

( i.e. installed from sources built months ago )

i don't run vpr ... i do have extroot and a changed hostname..... ( changed after statistics was installed )

the errors I could see highlighted cpu / wan-get failure...

changing uhttpd max requests 1 > 3 fixed wan... and changed the other error messages....

thanks to a kind soul above, adding
192.168.1.1 hostname
to /etc/hosts and changing localhost to hostname in /etc/config/luci_statistics totally silenced it.

So....... some of the messages;

<script src="/cgi-bin/luci/admin/translations/en?v=git-19.069.61084-db98461"></script> not exist
/usr/bin/stat-genconfig returning bool when expected str for cpu
etc. etc.

^ possibly not symptomatic.... i did see some commits re: languages ... i don't know if these threw anything out... could have sworn i build that firmware before those....

so... something with lua.... graph.... module instantiation... and hostnames... errors are totally strange tho'

hope that helps... but i don't think permissions are at the root.... unless we all have extroots.

Sorry, I moved to a new build server and some permissions got corrupted. I'm rebuilding all of my packages now with the fixed permissions.

1 Like

Well I have noticed the issue after installing VPR and everything was running fine before with ExtRoot so as @stangri and @jow mentioned it could be related to the permissions. We'll need to wait until new build of VPR is available.

Add me to the list of stats now failing.

Is there any kind of chmod we can do to clear this up till stangri fixes or is this just a wait thing?

I think @stangri fixed it maybe. The current release of VPR is 0.0.4-6 and it was -4 before so maybe you can try to check for an updated package. Or else just force install LuCI Statistics to make it work again.

1 Like

If you have my repo added to your router, run: opkg update; opkg install --force-reinstall luci-app-vpn-policy-routing; opkg install --force-reinstall luci-app-statistics;.

Thanks @txcanyon.

Did not fix directly but force reinstalling luci-app-statistics did.

1 Like

@stangri It seems the permissions issue is not fully resolved yet. After installing the version 0.0.4-7 I am again getting into problems with Graphs screen not showing and as @jow mentioned above I am still getting some weird permissions after installing the VPR.

root@AhmarRouter:~# cd /
root@AhmarRouter:/# ls -l
drwxr-xr-x    2 root     root           778 Apr 24 12:33 bin
drwxrwxrwx    7 root     root          4096 Apr 21 00:05 data
drwxr-xr-x    6 root     root          1060 Apr 27 19:28 dev
drwxr-sr-x    1 root     root          1024 Jan 30 17:21 etc
drwxr-xr-x    1 root     root          1024 Apr 24 18:22 lib
drwxr-xr-x    2 root     root             3 Apr 24 12:33 mnt
drwxr-xr-x    2 root     root          1024 Apr 27 18:53 opkg-lists
drwxr-xr-x    6 root     root          1024 Jan  1  1970 overlay
dr-xr-xr-x   93 root     root             0 Jan  1  1970 proc
drwxr-xr-x   16 root     root           235 Apr 24 12:33 rom
drwxr-xr-x    1 root     root          1024 Apr 24 20:17 root
drwxr-xr-x    2 root     root           929 Apr 24 12:33 sbin
drwxr-xr-x    4 root     root          1024 Apr 24 18:22 stats
dr-xr-xr-x   11 root     root             0 Jan  1  1970 sys
drwxrwxrwt   18 root     root           500 Apr 27 21:08 tmp
drwxr-xr-x    5 root     root          1024 Apr 27 21:23 transmission
drwxr-sr-x    1 root     root          1024 Jan 30 17:21 usr
lrwxrwxrwx    1 root     root             3 Apr 24 12:33 var -> tmp
drwxr-xr-x    4 root     root            79 Apr 24 12:33 www

The /usr directory has changed permissions to drwxr-sr-x while it should be actually drwxr-xr-x. Please fix those permissions ASAP. Thanks

0.0.5-0 did not resolve permission error. Had to force reinstall statistics

1 Like

I checked the permissions after installing VPR 0.0.5 and they were normal but it still broke the statistics page and had to force reinstall luci-app-statistics to make it work.

1 Like