eggheads / eggdrop

The Eggdrop IRC Bot
GNU General Public License v2.0
506 stars 84 forks source link

.rehash could let bot die #1479

Open michaelortmann opened 1 year ago

michaelortmann commented 1 year ago

eggdrop version: current git develop: 901c3a129ca5126b061786498c0fc63701eeed00

.rehash
[23:40:30] tcl: builtin dcc call: *dcc:rehash -HQ 1 
[23:40:30] #-HQ# rehash
Rehashing.
[23:40:30] Writing user file...
[23:40:30] Writing channel file...
[23:40:30] Rehashing ...
[23:40:30] Writing channel file...
[23:40:30] Loading dccwhois.tcl...
[23:40:30] Loaded dccwhois.tcl
[23:40:30] Userinfo TCL v1.08 loaded (URL BF GF IRL EMAIL DOB PHONE ICQ YOUTUBE TWITCH).
[23:40:30] use '.help userinfo' for commands.
[23:40:30] Loaded quotepong.tcl
[23:40:30] tcldcc: setlisten(): getaddrinfo(): ip virtual.host.com not known
[23:40:30] Tcl error in file 'BotA.conf':
[23:40:30] this port is already bound to 0.0.0.0 on this machine, remove it before trying to bind to this IP
    while executing
"listen +3343 all"
    (file "BotA.conf" line 1618)
[23:40:30] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)

could be related to the garbage config setting set listen-addr "virtual.host.com" but that should not lead to the bot dying on .rehash

ia2115 commented 4 months ago

this also happends to me for some reason.

.rehash [17:38:17] #user# rehash Rehashing. [17:38:17] Rehashing ... [17:38:17] Tcl error in file 'eggdrop.conf': [17:38:17] this port is already bound to a specific IP on this machine, remove it before trying to bind to all interfaces while executing "listen 4040 all" (file "eggdrop.conf" line 37) [17:38:17] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR) Connection closed by foreign host.

anyone found out why this is happening?

michaelortmann commented 4 months ago

This is happening, when on rehash eggdrop tries to set a listen port to ANYIP (0.0.0.0 / ::) while eggdrop is already listening to that port, but on a specific IP.

listen 4040 all doesnt specify an IP, so that becomes ANYIP.

When listen ports are changed during eggdrops runtime via tcl listen that error is reported, but when the same change would happen during rehash eggdrop will die after reporting it. rehash should not change listen ports. so far so good. but i think eggdrop should not die during rehash either. Logging a warning instead should suffice.

.dccstat will show current listen IP/ports

.tcl listen [ip] <port> off removes a current listen IP/port

ia2115 commented 4 months ago

ye thats actually a good point, also i think documentation should point out how important it is in listen statement to include ip adress, without it you experience wierd stuff as i did, finally i found this and fixed my error.

im happy