brvphoenix / luci-app-wrtbwmon

Bandwidth monitor for OpenWRT
251 stars 53 forks source link

Usage feature failed after install 2.0 #8

Closed assofour closed 4 years ago

assofour commented 4 years ago

I compiled openwrt with original like 1.0.7. It doesn't work well. So I removed it and install the luci-app-wrtbwmon_2.0.0-2_all.ipk. The Usage menu showed up, but after click, the below error came up

/usr/lib/lua/luci/dispatcher.lua:381: Failed to execute template dispatcher target for entry '/admin/nlbw/usage/details'.
The called action terminated with an exception:
/usr/lib/lua/luci/template.lua:39: Failed to load template 'wrtbwmon'.
Error while parsing template '/usr/lib/lua/luci/view/wrtbwmon.htm':
No such file or directory
stack traceback:
    [C]: in function 'assert'
    /usr/lib/lua/luci/dispatcher.lua:381: in function 'dispatch'
    /usr/lib/lua/luci/dispatcher.lua:95: in function </usr/lib/lua/luci/dispatcher.lua:94>

I downgrade the package to 1.6.3, I could see the page but it didn't work completely and style is messy.

The wrtbwmon version is 0.8.3. Openwrt kernel version is 4.19.106.

brvphoenix commented 4 years ago

You may need to download the current ipk from this url.

The current release with version 2.0.0-2 has no file 'wrtbwmon.htm'. If you have installed this version, you can try to clear the LuCI's cache by removing the '/tmp/luci-modulecache/' and '/tmp/luci-indexcache'.

assofour commented 4 years ago

Thanks. I removed all old version.Installed wrtbwmon 0.3.6 and latest version luci-app from the url you mentioned above.

root@edward_home_router:~# opkg install wrtbwmon_0.36_all.ipk 
Installing wrtbwmon (0.36) to root...
Configuring wrtbwmon.
root@edward_home_router:~# opkg install luci-app-wrtbwmon_2.0.0-2_all.ipk
Installing luci-app-wrtbwmon (2.0.0-2) to root...
Configuring luci-app-wrtbwmon.

Seems everything was going very well. Before that I did remove everything under the '/tmp/luci-modulecache/' and '/tmp/luci-indexcache'. Finally restart uhttpd. The result is the 'Usage' Menu gone under 'Bandwidth Monitor' and I can't find it in any menus.

So please help, it is really wired.

brvphoenix commented 4 years ago

@assofour Firstly, you should use the wrtbwmon from my repo. I have modified the wrtbwmon's database which will make it incompatiable to the origin one from pyrovski.

Secondly, the LuCI page for wrtbwmon in my repo is under the menu 'Network' for now, which may be different from other‘s.

assofour commented 4 years ago

I tried to do as following steps:

1. Remove all wrtbtmon related package from web management
2. root@edward_home_router:/tmp# rm luci-indexcache
3. root@edward_home_router:/tmp# rm luci-modulecache/*
4. root@edward_home_router:/tmp# opkg install /tmp/upload/wrtbwmon_1.2.0-1_all.ipk
5. Installing wrtbwmon (1.2.0-1) to root...
6. Configuring wrtbwmon.
7. root@edward_home_router:/tmp# opkg install /root/luci-app-wrtbwmon_2.0.0-2_all.ipk
8. Installing luci-app-wrtbwmon (2.0.0-2) to root...
9. Configuring luci-app-wrtbwmon.

After back to web, ever homepage couldn't be load, eveything's gone with the below error

/usr/lib/lua/luci/controller/wrtbwmon.lua:12: attempt to call global 'view' (a nil value) stack traceback: /usr/lib/lua/luci/controller/wrtbwmon.lua:12: in function 't' /usr/lib/lua/luci/dispatcher.lua:465: in function 'createtree' /usr/lib/lua/luci/dispatcher.lua:188: in function 'dispatch' /usr/lib/lua/luci/dispatcher.lua:95: in function </usr/lib/lua/luci/dispatcher.lua:94>

After panic and opkg remove luci-app-wrtbwmon, no change. and opkg remove wrtbwmon, it is back to normal.

