openwrt / luci

LuCI - OpenWrt Configuration Interface
Apache License 2.0
6.38k stars 2.53k forks source link

192.168.1.1 aka openwrt.lan aka homepage not working #1872

Closed tojestzart closed 6 years ago

tojestzart commented 6 years ago

/usr/lib/lua/luci/dispatcher.lua:560: bad argument #1 to 'pairs' (table expected, got nil) stack traceback: [C]: in function 'pairs' /usr/lib/lua/luci/dispatcher.lua:560: in function 'createtree' /usr/lib/lua/luci/dispatcher.lua:220: in function 'dispatch' /usr/lib/lua/luci/dispatcher.lua:141: in function </usr/lib/lua/luci/dispatcher.lua:140>


linie od 560 z dispatchera : for k, v in pairs(index) do scope._NAME = k setfenv(v, scope) v() end

linie od 217: local c = ctx.tree local stat if not c then c = createtree() end

lnie od 140: local stat, err = util.coxpcall(function() dispatch(context.request) end, error500)

http.close()


http://openrouter.info/forum/viewtopic.php?f=22&t=4553&sid=e680dbf08fc30befd93e6e802dc5b5fb https://forum.lede-project.org/t/homepage-collapsed-itself-why/15426

hnyman commented 6 years ago

Some required config file is likely missing in /etc/config. Such config file that has impact on Luci menu structure, like e.g. luci_statistics

tojestzart commented 6 years ago

thanks for reply, how i can know what is missing ?

-----------------------------------------------------
     _________
    /        /\      _    ___ ___  ___
   /  LE    /  \    | |  | __|   \| __|
  /    DE  /    \   | |__| _|| |) | _|
 /________/  LE  \  |____|___|___/|___|                      lede-project.org
 \        \   DE /
  \    LE  \    /  -----------------------------------------------------------
   \  DE    \  /    Reboot (17.01.4, r3560-79f57e422d)
    \________\/    -----------------------------------------------------------

root@OpenWrt:~#
root@OpenWrt:~#
root@OpenWrt:~# opkg list
base-files - 173.1-r3560-79f57e422d
busybox - 1.25.1-4
ca-certificates - 20170717
ddns-scripts - 2.7.6-13
ddns-scripts_no-ip_com - 2.7.6-13
dnsmasq - 2.78-1
dropbear - 2017.75-2
firewall - 2017-05-27-a4d98aea-1
fstools - 2017-06-30-bdcb075f-1
fwtool - 1
glib2 - 2.50.2-2
hostapd-common - 2016-12-19-ad02e79d-6
ip6tables - 1.4.21-2
iptables - 1.4.21-2
iw - 4.9-1
iwinfo - 2016-09-21-fd9e17be-1
jshn - 2017-02-24-96305a3c-1
jsonfilter - 2016-07-02-dea067ad-1
kernel - 4.4.92-1-45d282495a15974d60f8edb091d0e2a9
kmod-ath - 4.4.92+2017-01-31-3
kmod-ath9k - 4.4.92+2017-01-31-3
kmod-ath9k-common - 4.4.92+2017-01-31-3
kmod-cfg80211 - 4.4.92+2017-01-31-3
kmod-gpio-button-hotplug - 4.4.92-2
kmod-ip6tables - 4.4.92-1
kmod-ipt-conntrack - 4.4.92-1
kmod-ipt-core - 4.4.92-1
kmod-ipt-nat - 4.4.92-1
kmod-lib-crc-ccitt - 4.4.92-1
kmod-mac80211 - 4.4.92+2017-01-31-3
kmod-nf-conntrack - 4.4.92-1
kmod-nf-conntrack6 - 4.4.92-1
kmod-nf-ipt - 4.4.92-1
kmod-nf-ipt6 - 4.4.92-1
kmod-nf-nat - 4.4.92-1
kmod-ppp - 4.4.92-1
kmod-pppoe - 4.4.92-1
kmod-pppox - 4.4.92-1
kmod-slhc - 4.4.92-1
kmod-tun - 4.4.92-1
lede-keyring - 2017-01-20-a50b7529-1
libattr - 20160302-1
libblkid - 2.29.2-1
libblobmsg-json - 2017-02-24-96305a3c-1
libc - 1.1.16-1
libffi - 3.2.1-2
libgcc - 5.4.0-1
libip4tc - 1.4.21-2
libip6tc - 1.4.21-2
libiwinfo - 2016-09-21-fd9e17be-1
libiwinfo-lua - 2016-09-21-fd9e17be-1
libjson-c - 0.12.1-1
libjson-script - 2017-02-24-96305a3c-1
liblua - 5.1.5-1
liblzo - 2.10-1
libmbedtls - 2.7.2-2
libmount - 2.29.2-1
libncurses - 6.0-1
libnl-tiny - 0.1-5
libopenssl - 1.0.2o-1
libpthread - 1.1.16-1
librpc - 2015-11-04-a921e3de-1
librt - 1.1.16-1
libubox - 2017-02-24-96305a3c-1
libubus - 2017-02-18-34c6e818-1
libubus-lua - 2017-02-18-34c6e818-1
libuci - 2016-07-04-e1bf4356-1
libuci-lua - 2016-07-04-e1bf4356-1
libuclient - 2017-09-06-24d6eded-1
libustream-mbedtls - 2016-07-02-ec80adaa-4
libustream-openssl - 2016-07-02-ec80adaa-4
libuuid - 2.29.2-1
libxtables - 1.4.21-2
logd - 2017-03-10-16f7e161-1
lua - 5.1.5-1
luci - git-17.290.79498-d3f0685-1
luci-app-ddns - 2.4.8-3
luci-app-firewall - git-17.290.79498-d3f0685-1
luci-app-openvpn - git-18.147.69097-36945b5-1
luci-base - git-17.290.79498-d3f0685-1
luci-i18n-base-pl - git-17.298.45605-07e7ff0-1
luci-i18n-openvpn-pl - git-18.147.69097-36945b5-1
luci-lib-ip - git-17.290.79498-d3f0685-1
luci-lib-jsonc - git-17.290.79498-d3f0685-1
luci-lib-nixio - git-17.290.79498-d3f0685-1
luci-lib-px5g - git-18.143.19815-d585fd7-1
luci-mod-admin-full - git-17.290.79498-d3f0685-1
luci-proto-ipv6 - git-17.290.79498-d3f0685-1
luci-proto-ppp - git-17.290.79498-d3f0685-1
luci-ssl - git-18.143.19815-d585fd7-1
luci-theme-bootstrap - git-17.290.79498-d3f0685-1
mc - 4.8.18-1
mtd - 21
netifd - 2017-01-25-650758b1-1
odhcp6c - 2017-01-30-c13b6a05-2
odhcpd - 2017-10-02-c6f3d5d4-2
openssl-util - 1.0.2o-1
openvpn-easy-rsa - 2013-01-30-ff5bfd1d-2
openvpn-openssl - 2.4.4-4
opkg - 2017-03-23-1d0263bb-1
ppp - 2.4.7-11
ppp-mod-pppoe - 2.4.7-11
procd - 2017-08-08-66be6a23-1
px5g-mbedtls - 6
px5g-standalone - 6
rpcd - 2016-12-03-0577cfc1-1
swconfig - 11
terminfo - 6.0-1
uboot-envtools - 2015.10-1
ubox - 2017-03-10-16f7e161-1
ubus - 2017-02-18-34c6e818-1
ubusd - 2017-02-18-34c6e818-1
uci - 2016-07-04-e1bf4356-1
uclient-fetch - 2017-09-06-24d6eded-1
uhttpd - 2017-08-19-3fd58e9b-1
uhttpd-mod-ubus - 2017-08-19-3fd58e9b-1
usign - 2015-07-04-ef641914-1
wpad-mini - 2016-12-19-ad02e79d-6
zlib - 1.2.11-1
root@OpenWrt:~#
-------------------------------------------
i can paste 'touched' files from me here
-------------------------------------------
root@OpenWrt:/etc/config# cat ddns

