{"action":"created","issue":{"url":"https://api.github.com/repos/openwrt/luci/issues/2027","repository_url":"https://api.github.com/repos/openwrt/luci","labels_url":"https://api.github.com/repos/openwrt/luci/issues/2027/labels{/name}","comments_url":"https://api.github.com/repos/openwrt/luci/issues/2027/comments","events_url":"https://api.github.com/repos/openwrt/luci/issues/2027/events","html_url":"https://github.com/openwrt/luci/issues/2027","id":346433645,"node_id":"MDU6SXNzdWUzNDY0MzM2NDU=","number":2027,"title":"A runtime error occured: /usr/lib/lua/luci/model/network.lua:187: attempt to index a nil value","user":{"login":"fnarfbargle","id":27184239,"node_id":"MDQ6VXNlcjI3MTg0MjM5","avatar_url":"https://avatars2.githubusercontent.com/u/27184239?v=4","gravatar_id":"","url":"https://api.github.com/users/fnarfbargle","html_url":"https://github.com/fnarfbargle","followers_url":"https://api.github.com/users/fnarfbargle/followers","following_url":"https://api.github.com/users/fnarfbargle/following{/other_user}","gists_url":"https://api.github.com/users/fnarfbargle/gists{/gist_id}","starred_url":"https://api.github.com/users/fnarfbargle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnarfbargle/subscriptions","organizations_url":"https://api.github.com/users/fnarfbargle/orgs","repos_url":"https://api.github.com/users/fnarfbargle/repos","events_url":"https://api.github.com/users/fnarfbargle/events{/privacy}","received_events_url":"https://api.github.com/users/fnarfbargle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-08-01T03:21:56Z","updated_at":"2018-08-03T08:45:18Z","closed_at":null,"author_association":"NONE","body":"For whatever reason I am unable to re-open : https://github.com/openwrt/luci/issues/1649\r\nI am again running a recent git head build : \r\ncommit 2a598bbaa3f75b7051c2453a6ccf706191cf2153\r\nAuthor: Rafał Miłecki <rafal@milecki.pl>\r\nDate:   Fri Jul 27 21:54:08 2018 +0200\r\n\r\nI have tracked this down to luci.ip returning nil for the the ipc.link(ifname) call.\r\n\r\nI inserted debugging code in network.lua prior to the failing line (local phy_only = force_phy_only or (ipc.link(ifname).type ~= 1)) :\r\n\r\n                        if ipc.link(ifname) == nil then                                                                \r\n                                utl.perror(\"ipc.link(ifname) is nil \" .. ifname)                                                                                                   \r\n                        end                                                                                            \r\n\r\nAnd got : Tue Jul 31 18:59:46 2018 daemon.err uhttpd[2337]: ipc.link(ifname) is nil wlan0\r\n\r\nThe subsequent call (ipc.link(ifname).type ~= 1) then succeeded.\r\n\r\nSo for whatever reason on this device, very intermittently (like once a day) that call will fail and return nil, which network.lua then attempts to index with the .type call and it fails.\r\n\r\nI attached the requested network interface dump to that report, but as I've been unable to re-open it I'll reference it here : https://github.com/openwrt/luci/files/1897666/network.interface.dump.txt\r\n\r\nI'm now not sure where to go next. Anyone have any ideas?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/openwrt/luci/issues/comments/410187978","html_url":"https://github.com/openwrt/luci/issues/2027#issuecomment-410187978","issue_url":"https://api.github.com/repos/openwrt/luci/issues/2027","id":410187978,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDE4Nzk3OA==","user":{"login":"fnarfbargle","id":27184239,"node_id":"MDQ6VXNlcjI3MTg0MjM5","avatar_url":"https://avatars2.githubusercontent.com/u/27184239?v=4","gravatar_id":"","url":"https://api.github.com/users/fnarfbargle","html_url":"https://github.com/fnarfbargle","followers_url":"https://api.github.com/users/fnarfbargle/followers","following_url":"https://api.github.com/users/fnarfbargle/following{/other_user}","gists_url":"https://api.github.com/users/fnarfbargle/gists{/gist_id}","starred_url":"https://api.github.com/users/fnarfbargle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnarfbargle/subscriptions","organizations_url":"https://api.github.com/users/fnarfbargle/orgs","repos_url":"https://api.github.com/users/fnarfbargle/repos","events_url":"https://api.github.com/users/fnarfbargle/events{/privacy}","received_events_url":"https://api.github.com/users/fnarfbargle/received_events","type":"User","site_admin":false},"created_at":"2018-08-03T08:45:18Z","updated_at":"2018-08-03T08:45:18Z","author_association":"NONE","body":"Ok, the error is failure in nl_connect(). On failure it is returning -6 : \r\n\r\nFri Aug  3 16:16:33 2018 daemon.err uhttpd[2337]: no nl_connect -6\r\nFri Aug  3 16:16:33 2018 daemon.err uhttpd[2337]: ipc.link(ifname) is nil wlan0\r\n\r\nIn libnl, -6 is NLE_EXIST \"Object exists\".\r\nSo the socket is created, nl_connect returns \"Object exists\", this uses _error() to push 3 elements onto the lua stack with the first element being 'nil', which may explain ipc.link(ifname) returning nil. I assume I should be able to pull the error number and description off the Lua stack also. Is this the right way to return an error to lua, as it doesn't seem to be handled?\r\n\r\nPlenty of instances splattered across google of similar errors using libnl. Some bletcherous examples of workarounds using loops and waits. I'll keep poking."}}
{"actor":{"display_login":"fnarfbargle"}}