bkumkar / jaxl

Automatically exported from code.google.com/p/jaxl
GNU General Public License v3.0
0 stars 0 forks source link

Random disconnect of bot after less than 5 min of in-activity. #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Running JAXL on Windows 2003 Server
2. leaving app running for 3+ minutes 'inactive'

What is the expected output? 
The app should keep running/being connected until killed.  

What do you see instead?
PHP script does not exit. I see the bot 'user' log off.  No log update due
to disconnect. Script is still running in command window.

What version of the product are you using? On what operating system?
1.0.3 vanilla

Please provide any additional information below.
Basically it seems that the bot just disconnects after some time, maybe it
is a connection issue? How could I modify the code to check for connection
loss? As the script does not exit, and the 'while($jaxl->isConnected)' loop
does not catch anything.

Original issue reported on code.google.com by jakub.bi...@gmail.com on 18 Jan 2009 at 6:42

GoogleCodeExporter commented 9 years ago
Hi Jakub,

Can you kindly post the logger.log file output so that I can digg deep into the 
issue. I don't see any issue when I run Jaxl on Windows XP.

Log file might help me track the issue. Can you kindly post the same?

Regards,
Abhinav

Original comment by mailsfor...@gmail.com on 29 Jan 2009 at 1:02

GoogleCodeExporter commented 9 years ago
Abhinav, it honestly does not log anything related to the disconnect. All the 
log
shows is consistant info about the communication it last had, then it just 
'drops the
connection' but the application still sits in a state of 'connection'.  Log is 
not
updated when it disconnects.

I have tried a few things and from what I gather, it must either be a script 
time out
[PHP] or a Windows process that kills the idle connection.  My tests show that 
if I
am communicating with the client, it is connected and logging all data.  Once I 
stop,
roughly 3-5 later of idle time I see the bot disconnect, but when I look @ the 
server
desktop, the prompt window is still in a state of 'running' and the log entry 
has not
been updated since the last transaction that took place [me messaging it].

Thoughts?  Maybe this has something to do with needing a keep alive built into 
the
bot? a sort of 'ping' to the server? I can see that working, as it will 
eliminate an
idle timeout [which is my best guess].

Now this *may* only be a Windows 2003 server issue, as you run it on linux, 
right?

Original comment by jakub.bi...@gmail.com on 6 Feb 2009 at 7:09

GoogleCodeExporter commented 9 years ago
Hi Jakub,

I do trust you and the bot might go offline after few minutes of inactivity, 
but 
still for any level of debugging I would need the logs. What ever it may be I 
will be 
grateful if you can attach the same for me.

Further it can surely be something related to your php.ini settings. Check for 
maximum timeout for command line (CLI) php scripts. Also I have my development 
box on 
windows xp, so for me the bot works fine on windows machine.

How do you use JAXL library, can you pen down the steps you are using. I guess 
you 
might be doing something like this:
1. Open config.ini.php and choose your environment
2. Enter Username and Password for your test bot
3. Open a command line windown (start->cmd)
4. Run this command on cmd: php /path/to/your/index.php

After you run the last command, it will output a few logs on the command line 
window 
itself. Can you also paste them for me. Also it will log everything under the 
log 
directory. Can you also attach the same next time. Probably log file and 
php.ini 
settings might help in nailing down the bug. 

Regards,
Abhinav

Original comment by mailsfor...@gmail.com on 7 Feb 2009 at 7:34

GoogleCodeExporter commented 9 years ago
It happens with some kind of jabber servers.
Here're screens and logs.
P.S. I modified the source for myself to track an error easier.

Original comment by lightok...@gmail.com on 25 Feb 2009 at 12:13

Attachments:

GoogleCodeExporter commented 9 years ago
Temp solution attached. Disconnects was caused because server didn't get 
response 
from client.

Also add the 
$this->ping = 0;
var in xmpp.class.php after $this->xmlBuffer = '';

P.S. This is temp solution, NOT the solution of the problem.
Sorry for my english.

Original comment by lightok...@gmail.com on 25 Feb 2009 at 1:36

Attachments:

GoogleCodeExporter commented 9 years ago
Hi lightokun0,

Thanks for posting the log files and images. Quite strange and weird. BTW can 
you 
kindly tell me which jabber server are you testing against.