config ddns 'global'
        option ddns_dateformat '%F %R'
        option ddns_loglines '250'
        option upd_privateip '0'

config service 'dynamicznydns'
        option service_name 'no-ip.com'
        option lookup_host 'XXX.ddns.net'
        option domain 'XXXX.ddns.net'
        option username 'XXX'
        option password 'XXXX'
        option enabled '1'
        option force_unit 'minutes'
        option force_interval '12'

------------------------------------

root@OpenWrt:/etc/config# cat firewall

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone
        option name 'lan'
        list network 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

config zone
        option name 'wan'
        list network 'wan'
        list network 'wan6'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fe80::/10'
        option src_port '547'
        option dest_ip 'fe80::/10'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config include
        option path '/etc/firewall.user'

config rule
        option _name 'luci_wan'
        option src '*'
        option target 'ACCEPT'
        option proto 'tcp'
        option dest_port '443'
        option enabled '1'

config rule
        option target 'ACCEPT'
        option proto 'tcp'
        option name 'ssh'
        option src '*'
        option dest_port '222'

config zone
        option name 'vpn'
        option input 'ACCEPT'
        option forward 'ACCEPT'
        option output 'ACCEPT'
        option network 'vpn'
        option masq '1'

config forwarding
        option src 'vpn'
        option dest 'wan'

config rule
        option name 'OpenVPN'
        option target 'ACCEPT'
        option src 'wan'
        option proto 'udp'
        option dest_port '1194'

config forwarding
        option src 'vpn'
        option dest 'lan'

config rule
'       option name 'Allow-OpenVPN-Inbound
'       option target 'ACCEPT
'       option src '*
'       option proto 'tcpudp
'       option dest_port '1194

config zone
'       option name 'vpnserver
'       option input 'ACCEPT
'       option forward 'REJECT
'       option output 'ACCEPT
'       option masq '1
'       option network 'vpnserver

config forwarding
        option src 'vpnserver'
        option dest 'wan'

config forwarding
'       option src 'vpnserver
'       option dest 'lan

