PHP IRC Bot - Ping Timeout

These are old archives. They are kept for historic purposes only.
Post Reply
Spencer
Posts: 5
Joined: Fri Jul 16, 2010 12:27 am

PHP IRC Bot - Ping Timeout

Post by Spencer »

Hi,

I'm trying to get Botzilla ( http://botzilla.org/ ) to connect to my IRC network, but it won't. It will "Ping Timeout" after 60 seconds.
I am, however, able to get it to connect to other IRC networks, such as Freenode.

Here's my allow block...
allow {
ip *@*;
hostname *@*;
class clients;
maxperip 5;
};
Please let me know if I need to post anymore info.

Thanks.
Stealth
Head of Support
Posts: 2086
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: PHP IRC Bot - Ping Timeout

Post by Stealth »

Do you have a raw output of the bots attempted connection?
Spencer
Posts: 5
Joined: Fri Jul 16, 2010 12:27 am

Re: PHP IRC Bot - Ping Timeout

Post by Spencer »

On the IRC client, I can see this in the server details area (like where the motd rules, etc are)...
*** Notice -- Client connecting on port 6667: bot (bot@*ip_removed*) [clients]
And here's all I have for the bot connection logs...
[17/07 @ 22:53]-> USER bot yourhost yourserver :bot

[17/07 @ 22:53]-> NICK bot yourhost

[17/07 @ 22:53]<- :domain_removed.com 001 bot :Welcome to the IRC Network bot!bot@*ip_removed*

[17/07 @ 22:53]<- :domain_removed.com 002 bot :Your host is domain_removed.com, running version Unreal3.2.8.1

[17/07 @ 22:53]<- :domain_removed.com 003 bot :This server was created Fri Jul 16 2010 at 03:12:10 MSD

[17/07 @ 22:53]<- :domain_removed.com 004 bot domain_removed.com Unreal3.2.8.1 iowghraAsORTVSxNCWqBzvdHtGp lvhopsmntikrRcaqOALQbSeIKVfMCuzNTGj

[17/07 @ 22:53]<- :domain_removed.com 005 bot UHNAMES NAMESX SAFELIST HCN MAXCHANNELS=10 CHANLIMIT=#:10 MAXLIST=b:60,e:60,I:60 NICKLEN=30 CHANNELLEN=32 TOPICLEN=307 KICKLEN=307 AWAYLEN=307 MAXTARGETS=20 :are supported by this server

[17/07 @ 22:53]<- :domain_removed.com 005 bot WALLCHOPS WATCH=128 WATCHOPTS=A SILENCE=15 MODES=12 CHANTYPES=# PREFIX=(qaohv)~&@%+ CHANMODES=beI,kfL,lj,psmntirRcOAQKVCuzNSMTG NETWORK=Community-IRC CASEMAPPING=ascii EXTBAN=~,cqnr ELIST=MNUCT STATUSMSG=~&@%+ :are supported by this server

[17/07 @ 22:53]<- :domain_removed.com 005 bot EXCEPTS INVEX CMDS=KNOCK,MAP,DCCALLOW,USERIP :are supported by this server

[17/07 @ 22:53]<- :domain_removed.com 251 bot :There are 8 users and 3 invisible on 2 servers

[17/07 @ 22:53]<- :domain_removed.com 252 bot 9 :operator(s) online

[17/07 @ 22:53]<- :domain_removed.com 254 bot 2 :channels formed

[17/07 @ 22:53]<- :domain_removed.com 255 bot :I have 2 clients and 1 servers

[17/07 @ 22:53]<- :domain_removed.com 265 bot :Current Local Users: 2 Max: 5

[17/07 @ 22:53]<- :domain_removed.com 266 bot :Current Global Users: 11 Max: 13

[17/07 @ 22:53]<- :domain_removed.com 422 bot :MOTD File is missing

[17/07 @ 22:53]<- :bot MODE bot :+iwx

[17/07 @ 22:53]<- :NickServ!services@domain_removed.com NOTICE bot :Your nick isn't registered.

[17/07 @ 22:54]<-

[17/07 @ 22:55]<- PING :domain_removed.com

[17/07 @ 22:56]<-

[17/07 @ 22:56]<- ERROR :Closing Link: bot[*ip_removed*] (Ping timeout)
Stealth
Head of Support
Posts: 2086
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: PHP IRC Bot - Ping Timeout

Post by Stealth »

[17/07 @ 22:55]<- PING :domain_removed.com
[17/07 @ 22:56]<-
[17/07 @ 22:56]<- ERROR :Closing Link: bot[*ip_removed*] (Ping timeout)
This is exactly why the server is killing you. You MUST respond to PING. You should probably ask the botzilla people why their bot isn't conforming to the IRC standard.
bbby
Posts: 1
Joined: Sat Jul 17, 2010 6:36 pm

Re: PHP IRC Bot - Ping Timeout

Post by bbby »

Yup, that'd be my bad.
A solution is described (without code) at http://botzilla.org/wp/?p=114

Basically, it's waiting for the MOTD, which the output says is missing.
The block that listens for PINGs can be moved into the connect method to get respond in time.

In my defense, botzilla has been a pet project for years, and made with really only freenode in mind.
It could definitely be improved. The source is open, and I've incorporated people's changes before.
It sadly receives very little attention, and this is not the first time this problem has occurred. Perhaps I should do something about that :|

Let me know you're able to connect.
Spencer
Posts: 5
Joined: Fri Jul 16, 2010 12:27 am

Re: PHP IRC Bot - Ping Timeout

Post by Spencer »

I fixed the issue by adding a MOTD file.

//Solved
katsklaw
Posts: 1124
Joined: Sun Apr 18, 2004 5:06 pm
Contact:

Re: PHP IRC Bot - Ping Timeout

Post by katsklaw »

bbby wrote:Yup, that'd be my bad.
A solution is described (without code) at http://botzilla.org/wp/?p=114

Basically, it's waiting for the MOTD, which the output says is missing.
The block that listens for PINGs can be moved into the connect method to get respond in time.

In my defense, botzilla has been a pet project for years, and made with really only freenode in mind.
It could definitely be improved. The source is open, and I've incorporated people's changes before.
It sadly receives very little attention, and this is not the first time this problem has occurred. Perhaps I should do something about that :|

Let me know you're able to connect.
it's highly suggested that you make the bot RFC1459 compliant at the very least. There is no reason to have the bot wait for MOTD or any other server output to reply to required commands such as PING. RFC1459 doesn't cover individual IRCd protocols and nothing says PING must come after MOTD.

Additionally numeric 422 (MOTD file missing) is an RFC required message and you're bot should treat it as if it was the motd in the first place. So no need to expect numerics 372/376 as the only acceptable MOTD reply.

RFC1459 can be found HERE.
Post Reply