any ideas? Thanks!

brvphoenix commented 4 years ago

@assofour Whether do you get the OpenWrt from the official site with branch 19.07 or branch master?

If you have used the non-official OpenWrt which may not be fully compatible to render by client side, you should use the release-1.6.3.

assofour commented 4 years ago

@brvphoenix I used all source from official site to compile the system.

root@edward_home_router:/tmp# cat /proc/version
Linux version 4.19.106 (edwardwang@owtcompiler) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r2126-628942c5)) #0 SMP Tue Mar 3 03:43:28 2020

Unlucky, neither 2.0.0 nor 1.6.3, they brought to same result.

brvphoenix commented 4 years ago

@assofour Test the version from here https://github.com/brvphoenix/luci-app-wrtbwmon/issues/6#issuecomment-581029979. Someone else have used with no other issues.

assofour commented 4 years ago

@assofour Test the version from here #6 (comment). Someone else have used with no other issues.

@brvphoenix

Tried the version. Error message changed a bit, wrtbwmon.lua: 11, the above was 12.

/usr/lib/lua/luci/controller/wrtbwmon.lua:11: attempt to call global 'view' (a nil value)
stack traceback:
    /usr/lib/lua/luci/controller/wrtbwmon.lua:11: in function 't'
    /usr/lib/lua/luci/dispatcher.lua:465: in function 'createtree'
    /usr/lib/lua/luci/dispatcher.lua:188: in function 'dispatch'
    /usr/lib/lua/luci/dispatcher.lua:95: in function </usr/lib/lua/luci/dispatcher.lua:94>
assofour commented 4 years ago

@brvphoenix

New finding, I tried to use web instead CLI to install packages, the amazing thing is installation went without problem. I can see the 'Traffic Status' under 'Network' now. The new problem is the 'details' page layout is messy and with no any data (1.6.3 & 2.0.0).

When I click the 'Configuration', 1.6.3 is okay.

2.0.0 reports error again:

/usr/lib/lua/luci/dispatcher.lua:381: Failed to execute function dispatcher target for entry '/admin/network/usage'.
The called action terminated with an exception:
/usr/lib/lua/luci/dispatcher.lua:381: Failed to execute template dispatcher target for entry '/admin/network/usage/details'.
The called action terminated with an exception:
/usr/lib/lua/luci/template.lua:39: Failed to load template 'wrtbwmon'.
Error while parsing template '/usr/lib/lua/luci/view/wrtbwmon.htm':
No such file or directory
stack traceback:
    [C]: in function 'assert'
    /usr/lib/lua/luci/dispatcher.lua:381: in function 'dispatch'
    /usr/lib/lua/luci/dispatcher.lua:95: in function </usr/lib/lua/luci/dispatcher.lua:94>

2.0.1 reports:

/usr/lib/lua/luci/dispatcher.lua:381: Failed to execute arcombine dispatcher target for entry '/admin/network/usage/config'.
The called action terminated with an exception:
/usr/lib/lua/luci/cbi.lua:38: Model 'wrtbwmon/config' not found!
stack traceback:
    [C]: in function 'assert'
    /usr/lib/lua/luci/dispatcher.lua:381: in function 'dispatch'
    /usr/lib/lua/luci/dispatcher.lua:95: in function </usr/lib/lua/luci/dispatcher.lua:94>

hope this helps locate the problem...

brvphoenix commented 4 years ago

@assofour It seems like that the cache is not cleared. I'm not very sure.

The first one is that the file 'usr/lib/lua/luci/view/wrtbwmon.htm' can't be found, which you can use winscp or other ssh client to verify whether that file exists.

The second one miss the file '/www/luci-static/resources/view/wrtbwmon/config.js'.

Besides, the 'arcombine' is not used in 2.00-2.

In fact, I have verified that it works well for both the official release 19.07.0 and the 18.06.x. Perhaps you can provide more details.

assofour commented 4 years ago

@brvphoenix I will try to adopt official version instead of self-compiled, seems latter one is with too many unexpectable issues.

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days