#1056 /usr/lib/prosody/net/dns.lua:676: table index is nil
Reporter
Peer Heinlein
Owner
Zash
Created
Updated
Stars
★ (1)
Tags
Priority-Medium
Status-Fixed
Type-Defect
Milestone-0.10
Peer Heinlein
on
We're seeing some errors in our log we should report:
Dec 10 07:31:29 general error Top-level error, please report:
/usr/lib/prosody/net/dns.lua:676: table index is nil
Dec 10 07:31:29 general error
stack traceback:
[C]: in function 'loop'
/usr/lib/prosody/net/server_event.lua:751: in function </usr/lib/prosody/net/server_event.lua:750>
[C]: in function 'xpcall'
/usr/bin/prosody:400: in function 'loop'
/usr/bin/prosody:431: in main chunk
[C]: ?
Dec 10 07:31:29 general error Top-level error, please report:
/usr/lib/prosody/net/dns.lua:676: table index is nil
Dec 10 07:31:29 general error
stack traceback:
[C]: in function 'loop'
/usr/lib/prosody/net/server_event.lua:751: in function </usr/lib/prosody/net/server_event.lua:750>
[C]: in function 'xpcall'
/usr/bin/prosody:400: in function 'loop'
/usr/bin/prosody:431: in main chunk
[C]: ?
root@xmpp:~# prosodyctl about
Prosody 0.10 nightly build 447 (2017-11-18, 5edb0d01a94f)
# Prosody directories
Data directory: /var/lib/prosody
Config directory: /etc/prosody
Source directory: /usr/lib/prosody
Plugin directories:
/usr/lib/prosody/prosody-community-modules - prosody-modules rev: 668447566edf
/usr/lib/prosody/modules
/usr/lib/prosody/modules/
# Lua environment
Lua version: Lua 5.1
Lua module search paths:
/usr/lib/prosody/?.lua
/usr/local/share/lua/5.1/?.lua
/usr/local/share/lua/5.1/?/init.lua
/usr/local/lib/lua/5.1/?.lua
/usr/local/lib/lua/5.1/?/init.lua
/usr/share/lua/5.1/?.lua
/usr/share/lua/5.1/?/init.lua
Lua C module search paths:
/usr/lib/prosody/?.so
/usr/local/lib/lua/5.1/?.so
/usr/lib/x86_64-linux-gnu/lua/5.1/?.so
/usr/lib/lua/5.1/?.so
/usr/local/lib/lua/5.1/loadall.so
LuaRocks: Not installed
# Lua module versions
lfs: LuaFileSystem 1.6.2
libevent: 2.0.21-stable
luaevent: 0.4.4
lxp: LuaExpat 1.3.0
socket: LuaSocket 3.0-rc1
ssl: 0.5.PR
Zash
on
Thanks for the report. It looked familiar, and I spotted #976, so this is technically a duplicate.
Do you have any debug logs leading up to this?
Changes
tags Status-NeedInfo
owner Zash
sven
on
Hi, the debug log doesn't show more informations about that issue :(
below are the latest details
Apr 26 23:47:06 adns debug Sending DNS query to 195.10.208.2
Apr 26 23:47:06 adns debug Sending DNS query to 195.10.208.2
Apr 26 23:47:06 socket debug new connection established. id: 1c96de10
Apr 26 23:47:06 general error Top-level error, please report:
/usr/lib/prosody/net/dns.lua:676: table index is nil
Apr 26 23:47:06 general error
stack traceback:
[C]: in function 'loop'
/usr/lib/prosody/net/server_event.lua:751: in function </usr/lib/prosody/net/server_event.lua:750>
[C]: in function 'xpcall'
/usr/bin/prosody:400: in function 'loop'
/usr/bin/prosody:431: in main chunk
[C]: ?
Apr 26 23:47:06 general error Top-level error, please report:
/usr/lib/prosody/net/dns.lua:676: table index is nil
Apr 26 23:47:06 general error
stack traceback:
[C]: in function 'loop'
/usr/lib/prosody/net/server_event.lua:751: in function </usr/lib/prosody/net/server_event.lua:750>
[C]: in function 'xpcall'
/usr/bin/prosody:400: in function 'loop'
/usr/bin/prosody:431: in main chunk
[C]: ?
prosodyctl about
Prosody 0.10 nightly build 455 (2017-12-11, 384658c7a26a)
# Prosody directories
Data directory: /var/lib/prosody
Config directory: /etc/prosody
Source directory: /usr/lib/prosody
Plugin directories:
/usr/lib/prosody/prosody-community-modules - prosody-modules rev: 902ecd6400bd
/usr/lib/prosody/modules
/usr/lib/prosody/modules/
# Lua environment
Lua version: Lua 5.1
Lua module search paths:
/usr/lib/prosody/?.lua
/usr/local/share/lua/5.1/?.lua
/usr/local/share/lua/5.1/?/init.lua
/usr/local/lib/lua/5.1/?.lua
/usr/local/lib/lua/5.1/?/init.lua
/usr/share/lua/5.1/?.lua
/usr/share/lua/5.1/?/init.lua
Lua C module search paths:
/usr/lib/prosody/?.so
/usr/local/lib/lua/5.1/?.so
/usr/lib/x86_64-linux-gnu/lua/5.1/?.so
/usr/lib/lua/5.1/?.so
/usr/local/lib/lua/5.1/loadall.so
LuaRocks: Not installed
# Lua module versions
lfs: LuaFileSystem 1.6.2
libevent: 2.0.21-stable
luaevent: 0.4.4
lxp: LuaExpat 1.3.0
socket: LuaSocket 3.0-rc1
ssl: 0.5.PR
Zash
on
Thanks. "new connection established" is a hint at least, but lua-/libevent throws away the real traceback, obscuring the issue.
The error happens when inserting DNS response records into the cache.
A packet capture of the response would be helpful.
Zash
on
I have discovered that this error can happen if the DNS library tries to cache/remember a record that it does not support, or which lacks decoded data. In my case it happened because of a TLSA record. The weird thing is that these should not normally be cached, so I'm still interested in packet captures that can reproduce what you've seen.
Changes
tags Status-Started Milestone-0.10
Zash
on
The error is also in #819 suggesting that this happens with DNAMEs
We're seeing some errors in our log we should report: Dec 10 07:31:29 general error Top-level error, please report: /usr/lib/prosody/net/dns.lua:676: table index is nil Dec 10 07:31:29 general error stack traceback: [C]: in function 'loop' /usr/lib/prosody/net/server_event.lua:751: in function </usr/lib/prosody/net/server_event.lua:750> [C]: in function 'xpcall' /usr/bin/prosody:400: in function 'loop' /usr/bin/prosody:431: in main chunk [C]: ? Dec 10 07:31:29 general error Top-level error, please report: /usr/lib/prosody/net/dns.lua:676: table index is nil Dec 10 07:31:29 general error stack traceback: [C]: in function 'loop' /usr/lib/prosody/net/server_event.lua:751: in function </usr/lib/prosody/net/server_event.lua:750> [C]: in function 'xpcall' /usr/bin/prosody:400: in function 'loop' /usr/bin/prosody:431: in main chunk [C]: ? root@xmpp:~# prosodyctl about Prosody 0.10 nightly build 447 (2017-11-18, 5edb0d01a94f) # Prosody directories Data directory: /var/lib/prosody Config directory: /etc/prosody Source directory: /usr/lib/prosody Plugin directories: /usr/lib/prosody/prosody-community-modules - prosody-modules rev: 668447566edf /usr/lib/prosody/modules /usr/lib/prosody/modules/ # Lua environment Lua version: Lua 5.1 Lua module search paths: /usr/lib/prosody/?.lua /usr/local/share/lua/5.1/?.lua /usr/local/share/lua/5.1/?/init.lua /usr/local/lib/lua/5.1/?.lua /usr/local/lib/lua/5.1/?/init.lua /usr/share/lua/5.1/?.lua /usr/share/lua/5.1/?/init.lua Lua C module search paths: /usr/lib/prosody/?.so /usr/local/lib/lua/5.1/?.so /usr/lib/x86_64-linux-gnu/lua/5.1/?.so /usr/lib/lua/5.1/?.so /usr/local/lib/lua/5.1/loadall.so LuaRocks: Not installed # Lua module versions lfs: LuaFileSystem 1.6.2 libevent: 2.0.21-stable luaevent: 0.4.4 lxp: LuaExpat 1.3.0 socket: LuaSocket 3.0-rc1 ssl: 0.5.PR
Thanks for the report. It looked familiar, and I spotted #976, so this is technically a duplicate. Do you have any debug logs leading up to this?
ChangesHi, the debug log doesn't show more informations about that issue :( below are the latest details Apr 26 23:47:06 adns debug Sending DNS query to 195.10.208.2 Apr 26 23:47:06 adns debug Sending DNS query to 195.10.208.2 Apr 26 23:47:06 socket debug new connection established. id: 1c96de10 Apr 26 23:47:06 general error Top-level error, please report: /usr/lib/prosody/net/dns.lua:676: table index is nil Apr 26 23:47:06 general error stack traceback: [C]: in function 'loop' /usr/lib/prosody/net/server_event.lua:751: in function </usr/lib/prosody/net/server_event.lua:750> [C]: in function 'xpcall' /usr/bin/prosody:400: in function 'loop' /usr/bin/prosody:431: in main chunk [C]: ? Apr 26 23:47:06 general error Top-level error, please report: /usr/lib/prosody/net/dns.lua:676: table index is nil Apr 26 23:47:06 general error stack traceback: [C]: in function 'loop' /usr/lib/prosody/net/server_event.lua:751: in function </usr/lib/prosody/net/server_event.lua:750> [C]: in function 'xpcall' /usr/bin/prosody:400: in function 'loop' /usr/bin/prosody:431: in main chunk [C]: ? prosodyctl about Prosody 0.10 nightly build 455 (2017-12-11, 384658c7a26a) # Prosody directories Data directory: /var/lib/prosody Config directory: /etc/prosody Source directory: /usr/lib/prosody Plugin directories: /usr/lib/prosody/prosody-community-modules - prosody-modules rev: 902ecd6400bd /usr/lib/prosody/modules /usr/lib/prosody/modules/ # Lua environment Lua version: Lua 5.1 Lua module search paths: /usr/lib/prosody/?.lua /usr/local/share/lua/5.1/?.lua /usr/local/share/lua/5.1/?/init.lua /usr/local/lib/lua/5.1/?.lua /usr/local/lib/lua/5.1/?/init.lua /usr/share/lua/5.1/?.lua /usr/share/lua/5.1/?/init.lua Lua C module search paths: /usr/lib/prosody/?.so /usr/local/lib/lua/5.1/?.so /usr/lib/x86_64-linux-gnu/lua/5.1/?.so /usr/lib/lua/5.1/?.so /usr/local/lib/lua/5.1/loadall.so LuaRocks: Not installed # Lua module versions lfs: LuaFileSystem 1.6.2 libevent: 2.0.21-stable luaevent: 0.4.4 lxp: LuaExpat 1.3.0 socket: LuaSocket 3.0-rc1 ssl: 0.5.PR
Thanks. "new connection established" is a hint at least, but lua-/libevent throws away the real traceback, obscuring the issue. The error happens when inserting DNS response records into the cache. A packet capture of the response would be helpful.
I have discovered that this error can happen if the DNS library tries to cache/remember a record that it does not support, or which lacks decoded data. In my case it happened because of a TLSA record. The weird thing is that these should not normally be cached, so I'm still interested in packet captures that can reproduce what you've seen.
ChangesThe error is also in #819 suggesting that this happens with DNAMEs
Fixed in https://hg.prosody.im/0.10/rev/fcf42bd7d067 Please test the fix.
Changes