Bot won't start on a BOA (barracuda-octopus-aegir) webserver.

The error is:

# drush bot-start
Drush command terminated abnormally due to an unrecoverable error.                                                 [error]
Error: require_once(): Failed opening required 'Net/SmartIRC.php'
(include_path='.:/opt/local/lib/php:/usr/lib/php5') in
/data/disk/o1/distro/001/drupal-7.24.1-prod/sites/bot.example.com/modules/bot/bot.smartirc.inc, line 12

Steps:

  1. I installed a BOA server (on Debian7)
  2. Created a site name bot.example.com
  3. Installed PEAR
  4. Installed NET_SmartIRC
  5. Got 'bot' with git
  6. Enabled bot in Drupal

And then tried to start it with drush.
I am not sure, but it seems like it searches for files on a different path than they exist.

Some info from locate:

locate SmartIRC.php
/usr/share/php/Net/SmartIRC.php

Any help is most welcomed,
Bill

Comments

bserem’s picture

Issue summary: View changes
Morbus Iff’s picture

At this point, it's not an error with Bot so much as Net_SmartIRC not being in your PHP library path. You'd have to find out where it was installed to, then ensure the library is in your path first, before it becomes a problem truly related to the bot codebase.

Morbus Iff’s picture

Category: Bug report » Support request
Status: Active » Postponed (maintainer needs more info)
bserem’s picture

I had to copy the "Net" folder manually under php and I managed to get to the next step:

# drush bot-start
Feb 02 17:52:02 SmartIRC.php(453) WARNING: socket extension not loaded, trying to load it...
Feb 02 17:52:02 SmartIRC.php(465) WARNING: couldn't load the socket extension
Feb 02 17:52:02 SmartIRC.php(466) WARNING: your PHP build doesn't support real sockets, will use fsocks instead
Feb 02 17:52:02 SmartIRC.php(556) DEBUG_CHANNELSYNCING: Channel syncing enabled
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(0) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(1) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(2) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(3) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(4) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(5) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(6) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(7) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(8) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(9) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(10) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(11) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(12) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(13) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(14) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(15) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(16) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(17) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(18) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(19) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(20) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(21) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(22) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(23) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(24) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(25) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(26) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(27) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(28) registered
Feb 02 17:52:02 SmartIRC.php(1450) DEBUG_ACTIONHANDLER: actionhandler(29) registered
Feb 02 17:52:02 SmartIRC.php(1552) DEBUG_TIMEHANDLER: timehandler(0) registered
Feb 02 17:52:02 SmartIRC.php(1552) DEBUG_TIMEHANDLER: timehandler(1) registered
Feb 02 17:52:02 SmartIRC.php(1552) DEBUG_TIMEHANDLER: timehandler(2) registered
Feb 02 17:52:02 SmartIRC.php(1031) DEBUG_CONNECTION: connecting
Feb 02 17:52:02 SmartIRC.php(1040) DEBUG_SOCKET: using fsockets
Feb 02 17:53:02 SmartIRC.php(1052) DEBUG_NOTICE: couldn't connect to "irc.freenode.net" reason: "Connection timed out (110)"
Feb 02 17:53:02 SmartIRC.php(2373) DEBUG_CONNECTION: delaying reconnect for 10000 ms
Feb 02 17:53:12 SmartIRC.php(1147) DEBUG_CONNECTION: reconnecting...
Feb 02 17:53:12 SmartIRC.php(1031) DEBUG_CONNECTION: connecting
Feb 02 17:53:12 SmartIRC.php(1040) DEBUG_SOCKET: using fsockets

I can ping irc.freenode.net.
I suppose that the issue here is with SmartIRC? I do not think that BOA would like me to change the php build.

bserem’s picture

Status: Postponed (maintainer needs more info) » Active
Morbus Iff’s picture

Status: Active » Postponed (maintainer needs more info)

According to that log, your server can't connect to Freenode:

Feb 02 17:53:02 SmartIRC.php(1052) DEBUG_NOTICE: couldn't connect to "irc.freenode.net" reason: "Connection timed out (110)"

You might want to ensure that your server doesn't have a firewall blocking the IRC ports, you might want to ensure that you can even run an IRC bot on your server (most web hosts won't allow it), and alternatively, you could try to toggle the "Use real sockets for IRC server communication" checkbox on admin/config/bot/core.

Dave Reid’s picture

Freenode has also been under attack today with lots of servers down, so there's a chance it might be that as well.

bserem’s picture

Considering that I can't connect from my desktop at the moment, I believe it is better to wait a few hours and try again later. Thanks for the heads up, I'll post back when I have more info!

bserem’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

I can't manage to make it work. It has probably nothing to do with the module, I'll digg into it later this week.

Thanks for your support :)

bserem’s picture

Steps to make bot connect:
as root in the BOA server:

export PATH=$PATH:/opt/local/bin
pear install net_smartirc

Add port 6667 on line #54 on /etc/csf/csf.conf and restart csf (csf -r)
Start the bot.

I do not yet know the security implications of this. I'm still digging.

bserem’s picture

Instead of allowing port 6667 on the whole server, I went enabling it for one user only.
This user is the one starts-stops the bot, and has only one drupal-site under his control (the bot site).

To do that, I edited /etc/csf/csf.allow and added the following line:
tcp|out|d=6667||u=UID
where UID is the user ID on the operating system (linux debian since we talk about BOA).

Hope this info helps :)