I have tested JAXL against ejabberd-2.x and gtalk servers and I never 
encountered any 
problems. If only you can tell me the jabber server you are testing against, I 
will 
be able to come up with a concrete solution.

Thanks and Regards,
Abhinav

Original comment by mailsfor...@gmail.com on 25 Feb 2009 at 3:18

GoogleCodeExporter commented 9 years ago
jabber.rsspnet.ru. It's using openfire server.
Info-link: http://en.wikipedia.org/wiki/Openfire.

Original comment by lightok...@gmail.com on 25 Feb 2009 at 4:27

GoogleCodeExporter commented 9 years ago
Hi lightokun0,

I havn't tested JAXL against openfire yet. Will try to do the same over the 
weekend 
if possible and post my findings here.

Thanks,
Abhinav

Original comment by mailsfor...@gmail.com on 25 Feb 2009 at 4:31

GoogleCodeExporter commented 9 years ago
The issue is that jaxl don't send any packets to server and server drop session 
due 
to timeout.
Solution can be found here: http://xmpp.org/extensions/xep-0199.html, section 
Client-
To-Server Pings. My solution is to rough(posted before) to be applied and in 
the 
future, maybe i'll modify the code.

Original comment by lightok...@gmail.com on 25 Feb 2009 at 7:34

GoogleCodeExporter commented 9 years ago
Hi lightokun0,

Thanks for the link. I am sure this has to do with openfire jabber server since 
the 
bots at gtalkbots.com run 24x7 and I have never encountered any error like this 
before.

Anyways thanks for your support :D 
I shall dig in and release an improved version, which is supposed to support 
BOSH 
protocol too.

Cheers,
Abhinav

Original comment by mailsfor...@gmail.com on 26 Feb 2009 at 3:49

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I have an issue which looks similar. My account uses an ejabberd 2.0.3 server 
and my
bot drops the connection after a while. I'll test the solution from above.

Original comment by localt...@googlemail.com on 4 Mar 2009 at 8:12

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Ok it is another problem. My server has connection breaks. But the script does 
not
recognize them.

Original comment by localt...@googlemail.com on 4 Mar 2009 at 9:12

GoogleCodeExporter commented 9 years ago
Hi localtux1,

Thanks for letting me know about this bug. Probably while developing I never 
left my 
bot idle for even 5 minutes and I never encountered this error. Also the bots 
running 
at gtalkbots are probably never idle for more than 5 minutes and hence I again 
never 
encountered such errors.

But I am sure you won't be able to replicate this with gtalk servers. It might 
only 
be happening with ejabberd servers. Can you confirm the same?

I am currently busy with some other projects and probably over this weekend or 
next 
weekend, I will release a patch for the same. Meanwhile you can use the 
solution 
provided by lightokun0 i.e. pinging the server.

Regards,
Abhinav

Original comment by mailsfor...@gmail.com on 4 Mar 2009 at 9:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
My jabber account (ejabberd) does not support the ping command. But I wrote a
workaround / module to recognize connection breaks. If a break occurs I am 
going to
reset the bot connection / tls-session, because the bot server has a dynamic 
ip. This
solutions works for me.

Original comment by localt...@googlemail.com on 5 Mar 2009 at 12:42

GoogleCodeExporter commented 9 years ago
Hi localtux1,

Wow! Great! Can you kindly attach your enhancement/break fix so that others can 
use 
the same for themselves. Also I would like to review it and if found the most 
fitting 
solution, would like to include the same in the next release of Jaxl.

Regards,
Abhinav

Original comment by mailsfor...@gmail.com on 5 Mar 2009 at 4:08

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Ok, here it is.

Original comment by localt...@googlemail.com on 6 Mar 2009 at 12:12

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Localtux1,

A new version of Jaxl is coming out with several issues and checks done to make 
sure
the bots run without any problem.

A modified part of your solution will be included in the core of jaxl library, 
with
proper credits to your contribution.

Thanks.

Original comment by mailsfor...@gmail.com on 1 Jan 2010 at 3:15

GoogleCodeExporter commented 9 years ago
Committed the changes into trunk. Specifically, added XEP-0199 "XMPP Ping".
Configure JAXL_PING_INTERVAL inside config.ini.php as per your need.

Original comment by mailsfor...@gmail.com on 2 Jan 2010 at 2:44