Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#1118 - bad argument #1 to 'tonumber' (string expected, got nil) #6236

Closed
openwrt-bot opened this issue Oct 26, 2017 · 3 comments
Closed
Labels

Comments

@openwrt-bot
Copy link

brianjmurrell:

Supply the following if possible:

  • Device problem occurs on

Any device without iptables

  • Software versions of LEDE release, packages, etc.

17.01.04

  • Steps to reproduce

Build a firmware with luci and without iptables, flash it and then go to the router's status page:
http://dir-615/cgi-bin/luci/?status=1

You will get:

/usr/lib/lua/luci/dispatcher.lua:460: Failed to execute function dispatcher target for entry '/'. The called action terminated with an exception: /usr/lib/lua/luci/dispatcher.lua:460: Failed to execute firstchild dispatcher target for entry '/admin'. The called action terminated with an exception: /usr/lib/lua/luci/dispatcher.lua:460: Failed to execute function dispatcher target for entry '/admin/status'. The called action terminated with an exception: /usr/lib/lua/luci/dispatcher.lua:460: Failed to execute template dispatcher target for entry '/admin/status/overview'. The called action terminated with an exception: /usr/lib/lua/luci/template.lua:97: Failed to execute template 'admin_status/index'. A runtime error occured: [string "/usr/lib/lua/luci/view/admin_status/index.h..."]:34: bad argument #1 to 'tonumber' (string expected, got nil) stack traceback: [C]: in function 'assert' /usr/lib/lua/luci/dispatcher.lua:460: in function 'dispatch' /usr/lib/lua/luci/dispatcher.lua:141: in function

From IRC:

(11:03:42 AM) jow: Shred00: but anyhow, try something along the lines of local conn_count = tonumber(s.readfile("/proc/sys/net/netfilter/nf_conntrack_count") or "") or 0
(11:05:05 AM) Shred00: jow: yeah, that fixes it.
(11:05:17 AM) jow: Shred00: can you tell me the version of Lua installed on your system?
(11:05:38 AM) Shred00: lua - 5.1.5-1
(11:05:42 AM) jow: Shred00: and provide the output of lua -e 'print(tonumber(nil))` ?
(11:06:02 AM) Shred00: # lua -e 'print(tonumber(nil))'
(11:06:02 AM) Shred00: nil
(11:06:20 AM) jow: I don't get it
(11:07:06 AM) jow: well anyhow, will add the fix to the repo later
(11:07:15 AM) jow: defensive programmis is never wrong
(11:07:18 AM) jow: *programming

@openwrt-bot
Copy link
Author

brianjmurrell:

Additionally, due to the lack of iptables, the syslog get spammed with:

Oct 26 13:48:41 dir-615 uhttpd[748]: sysctl: error: 'net.nf_conntrack_max' is an unknown key

@openwrt-bot
Copy link
Author

brianjmurrell:

Any chance of getting this very simple bug fix landed?

PR in openwrt/luci#1459

@openwrt-bot
Copy link
Author

yousong:

The change was just backported to lede-17.01 branch of luci repo. Thanks for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant