OpenWrt Forum Archive

Topic: LUCI statistics - FLUCI

The content of this topic has been archived on 2 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

installed luci-statistics from buildroot, I got the menu entry on top of LUCI page, 'Collectd' - this works correctly, and 'Graphs' - clicking this one gives this error message:

/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute template dispatcher target for entry '/admin/statistics/graph'.
The called action terminated with an exception:
/usr/lib/lua/luci/template.lua:81: Failed to load template 'admin_statistics/index'.
Error while parsing template '/usr/lib/lua/luci/view/admin_statistics/index.htm':
Permission denied
stack traceback:
    [C]: in function 'assert'
    /usr/lib/lua/luci/dispatcher.lua:448: in function 'dispatch'
    /usr/lib/lua/luci/dispatcher.lua:195: in function </usr/lib/lua/luci/dispatcher.lua:194>

that file is mostly empty:

root@OpenWrt:~# ls -l /usr/lib/lua/luci/view/admin_statistics/index.htm
-rwxr-xr-x    1 root     root           669 Jul 26 14:07 /usr/lib/lua/luci/view/admin_statistics/index.htm
root@OpenWrt:~# 

why is that happening?

The statistics pages run as user nobody for security reasons, it seems the filesystem permissions are not sufficient.
The file permissions are okay, but check the read access of the parent directories.

I did:

root@OpenWrt:~# find  /usr/lib/lua/ -type d | xargs chmod 755
root@OpenWrt:~# find  /usr/lib/lua/ -type f | xargs chmod 755
root@OpenWrt:~# find  /www -type f | xargs chmod 755
root@OpenWrt:~# find  /www -type d | xargs chmod 755
root@OpenWrt:~# 

I can now enter the "Graphs" submenu, but when I try to click on 'Interfaces' 'Wireless' 'SystemLoad' getting another error

/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute call dispatcher target for entry '/admin/statistics/graph/iwinfo'.
The called action terminated with an exception:
/usr/lib/lua/luci/util.lua:209: attempt to get length of local 'str' (a nil value)
stack traceback:
    [C]: in function 'assert'
    /usr/lib/lua/luci/dispatcher.lua:448: in function 'dispatch'
    /usr/lib/lua/luci/dispatcher.lua:195: in function </usr/lib/lua/luci/dispatcher.lua:194>

any idea what can still be wrong?

still not working jow

What is the output of "uci show luci_statistics" ?

dumps this without error (however the LUCI err says something about empty "str")

root@OpenWrt:/usr/src/packages# uci show luci_statistics
luci_statistics.rrdtool=statistics
luci_statistics.rrdtool.default_timespan=1hour
luci_statistics.rrdtool.image_width=600
luci_statistics.rrdtool.image_path=/tmp/rrdimg
luci_statistics.collectd=statistics
luci_statistics.collectd.BaseDir=/var/run/collectd
luci_statistics.collectd.Include=/etc/collectd/conf.d
luci_statistics.collectd.PIDFile=/var/run/collectd.pid
luci_statistics.collectd.PluginDir=/usr/lib/collectd
luci_statistics.collectd.TypesDB=/usr/share/collectd/types.db
luci_statistics.collectd.Interval=30
luci_statistics.collectd.ReadThreads=2
luci_statistics.collectd_ping=statistics
luci_statistics.collectd_ping.enable=0
luci_statistics.collectd_ping.TTL=127
luci_statistics.collectd_ping.Interval=30
luci_statistics.collectd_ping.Hosts=127.0.0.1
luci_statistics.collectd_csv=statistics
luci_statistics.collectd_csv.enable=0
luci_statistics.collectd_csv.StoreRates=0
luci_statistics.collectd_csv.DataDir=/tmp
luci_statistics.collectd_df=statistics
luci_statistics.collectd_df.enable=0
luci_statistics.collectd_df.Devices=/dev/mtdblock/4
luci_statistics.collectd_df.MountPoints=/jffs
luci_statistics.collectd_df.FSTypes=tmpfs
luci_statistics.collectd_df.IgnoreSelected=0
luci_statistics.collectd_disk=statistics
luci_statistics.collectd_disk.enable=0
luci_statistics.collectd_disk.Disks=hda1 hdb
luci_statistics.collectd_disk.IgnoreSelected=0
luci_statistics.collectd_dns=statistics
luci_statistics.collectd_dns.enable=0
luci_statistics.collectd_dns.Interfaces=ffdhcp ff br-lan
luci_statistics.collectd_dns.IgnoreSources=127.0.0.1
luci_statistics.collectd_email=statistics
luci_statistics.collectd_email.enable=0
luci_statistics.collectd_email.SocketFile=/var/run/collectd/email.sock
luci_statistics.collectd_email.SocketGroup=nogroup
luci_statistics.collectd_exec=statistics
luci_statistics.collectd_exec.enable=0
luci_statistics.collectd_interface=statistics
luci_statistics.collectd_interface.enable=1
luci_statistics.collectd_interface.IgnoreSelected=0
luci_statistics.collectd_interface.Interfaces=br-lan wimax0
luci_statistics.collectd_iptables=statistics
luci_statistics.collectd_iptables.enable=1
luci_statistics.@collectd_iptables_match[0]=collectd_iptables_match
luci_statistics.@collectd_iptables_match[0].table=nat
luci_statistics.@collectd_iptables_match[0].chain=luci_fw_postrouting
luci_statistics.@collectd_iptables_match[0].target=MASQUERADE
luci_statistics.@collectd_iptables_match[0].source=192.168.1.0/24
luci_statistics.@collectd_iptables_match[0].outputif=br-ff
luci_statistics.@collectd_iptables_match[0].name=Verkehr LAN-Clients
luci_statistics.@collectd_iptables_match[1]=collectd_iptables_match
luci_statistics.@collectd_iptables_match[1].chain=luci_fw_postrouting
luci_statistics.@collectd_iptables_match[1].table=nat
luci_statistics.@collectd_iptables_match[1].target=MASQUERADE
luci_statistics.@collectd_iptables_match[1].source=10.61.230.0/24
luci_statistics.@collectd_iptables_match[1].outputif=br-ff
luci_statistics.@collectd_iptables_match[1].name=Verkehr WLAN-Clients
luci_statistics.collectd_irq=statistics
luci_statistics.collectd_irq.enable=0
luci_statistics.collectd_irq.Irqs=2 3 4 7
luci_statistics.collectd_load=statistics
luci_statistics.collectd_load.enable=1
luci_statistics.collectd_logfile=statistics
luci_statistics.collectd_logfile.enable=0
luci_statistics.collectd_logfile.LogLevel=notice
luci_statistics.collectd_logfile.File=/var/log/collectd.log
luci_statistics.collectd_logfile.Timestamp=1
luci_statistics.collectd_netlink=statistics
luci_statistics.collectd_netlink.enable=0
luci_statistics.collectd_netlink.IgnoreSelected=0
luci_statistics.collectd_netlink.VerboseInterfaces=br-lan br-ff
luci_statistics.collectd_netlink.QDiscs=br-lan br-ff
luci_statistics.collectd_network=statistics
luci_statistics.collectd_network.enable=0
luci_statistics.collectd_processes=statistics
luci_statistics.collectd_processes.enable=1
luci_statistics.collectd_processes.Processes=uhttpd dnsmasq dropbear
luci_statistics.collectd_tcpconns=statistics
luci_statistics.collectd_tcpconns.enable=1
luci_statistics.collectd_tcpconns.ListeningPorts=0
luci_statistics.collectd_tcpconns.LocalPorts=22 80
luci_statistics.collectd_unixsock=statistics
luci_statistics.collectd_unixsock.enable=0
luci_statistics.collectd_unixsock.SocketFile=/var/run/collectd/query.sock
luci_statistics.collectd_unixsock.SocketGroup=nogroup
luci_statistics.collectd_cpu=statistics
luci_statistics.collectd_cpu.enable=1
luci_statistics.collectd_rrdtool=statistics
luci_statistics.collectd_rrdtool.enable=1
luci_statistics.collectd_rrdtool.DataDir=/tmp/rrd
luci_statistics.collectd_rrdtool.RRARows=100
luci_statistics.collectd_rrdtool.RRASingle=1
luci_statistics.collectd_rrdtool.RRATimespans=1hour 1day 1week 1month 1year
luci_statistics.collectd_memory=statistics
luci_statistics.collectd_memory.enable=1
luci_statistics.collectd_conntrack=statistics
luci_statistics.collectd_conntrack.enable=1
luci_statistics.collectd_olsrd=statistics
luci_statistics.collectd_olsrd.enable=1
luci_statistics.collectd_olsrd.Port=2006
luci_statistics.collectd_olsrd.Host=127.0.0.1
luci_statistics.collectd_iwinfo=statistics
luci_statistics.collectd_iwinfo.enable=1
luci_statistics.collectd_iwinfo.Interfaces=wlan0
luci_statistics.collectd_iwinfo.IgnoreSelected=0
luci_statistics.collectd_nut=statistics
luci_statistics.collectd_nut.enable=0
luci_statistics.collectd_nut.UPS=myupsname
luci_statistics.collectd_uptime=statistics
luci_statistics.collectd_uptime.enable=1
....

