BeBot - An Anarchy Online and Age Of Conan chat automaton
Archive => Anarchy Online Archive => AO 0.6 support => Topic started by: clashbot on November 03, 2009, 04:40:08 am
-
as some of you know I run 11 bots, only one is causing an issue though. Roster update seems to hang the bot up for an insane amount of time, with a few errors:
[02-Nov-2009 22:31:30] PHP Warning: socket_connect(): unable to connect - : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
in C:\Documents and Settings\Administrator\Desktop\james\0.5.1\0.5.1\main\14_Tools.php on line 171
any ideas what I can do to fix this, or is the xml from funcom for the roster nerfed again?
-
the sockets function doesnt seem to have a timeout in it
on my bots i changed the setting under !set tools
to use cURL which does have a timeout
-
it was set to sockets. and by an insane amount of time, I mean 15+ minutes for a roster update. Plus standard errors such as "Loading of xml failed"
-
well I did a quick and dirty fix, by emptying the whois tables and the online tables. It was still hanging up at the roster update. It is now working, with no other errors, so it appeared to be a bad connection to funcom's xml list. But will say the bot runs much faster with a smaller whois table..
As you can imagine, 11 bots worth of whois queries can add up over a years time.
-
forgot to mention, one of the other things I did was remove all the buddies from the bot toon and the slave. Was wondering if there was a simple module that could be written to purge this list and maybe set a date limit on the whois, so that if a query is xx days old it is removed? I think this would be a good optimization/maintenance tool.
-
I'we had these errors for a while as well.
When this happens my console fills up with:
PHP Warning: socket_connect(): unable to connect
Total Count: 4322
Total: 1
Counter is looping for about 15 minutes, there are even times where bot will hang for so long that it just crashes and restarts.
-
the sockets function doesnt seem to have a timeout in it
on my bots i changed the setting under !set tools
to use cURL which does have a timeout
I did this for my bots and it has helped them not hang also.
-
Glad I just found this topic.. I posted a thread on AO Forums because of this issue. Is there something wrong with FC's xml file that keeps causing this too happen? or is an issue with using sockets?
For reference, here is my post: http://forums.anarchy-online.com/showthread.php?t=565011
-
There is something wrong with Funcom servers.
This combined with a default socket timeout of 60 seconds in PHP 4.3+ wrecks havock.
I'm going to backport behaviour from BeBot 0.7 that makes curl used automatically if present, and I'll also be adding a socket timeout that should fix the issue for non curl users as well. *shakes fist at funcom for having borked servers*
-
Please test http://bazaar.launchpad.net/~bebot-devel/bebot/stable-0.6/annotate/head%3A/main/14_Tools.php
It should default to curl if it is available, and should also timeout normal socket operations.
-
Khalem it is installed on my bots now and seems to fix the lock-down issue that whois was having on my bots. Now it's just a matter of FC fixing their problems...
-
khalem getting a lot of errors with your modified tools...
warning socket_read(): unable to connect - : a connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. In \main\14_tools.php on line 167.
It then repeats with line 206, exact same message.
-
Hey guys, I'm consistantly seeing the following error here lately, be it v 6.5 or 6.6
Warning: socket_connect(): unable to connect [0]: A connection attempt failed be
cause the connected party did not properly respond after a period of time, or es
tablished connection failed because connected host has failed to respond.
in *\main\14_Tools.php on line 171
Insight/Fix for this available?
-
http://bebot.link/index.php/topic,2079.msg14148.html#msg14148
plugz, I think it is related to that topic there, but also check your php version as well.. I resolved a lot of my issues as far as that error message by upgrading the bot's php to the latest version.
-
I've got php 5.1 loaded with my bot. so covered there
Thanks for the link with the other thread, my raidbot is still on bebot, so I'll try those fixes there
-
Please test http://bazaar.launchpad.net/~bebot-devel/bebot/stable-0.6/annotate/head%3A/main/14_Tools.php
It should default to curl if it is available, and should also timeout normal socket operations.
testing this fix now as well
-
with new tools.php loaded, the following spam of errors:
in *\main\14_Tools.php on line 165
[22-Nov-2009 17:39:43] PHP Warning: socket_connect(): unable to connect [0]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
in *\main\14_Tools.php on line 165
[22-Nov-2009 17:45:30] PHP Warning: socket_read(): unable to read from socket [0]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
in *\main\14_Tools.php on line 204
[22-Nov-2009 17:45:56] PHP Warning: socket_connect(): unable to connect [0]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
in *\main\14_Tools.php on line 165
-
Just for the record. I highly recommend upgrading from PHP 5.1 to at the very least PHP 5.2.11, and preferably PHP 5.3.1
PHP 5.1.6 which was the last release in the 5.1 series is 3 years old.
-
yeah I was running the watered down version of 5.2, and finally did the full upgrade to 5.3.1, moving the php.exe and all dll's to the bot folder, copying all the extensions to the php_extensions folder, and just adding in the extension plugin info to the php.ini file in the bot folder. (Running it on windows....)
-
Just to clarify. The fix is not to remove the error message. (the error still occurs just as before, Funcoms servers does not respond)
The fix is to prevent the bot from freezing up for 60 seconds at a time when Funcom servers does not respond (which seems to be most of the time atm)
Since this seems to be confusing i modified the code (untested atm) to supress the PHP error messages and user our own error messages instead which should be more informative.
Please give this a whirl:
http://bazaar.launchpad.net/~bebot-devel/bebot/stable-0.6/annotate/head%3A/main/14_Tools.php
Please note, it will spam just as much, most likely, it will just be the bot handling the error message output instead of PHP.
-
khalem, could we merge this topic and the the other one concerning the sockets: http://bebot.link/index.php/topic,2098.msg14324.html#msg14324 (http://bebot.link/index.php/topic,2098.msg14324.html#msg14324) as I believe these are both related...
-
Done
-
ty sir! Just trying to keep the board clean...
-
the sockets function doesn't seem to have a timeout in it
on my bots i changed the setting under !set tools
to use cURL which does have a timeout
I did this for my bots and it has helped them not hang also.
hum... this setting of the tools seems to have broken the !items module. "cannot connect to the database"
I am still running the 0.6.5 bot... is this fixed in the 0.6.6 code? Anyone else seeing this behavior?
-
I doubt the item module is broken.
However what i suspect is happening is that you have a slow connection to the items database webserver causing the more agressive timeouts to stop waiting before the server can respond.
Was the bot always slow in responding with the items result previously?
Using cURL myself on all my bots and am not having a similar issue.
-
The response for the items module has always been pretty quick. but now the error is even faster :)
-
Shelly just to clarify, is this the default items module for the bot for AO or are you talking about a different items module?
-
Yes, This is the default items module... the one that has the icons... against vhab's database I think.
/*
* Central Items Database v1.1, By Vhab
* Latest version can always be found at: http://bebot.link/index.php/topic,380.0.html
* Details about the database itself: http://aodevs.com/index.php/topic,84.0.html
*
* BeBot - An Anarchy Online & Age of Conan Chat Automaton
* Copyright (C) 2004 Jonas Jax
* Copyright (C) 2005-2007 Thomas Juberg Stensås, ShadowRealm Creations and the BeBot development team.
*
* Developed by:
* - Alreadythere (RK2)
* - Blondengy (RK1)
* - Blueeagl3 (RK1)
* - Glarawyn (RK1)
* - Khalem (RK1)
* - Naturalistic (RK1)
* - Temar (RK1)
*
* See Credits file for all aknowledgements.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License only.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* File last changed at $LastChangedDate: 2008-11-30 23:09:06 +0100 (Sun, 30 Nov 2008) $
* Revision: $Id: Items.php 1833 2008-11-30 22:09:06Z alreadythere $
*/
-
k, just wanted to double check, my items was working ok, but that is not to say that there may have been a ping issue to vhab's base
-
I set tools back to Sockets and all is working once more... might be something wrong with my cURL application. I'll look at that later and let everyone know.
-
Looks to me this breaks alts system a little bit now...
Seems to just tell you it added the person but woun't even list it's name without stats when you do !alts on the main(or any other alt registerd to same main) that alt is registerd to, but if you try to add it again or do a manual whois it shows as an alt, didn't have this problem before I tried the modified tools modules atleast, but I get no errors in console from what I can see
-
Technically it shouldnt break it any more than it already was. It would just cause it to "break faster" as in instead of waiting 60 seconds to discover that, "gee wiz, i guess Funcom server isnt going to respond" it now figures this out a tad faster stopping the bot from hanging while it waits.
While it is possible that Funcom servers eventually would respond before the 60 seconds are up, i really don't think a timeout of 10 seconds is an unreasonable short time to wait for a responce from a web server.
Feel free to play around with the timeout value on line 94
function get_site($url, $strip_headers = 0, $server_timeout = 5, $read_timeout = 10)
read_timeout is the one you want to change.
Let me know if you find a sweet spot that is not excessive in terms of hanging the bot, keeping in mind that there will be times when the bot has to make several lookups in quick succession.
-
Hey Khalem,
My bots are already set to:
function get_site($url, $strip_headers = 0, $server_timeout = 25, $read_timeout = 30)
and
function get_site_sock($url, $strip_headers = 0, $server_timeout = 5, $read_timeout = 10)
I will play with these numbers to see what works best for me. The sock settings are actually smaller than the cURL settings if I read this correctly?
-
So far so good, but on all the posts here i didn't found any solution! Is there a clear comment whats to do here, I'll still get the error:
tocbot [GROUP] [MSG] [] Deadplaya: <a style="text-decoration:none" href="itemref://4085539/4085539/80/eccc0c9:cf85bdc6:a2b1a0f2:c60633b4/eccc0c9:cf85bdc6:a2b1a0f2:c60633b4">[Grizzly-Brigantine][/link]
Warning: socket_connect(): unable to connect [0]: Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht ordnungsgemäss reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat.
in C:\xampp\php\main\14_Tools.php on line 171
It's very confusing, sometimes when a player is posting items it won't show this error and sometimes it does.
I'm using PHP Version 5.3.0, think this is not bad at all.
Is this a problem located by Funcom? Or can you post a "updated" version of the 14_Tools.php file?
Thanx for your support!
dill
-
There is a link to the latest Tools file which will output more useful information further up. Although atm Launchpad is experiencing some issues with their bazaar viewer.
Your problem has nothing to do with Funcom, however it would appear that a module you are using, most likely items is trying to connect to a server to lookup or submit item information and failing to connect to the server.