config rule
        option name 'Allow-OpenVPN-Inbound'
        option target 'ACCEPT'
        option src '*'
        option proto 'tcpudp'
        option dest_port '1194'

config zone
        option name 'vpnserver'
        option input 'ACCEPT'
        option forward 'REJECT'
        option output 'ACCEPT'
        option masq '1'
        option network 'vpnserver'

config forwarding
        option src 'vpnserver'
        option dest 'wan'

config forwarding
        option src 'vpnserver'
        option dest 'lan'

root@OpenWrt:/etc/config#
--------------------------------------
root@OpenWrt:/etc/config# cat network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fdae:a817:10d1::/48'

config interface 'lan'
        option ifname 'eth0'
        option force_link '1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option ifname 'eth1'
        option _orig_ifname 'eth1'
        option _orig_bridge 'false'
        option proto 'pppoe'
        option username 'xxxx'
        option password 'xxx'
        option ipv6 '1'

config interface 'wan6'
        option ifname '@wan'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 1 2 3 4'

config interface 'vpn'
        option ifname 'tun0'
        option proto 'none'

config interface 'vpnserver'
        option proto 'none'
        option ifname 'ovpns0'
        option auto '1'

root@OpenWrt:/etc/config#
--------------------------------
root@OpenWrt:/etc/config# cat openvpn

config openvpn 'home'
        option enabled '1'
        option dev 'tun0'
        option port '1194'
        option proto 'udp'
        option log '/tmp/openvpn.log'
        option verb '3'
        option ca '/etc/openvpn/ca.crt'
        option cert '/etc/openvpn/serwer.crt'
        option key '/etc/openvpn/serwer.key'
        option server '10.8.0.0 255.255.255.0'
        option dh '/etc/openvpn/dh2048.pem'
        list push 'redirect-gateway def1'

config openvpn 'vpnserver'
        list push 'comp-lzo yes'
        list push 'persist-key'
        list push 'persist-tun'
        list push 'topology subnet'
        list push 'route-gateway dhcp'
        list push 'route 192.168.200.0 255.255.255.0'
        list push 'dhcp-option DNS 192.168.1.1'
'       list push 'comp-lzo yes
'       list push 'persist-key
'       list push 'persist-tun
'       list push 'topology subnet
'       list push 'route-gateway dhcp
'       list push 'redirect-gateway def1
'       list push 'route 192.168.200.0 255.255.255.0
'       list push 'dhcp-option DNS 192.168.1.1
        list push 'comp-lzo yes'
        list push 'persist-key'
        list push 'persist-tun'
        list push 'topology subnet'
        list push 'route-gateway dhcp'
        list push 'redirect-gateway def1'
        list push 'route 192.168.200.0 255.255.255.0'
        list push 'dhcp-option DNS 192.168.1.1'
        option enabled '1'
        option dev_type 'tun'
        option dev 'ovpns0'
        option port '1194'
        option proto 'udp'
        option comp_lzo 'yes'
        option keepalive '10 120'
        option persist_key '1'
        option persist_tun '1'
        option ca '/etc/openvpn/ca.crt'
        option cert '/etc/openvpn/my-server.crt'
        option key '/etc/openvpn/my-server.key'
        option dh '/etc/openvpn/dh2048.pem'
        option tls_auth '/etc/openvpn/tls-auth.key 0'
        option mode 'server'
        option tls_server '1'
        option server '192.168.200.0 255.255.255.0'
        option topology 'subnet'
        option route_gateway 'dhcp'
        option client_to_client '1'

root@OpenWrt:/etc/config#
--------------------------
hnyman commented 6 years ago

please list the files in /etc/config "ls /etc/config"

Just think about recent changes: which config settings you have recently changed? have you installed/removed packages?

tojestzart commented 6 years ago
root@OpenWrt:~# ls /etc/config
ddns             luci             rpcd             uhttpd
ddns-opkg        network          system           wireless
dhcp             openvpn          tinyproxy
dropbear         openvpn-opkg     ubootenv
firewall         openvpn_recipes  ucitrack
root@OpenWrt:~#

============================== packages werent removed/installed , just tried to configure vpn connection

hnyman commented 6 years ago

just tried to configure vpn connection

Then my guess is that there is something wrong with vpn settings. You have both "openvpn" config plus the defaults from opkg installation "openvpn-opkg" that are there for reference.

Easiest cure might be to restore vpn settings as they were, if you have them backed up.

Hmm. it might actuall be invalid characters in your openvpn config file. Comments start with # and not ' That likely throws the parser in Luci off.

        list push 'dhcp-option DNS 192.168.1.1'
'       list push 'comp-lzo yes
'       list push 'persist-key
'       list push 'persist-tun
'       list push 'topology subnet
'       list push 'route-gateway dhcp
'       list push 'redirect-gateway def1
'       list push 'route 192.168.200.0 255.255.255.0
'       list push 'dhcp-option DNS 192.168.1.1
        list push 'comp-lzo yes'
tojestzart commented 6 years ago

thanks for path, removed those quotes

' | Single quote | U+0027 | APOSTROPHE from openvpn config + from firewall works now

web-apply commented 1 year ago

Hello