Ok. Whats the permission of /etc/config/ and /etc/config/luci_statistics? Also attach the output of "uci export luci_statistics" here. Want to know if RRATimespans are a list of string options.

chmod 644 /etc/config/luci_statistics

this did the job! thanks!

wrt

is there a way to have the graph pages display all graphs on a single page? hour, day, week, month - so I only need to scroll?

@jow this stuff is getting me crazy again sad

after installing:

  182  opkg install luci-app-ddns_svn-r9869-1_ar71xx.ipk ddns-scripts_1.0.0-21_all.ipk 
  185  opkg install luci-app-ntpc_svn-r9869-1_ar71xx.ipk 
  193  opkg install luci-app-diag-core_svn-r9869-1_ar71xx.ipk luci-app-diag-devinfo_svn-r9869-1_ar71xx.ipk
  194  opkg install luci-app-diag-core_svn-r9869-1_ar71xx.ipk luci-app-diag-devinfo_svn-r9869-1_ar71xx.ipk smap* netdiscover* httping_1.5.2-1_ar71xx.ipk mac-to-devinfo_1.0.0-2_ar71xx.ipk 
  195  opkg install luci-app-diag-core_svn-r9869-1_ar71xx.ipk luci-app-diag-devinfo_svn-r9869-1_ar71xx.ipk smap* netdiscover* httping_1.5.2-1_ar71xx.ipk mac-to-devinfo_1.0.0-2_ar71xx.ipk libnet1_1.1.2.1-2_ar71xx.ipk 

getting again this error message:

/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute call dispatcher target for entry '/admin/statistics/graph/disk'.
The called action terminated with an exception:
/usr/lib/lua/luci/util.lua:209: attempt to get length of local 'str' (a nil value)
stack traceback:
    [C]: in function 'assert'
    /usr/lib/lua/luci/dispatcher.lua:448: in function 'dispatch'
    /usr/lib/lua/luci/dispatcher.lua:195: in function </usr/lib/lua/luci/dispatcher.lua:194>

on ALL "Graph" entries. The permissions are:

find /www/ -type d | xargs chmod 755
find /www/ -type f | xargs chmod 755
find /usr/lib/lua/ -type f | xargs chmod 755
find /usr/lib/lua/ -type d | xargs chmod 755
chmod 644 /etc/config/*

NOT helping sad
any idea?

ok found it: the 'opkg install' has set 750 on /etc and /etc/config sad

is there a way to prevent opkg resetting directory permissions to these bogus defaults? my umask is 0022, so it is not an umask problem - the permissions are stored badly into packages description.

I am also NOT getting any visible setting in LUCI page for these installed packages. E.g. no DynDNS:

root@OpenWrt:/usr/src/packages# opkg list-installed | grep app
luci-app-ddns - svn-r9869-1
luci-app-diag-core - svn-r9869-1
luci-app-diag-devinfo - svn-r9869-1
luci-app-firewall - svn-r9865-1
luci-app-ntpc - svn-r9869-1
luci-app-qos - svn-r9869-1
luci-app-samba - svn-r9869-1
luci-app-splash - svn-r9869-1
luci-app-statistics - svn-r9869-1
luci-app-wshaper - svn-r9869-1

I should be getting some menu point for DynDNS now, right?

NO setting at all for ddns, samba, diag - what is wrong?

(Last edited by kurczaq on 11 Aug 2013, 18:36)

oh fu***.... I removed the luci-client-splash package and now have all the other app packages visible in LUCI menu... WTF!

The discussion might have continued from here.