Closed angusding closed 7 years ago
What versions of Chrome/Opera are you using?
I have a "solution" in mind but I want you to test it first to see if that's the actual problem. Are you familiar with the vi
command line editor?
Chrome version: 55.0.2883.87 (64-bit) Opera version: 43.0.2442.806 (PGO) I can use vim and edit what your solution need.
@angusding OK, try editing the file /usr/lib/lua/luci/view/wrtbwmon.htm
. Change the line 10 from:
<option value="5" selected>5 seconds</option>
to
<option value="5" selected="selected">5 seconds</option>
And then try to load the page. Let me know if the error disappears.
The new error information as follows:
This page contains the following errors:
error on line 216 at column 32: StartTag: invalid element name
Below is a rendering of the page up to the first error.
The page "usage" display new information: "Loading..." and "Auto update every" option.
Seems like the browser tries to display the page as an XML file. Can you provide a screenshot of what you see when you try to load the page with developer tools open? I want to take a look on the request and response headers.
Also, can you please paste here the contents of the /etc/config/uhttpd
file?
root@WNDR3700v4:/tmp# cat /etc/config/uhttpd
config uhttpd 'main'
list listen_http '0.0.0.0:80'
list listen_http '[::]:80'
list listen_https '0.0.0.0:443'
list listen_https '[::]:443'
option home '/www'
option rfc1918_filter '1'
option max_requests '3'
option max_connections '100'
option cert '/etc/uhttpd.crt'
option key '/etc/uhttpd.key'
option cgi_prefix '/cgi-bin'
option script_timeout '60'
option network_timeout '30'
option http_keepalive '20'
option tcp_keepalive '1'
option ubus_prefix '/ubus'
config cert 'px5g'
option days '730'
option bits '1024'
option country 'DE'
option state 'Berlin'
option location 'Berlin'
option commonname 'OpenWrt'
root@OpenWrt:~# cat /etc/config/uhttpd
config uhttpd 'main'
list listen_http '0.0.0.0:80'
list listen_http '[::]:80'
list listen_https '0.0.0.0:443'
list listen_https '[::]:443'
option redirect_https '0'
option home '/www'
option rfc1918_filter '1'
option max_requests '3'
option max_connections '100'
option cert '/etc/uhttpd.crt'
option key '/etc/uhttpd.key'
option cgi_prefix '/cgi-bin'
option script_timeout '60'
option network_timeout '30'
option http_keepalive '20'
option tcp_keepalive '1'
option ubus_prefix '/ubus'
config cert 'px5g'
option days '730'
option bits '1024'
option country 'ZZ'
option state 'Somewhere'
option location 'Uknown'
option commonname 'OpenWrt'
That's the configuration of BB and CC. They have the same error information.
Thanks, can you also provide the Response and Request Headers from the developer tools?
This is how to get them on Chrome:
Ctrl+Shift+I
Network
tabFilter
text input there is a button-like filter named Doc
; click itCopy
-> Copy request headers
and Copy response headers
.That's you want?
GET /cgi-bin/luci/;stok=fdd36e3a0fca084101b95734636a78dd/admin/network/usage/ HTTP/1.1
Host: 192.168.0.1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: http://192.168.0.1/cgi-bin/luci/;stok=fdd36e3a0fca084101b95734636a78dd/admin/network/usage/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: zh-CN,zh;q=0.8
Cookie: sysauth=b45c5aa7e24774a88647b14708a19947
Yes, and the response headers please.
HTTP/1.1 200 OK
Connection: Keep-Alive
Transfer-Encoding: chunked
Keep-Alive: timeout=20
Vary: Accept
Content-Type: application/xhtml+xml
Cache-Control: no-cache
Expires: 0
OK. Can you please try one more edit on the same /usr/lib/lua/luci/view/wrtbwmon.htm
file on line 148:
from:
'<td title="' + data[1] + '">' + data[0] + '<br>' + data[2] + '</td>',
to
'<td title="' + data[1] + '">' + data[0] + '<br />' + data[2] + '</td>',
Let me know how it goes.
That's OK. The new error information:
This page contains the following errors:
error on line 216 at column 32: StartTag: invalid element name
Below is a rendering of the page up to the first error.
As if nothing changed. request headers:
GET /cgi-bin/luci/;stok=ff4c8646e2fabfaea37b69954c24c14e/admin/network/usage/ HTTP/1.1
Host: 192.168.0.1
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: http://192.168.0.1/cgi-bin/luci/;stok=ff4c8646e2fabfaea37b69954c24c14e/admin/network/usage/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: zh-CN,zh;q=0.8
Cookie: sysauth=54315d67aae38b593f3222f5253353bd
response headers:
HTTP/1.1 200 OK
Connection: Keep-Alive
Transfer-Encoding: chunked
Keep-Alive: timeout=20
Vary: Accept
Content-Type: application/xhtml+xml
Cache-Control: no-cache
Expires: 0
OK, I think I found the issue.
One more edit and it should fix the problem. Please, add this line
//<![CDATA[
below the <script>
tag in line 28.
And this line
//]]>
before the </script>
tag in line 241.
Yes. The error message disappears. Just keep loading ...
GET /cgi-bin/luci/;stok=ff4c8646e2fabfaea37b69954c24c14e/admin/network/usage/ HTTP/1.1
Host: 192.168.0.1
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: http://192.168.0.1/cgi-bin/luci/;stok=ff4c8646e2fabfaea37b69954c24c14e/admin/network/usage/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: zh-CN,zh;q=0.8
Cookie: sysauth=54315d67aae38b593f3222f5253353bd
HTTP/1.1 200 OK
Connection: Keep-Alive
Transfer-Encoding: chunked
Keep-Alive: timeout=20
Vary: Accept
Content-Type: application/xhtml+xml
Cache-Control: no-cache
Expires: 0
So nothing happens?
Can you open the developer tools again, click the Console
tag and take a screenshot after you refresh?
Console message: http://192.168.0.1/cgi-bin/luci/;stok=1bea057eca64e8098809446aaba7ea9f/admin/network/usage/usage_data 404 (Not Found)
Thanks a lot @angusding for the effort!
I have all I need now to create a new version with the fixes.
This issue will be closed when the new version is uploaded.
I setup wrtbwmon and luci-wrtbwmon in OpenWrt Chaos Calmer and Barrier Breaker. But all of them can't display "Network Usage:". It display the same error in the Chrome and Opera browser.
That's the contents of the file /tmp/usage.db: