BeBot - An Anarchy Online and Age Of Conan chat automaton
Archive => Age of Conan Archive => AoC 0.6 support => Topic started by: Baldrick on October 14, 2009, 12:59:56 pm
-
Hi all,
First of all, thanks for this cool development. Our guild enjoys using the bot a lot.
I do have a small problem; I get Read Error: EOF fairly frequently. From what I can tell from console, this happens most in relation to someone doing !whois, particularly on a character that doesn't exist.
It looks like if a !whois is done, it triggers a Buddy-Add event, and if this person does not exist the event fails and the bot disconnects with an EOF error.
Here's some output:
Thespeaker [TELL] [INC] Sunay: !whois Sephpom
Thespeaker [TELL] [OUT] -> Sunay: Sephpom is a level 20 Priest of Mitra :: Offline :: Alt of Sephiriot :: [link]Details[/link]
Thespeaker [TELL] [INC] Sunay: !whois ach
Thespeaker [BUDDY] [BUDDY-ADD] Ach
Read error: EOF
Thespeaker [CONN] [ERROR] Bot has disconnected. Reconnecting in 60 seconds.
The bot then reconnects and works ok, until this scenario occurs again.
I have also seen it happen on other Buddy-Add events, not sure what triggered them.
Any ideas what needs changing to fix it?
Thanks in advance!
-
Hi, are you running latest stable 0.6.5?
-
Sorry. I forgot to include that ><
Yes this is the latest stable version.
-
Would it have anything to do with the code mentioned in this thread?
http://bebot.link/aoc-modules/autogratz-doesn%27t-gratz-%28/ (http://bebot.link/aoc-modules/autogratz-doesn%27t-gratz-%28/)
My Main.php contains the code
case 20:
// Silently ignore for now (AOCP_CLIENT_NAME)
break;
case AOCP_MSG_PRIVATE:
// Event is a tell
and not
case 20:
// Silently ignore for now (AOCP_CLIENT_NAME)
if ($bot -> aoc -> buddy_exists($args[0]))
{
$bot -> aoc -> buddy_remove($args[0]);
$bot -> aoc -> buddy_add($args[0]);
}
break;
case AOCP_MSG_PRIVATE:
// Event is a tell
-
This looks like a nasty bug.
I'll see if i can find some time to do some testing on this.
-
Thank you! If I can assist in testing in any way, please let me know.
-
One more update; apparently there is a buddy-add event in queue for whenever one particular user logs on. The user will logon and thus join the guild channel, the bot signals this, and tries to run the same buddy-add event every time, resulting in a crash. The bot then restarts, logs on again after a while, and since the user is already in the channel the event doesn't reoccur. When user logs off and on again however, the same scenario repeats.
See log here:
Thespeaker [BUDDY] [LOG] Nimu changed status [1] (MEMBER)
Thespeaker [BUDDY] [BUDDY-ADD] Torden
Thespeaker [BUDDY] [LOG] Nimu changed status [6] (MEMBER)
Read error: EOF
Thespeaker [CONN] [ERROR] Bot has disconnected. Reconnecting in 60 seconds.
The bot is restarting.
Is there any way for me to remove this recurring buddy-add event for this particular user?
-
I have just narrowed it down a bit more. As it turns out, the user crashing the !whois was not a member of the guild. I mean, the person doing the whois is, but the person on whom the whois was done was not.
I have made this target person a guild member, triggering a different kind of adduser event, and the problem is gone.
It seems this issue only occurs when someone does a !whois on a character not known to the bot.
Hope that helps the code checking :)
-
Was anything ever resolved with this? I think I am getting a similar issue with the 6.6 version, but I have not had a chance to look into it much yet. I will post more when I can.
-
I still get the same problem when the BUDDY-ADD queue that is displayed on bot startup is too big. It usually lists some people that have left the guild, and then ends in EOF.
-
The same problem is again happening, this time for a character that is in the "BUDDY-ADD" queue that has already been deleted (from the game). The character in question is an alt of an existing member.
Everytime this member logs on, on his main or any of his alts, the bot dies as it initiates a buddy-add for the deleted character at this time - causing the EOF error.
Right now I have no way of clearing this queue as far as I know - so whenever he shows up, the bot dies.
Is there any way to fix this?
-
Well, it's come back with a vengeance - i see lots of buddy-add events when either people log on who have done a !whois on this person, or when people join who have an alt who is on this list...and even people who left the guild and have been deleted as a member.
The bot keeps trying to add them in the buddy-add queue, which causes an EOF, and crashes.
That makes the bot reconnect, which of course boots me from the game :)
Any suggestions would be appreciated.
-
Sorry for the delay on this. Studies have been keeping me far to busy as of late.
I've been thinking about this one for a bit and I'm a bit puzzeled at what is actually going on.
Try adding the following debug code so we can get a better idea of what is happeneing:
main/15_AOChatWrapper.php
Find
$this -> bot -> aoc -> buddy_add($uid);
$this -> bot -> log("BUDDY", "BUDDY-ADD", $this -> get_uname($uid));
Replace with:
$this -> bot -> log("BUDDY", "BUDDY-ADD", $this -> get_uname($uid) . '(' . $uid . ')');
$this -> bot -> aoc -> buddy_add($uid);
(Notice also the changed order)
Next, Sources\AOChat.php, find the function add_buddy and add the following line before the last return call
echo "Debug: buddy_add called with final UID $uid passed to server.\n";
Hopefully this will give a better idea of what is going on.
-
No worries, I appreciate the time you've put into this project.
In the meantime I had decided to completely reinstall the bot, new SQL database, new code download, new bare PHP.ini.
I then added my favorite modules back in and let it run as usual.
Although this wasn't a bad exercise to begin with because everything is nice, clean and fast, it didn't resolve the issue. The "stuck queue" was obviously cleared, but I did see it occurring again with a queued up buddy-add event where it actually tried to add an entity displaying the ID rather than the nickname, and I got the familiar EOF.
I then decided to switch off the buddy-queue altogether and have not had an issue since.
If anyone else has this problem and you want to troubleshoot the issue, I'm willing to switch the buddy-queue back on and add in the code, but it might be a while before the issue occurs again as the "queue" is now empty and the error is not always triggered.
If I'm the only one who had this then I'd say switching off buddy-queueing is a good enough solution for me.
Let's see who replies :)
Cheers,
B
-
one thing you can try, is to log onto the bot toon, and manually delete the offending toon from the friends list. See if that resolves, or temporarily patches your error...Otherwise it might be a problem with the org xml on funcom's server as I ran into something similar a long time ago concerning an orgmate who's name was changed by a GM. Caused all sorts of hell for the bot.
-
Hi!
I actually tried that, before I did my reinstall. It didn't resolve the issue, as it didn't clean out the "buddy-add-queue" so to speak.
The member/friends list would be nice and clean, but since this as far as I know is separate from the "friends to be added queue" it doesn't affect that. The EOF error always occurred before this person was successfully added as a friend.
I suppose it would be solved if whatever table stores the list of buddies to be added is cleaned out after x amount of time (like a few days or roster updates maybe?). Any buddy that could be added trouble free will have been added by then, and any remaining entry will most likely be a defective one that can be wiped from the queue.
Mind you, this is me speculating based on what I've seen, not on me understanding the code ;D
-
Still having major issues with this. Any good solution been found? Is there any specific table or tables I need to clear out of those who appear to be causing the issues? Seems like I am missing something that needs to have rows deleted.
-
No one has yet provided me with the feedback requested at http://bebot.link/index.php/topic,2058.msg14243.html#msg14243 and thus nothing more has been done about this issue.
I have not had time to go hunting around without this feedback as I am in the middle of exams atm. So if you could provide said feedback it would provide a better starting point to resolve this issue.
-
I was logging the errors but managed to misread where to paste one of the lines. I will try to reproduce this later after raiding. It seems just calling a roster update should get this to happen. I had planned on looking into this more, but not had much time with a new job and holidays and stuff.
-
Here is the result of the last roster update.
Guildbot [2009-12-03 03:14:13] [ROSTER] [UPDATE] Starting roster update for guild id: 1 on RKSet
Guildbot [2009-12-03 03:14:13] [GROUP] [MSG] [Pestilence] Guildbot: Roster update starting ::: System busy
Guildbot [2009-12-03 03:14:13] [BUDDY] [BUDDY-ADD] 4294967295(17262896)
Debug: buddy_add called with final UID 17262896 passed to server.
Guildbot [2009-12-03 03:14:13] [BUDDY] [BUDDY-ADD] 17262896(4294967295)
Debug: buddy_add called with final UID 4294967295 passed to server.
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Warning: socket_write(): unable to write to socket [32]: Broken pipe in /bebot/Sources/AOChat.php on line 480
Read error: EOF
Warning: socket_write(): unable to write to socket [32]: Broken pipe in /bebot/Sources/AOChat.php on line 480
Read error: EOF
...
Warning: socket_write(): unable to write to socket [32]: Broken pipe in /bebot/Sources/AOChat.php on line 480
Read error: EOF
Guildbot [2009-12-03 03:14:15] [SETTINGS] [SAVED] connected for module irc set to FALSE as datatype bool
Guildbot [2009-12-03 03:14:15] [CONN] [ERROR] Bot has disconnected. Reconnecting in 60 seconds.
-
There is definately something odd happening here.
Thank you for the debug output. I cannot promise when i will be able to investigate further, but this gives me a fairly good idea of where to start.
Put plainly, it seems the bot does not apparently see it as a problem that someones name is an integer value.
I might need to have you run some more debug code to see the order of packets, as it offhand seems like the first buddy_add is not causing a disconnect, but the second is. And both appear to be for invalid players.
-
Did you need any more feedback for this Khalem?
The problem is occurring more and more again now that my bot has been running for a while.
Thanks
B
-
I'll try to schedule some time for this this weekend.
I do apologize for the delays. Things have been a tad too crazy for my liking over the past few months. Christmas vacation boiled down to 2 days which was pretty much spent doing as little as possible :P
(The entire dev team seem a bit swamped atm :( which has slowed things down to a crawl. We might need more manpower :P *glances in Getrix's general direction*)
I'll keep you posted in case i fail replicating the issue.
-
Khalem ... would this possible be related to user table records not getting deleted when the buddylist is cleared? My user table is full of crap, numerics, that never seem to go away even when I !buddtlist clear. I looked in the code but did not find where its suppose to delete records in the user table. There may be junk records there that's causing the problem for Apollyon.
-
Please test the following workaround (this is not a fix, but it should stop the bot from adding invalid buddies)
in main/15_AOChatWrapper.php on line 133-134 find
if (!($this -> bot -> aoc -> buddy_exists($uid)) && $uid != 0 && $uid != -1
&& $uid != $this -> get_uid($this -> bot -> botname) && $this -> get_uname($uid) != -1)
Change this to
if (!($this -> bot -> aoc -> buddy_exists($uid)) && $uid != 0 && $uid != -1
&& $uid != $this -> get_uid($this -> bot -> botname) && $this -> get_uname($uid) != -1 && !is_numeric($this -> get_uname($uid)) )
This should stop the bot from adding anyone with a userid as username.
@Riccarr
The user table and buddylist are two separate entities. Our problem seems to relate to the fact that Funcom's chatserver handles deleted characters different from Anarchy Online.
The probable correct fix would be to change get_uname to do is_numeric checks, but we also need to clean out entries in the users table with numeric usernames.
Drowned in studies unfortunately as the last and current semesters are quite intensive.
-
Same issue is back with a vengeance, the frequent buddy-adds of invalid characters causes EOFs constantly, which boots me from the game (as the bot runs on my account).
I know which invalid characters are the culprit, is there any way I can remove these manually?
Thanks,
B
-
Even with the fix in my previous post??
That seems very odd as that should prevent ANY buddy adds on the problematic buddies.
The above fix is to stop the disconnect, but will not fix the underlying problem.
-
Here's the relevant lines from my 15_AOChatWrapper.php:
/* Buddies */
function buddy_add($user, $que = TRUE)
{
$add = true;
if (empty($user) || ($uid = $this -> get_uid($user)) === false)
{
return false;
}
else
{
if (!($this -> bot -> aoc -> buddy_exists($uid)) && $uid != 0 && $uid != -1
&& $uid != $this -> get_uid($this -> bot -> botname) && $this -> get_uname($uid) != -1 && !is_numeric($this -> get_uname($uid)) )
{
if (!$que || $this -> bot -> core("buddy_queue") -> check_queue())
{
$this -> bot -> aoc -> buddy_add($uid);
$this -> bot -> log("BUDDY", "BUDDY-ADD", $this -> get_uname($uid));
return true;
}
else
{
$return = $this -> bot -> core("buddy_queue") -> into_queue($uid, $add);
return $return;
}
}
else
return false;
And here are two examples of the bot keeling over, both from days after the code change:
Thespeaker [BUDDY] [LOG] Augir changed status [1] (MEMBER)
Thespeaker [BUDDY] [BUDDY-ADD] Sephirioth
Thespeaker [BUDDY] [LOG] Augir changed status [6] (MEMBER)
Read error: EOF
Thespeaker [SETTINGS] [SAVED] connected for module irc set to FALSE as datatype bool
Thespeaker [CONN] [ERROR] Bot has disconnected. Reconnecting in 60 seconds.
The bot is restarting.
Thespeaker [BUDDY] [LOG] Lenybar changed status [1] (ADMIN)
Thespeaker [BUDDY] [BUDDY-ADD] Peternicus
Thespeaker [BUDDY] [LOG] Lenybar changed status [6] (ADMIN)
Read error: EOF
Thespeaker [SETTINGS] [SAVED] connected for module irc set to FALSE as datatype bool
Thespeaker [CONN] [ERROR] Bot has disconnected. Reconnecting in 60 seconds.
The bot is restarting.
It's always the same (invalid) users causing the crash.
Any suggestions?
Thanks,
B.
-
@Baldrick
Could you reproduce the error with the debugging code from http://bebot.link/aoc-0-6-support/read-error-eof-on-whoisbuddy-add-event/msg14243/#msg14243
Deleting the users from the users table should stop them from being added, but I'm starting to fear we have no way of detecting these as you seem to be having a different issue from the one outlined by Apollyon.
-
I did the following:
* add code as you suggested
* Clear buddy lists, the "bad user IDs" didnt show up in the list of deleted buddies
* I ran a whois to force the buddy-add issue as Ive seen before this triggers it. Below what happened:
Thespeaker [TELL] [INC] Astreas: !whois peternicus
Thespeaker [BUDDY] [BUDDY-ADD] Sephirioth(4294967295)
Debug: buddy_add called with final UID 4294967295 passed to server.
Read error: EOF
I don't know if it's got all those accounts mixed up somehow...the bot crashes currently on 3 invalid IDs, Sephirioth, Peternicus and Nidlefs.
What do you think?
B
-
Guildbot [2010-01-26 03:35:09] [BUDDY] [LOG] Alexander changed status [1] (MEMBER)
Guildbot [2010-01-26 03:35:09] [BUDDY] [BUDDY-ADD] Quickstop(4294967295)
Debug: buddy_add called with final UID 4294967295 passed to server.
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Guildbot [2010-01-26 03:35:09] [BUDDY] [BUDDY-ADD] Rhaistlo(17309048)
Debug: buddy_add called with final UID 17309048 passed to server.
Guildbot [2010-01-26 03:35:09] [BUDDY] [LOG] Alexander changed status [6] (MEMBER)
Read error: EOF
Believe Quickstop is an alt of Alexander. Quickstop was not in the users table or on the friends list.
-
Thespeaker [BUDDY] [LOG] Terhalis changed status [1] (ADMIN)
Thespeaker [BUDDY] [BUDDY-ADD] Woeful(4294967295)
Debug: buddy_add called with final UID 4294967295 passed to server.
Thespeaker [BUDDY] [LOG] Terhalis changed status [6] (ADMIN)
Read error: EOF
Same error again...Woeful is not an alt of Terhalis.
-
This looks bad.
From the recent output there seems we have no way of telling if it is an invalid character or not.
Not sure how to attack this offhand.
Baldrick: Any chance you could send me a database dump from your bot? PM, Email or Dropbox etc?
-
Guildbot [2010-01-30 19:27:50] [BUDDY] [BUDDY-ADD] Johnysins(4294967295)
Debug: buddy_add called with final UID 4294967295 passed to server.
Guildbot [2010-01-30 19:27:50] [BUDDY] [LOG] Johnyhox changed status [6] (MEMBER)
Warning: socket_read(): unable to read from socket [104]: Connection reset by peer in /home/tiwaz/bebot/Sources/AOChat.php on line 305
Read error: Connection reset by peer
Need a copy of mine as well?
-
This has been a problem for our bot for months. A whois on an invalid character name will trigger the bot crash. Adding an invalid character as an alt will get the bot to crash repeatedly until it's manually deleted from the users and alts tables.
My debug follows:
Taobot [2010-02-02 20:00:42] [TELL] [INC] Ganesa: !whois adfadfg
Taobot [2010-02-02 20:00:42] [BUDDY] [BUDDY-ADD] Adfadfg(4294967295)
Debug: buddy_add called with final UID 4294967295 passed to server.
Read error: EOF
Taobot [2010-02-02 20:00:42] [CONN] [ERROR] Bot has disconnected. Reconnecting in 60 seconds.
This is with the workaround attempt in place. Looks the same without.
Thank you for your attention to this matter!
-
Fix as follows: Change main/15_AOChatWrapper.php
if (!($this -> bot -> aoc -> buddy_exists($uid)) && $uid != 0 && $uid != -1
&& $uid != $this -> get_uid($this -> bot -> botname) && $this -> get_uname($uid) != -1)
to
if (!($this -> bot -> aoc -> buddy_exists($uid)) && $uid != 0 && $uid != -1
&& $uid != 4294967295
&& $uid != $this -> get_uid($this -> bot -> botname) && $this -> get_uname($uid) != -1)
Any reason not to do this? looks like whois still works fine for valid users.
-
I was about to say that it would not work.
But you spotted what I had overlooked completely. The userid is in fact the same for all entries causing errors.
The userid (4294967295) is incidentally the highest 32bit integer allowed for an unsigned container.
I'll need to investigate a little further, but offhand that will be a good workaround.
A proper fix would likely be to ensure the bot does not overflow in the first place, but we need to redo the internal handling of userid's for that most likely.
-
I have had the same error for months - I disabled whole whois-module from bot so that people wouldn't (when drunk) wrote !whois <enter invalid mispelled name here> and crash the bot... But deleted alts, people who took server transfer etc always crashes the bot in buddy add, which gives me a lot of extra DB management duty.
I'll try the suggested fix here when next time booting up.
-
Ok, quick fixes here seem to work. The bot just ignores players that do not exist in alts, whois or is. Great! No more crashes from buddy add. :)
-
Been having a world of problems with this error tonight. I've tried the fix written above, but it doesn't seem to fix it :)
It came out of the blue after working perfectly for a long time.
But the bot starts up fine, logs in and everything, but after a short while it crashes after an eof error.
-
Having had the same database for ages I decided to start a fresh one and only import the really large entries and it seems like it's working as intended now.