Chat daemon failing after a certain period

Chat daemon failing after a certain period

by William Mudge -
Number of replies: 11
Hey all.

I have configure moodle to use the chat daemon, and it's very quick and responsive when it works. However, if seems to only work for a few hours before it fails.

The process is still running, but the chat window fails to load a user list or send messages. Killing the daemon and restarting makes it work.

Some details:-

SuSE 10
Apache 2
Moodle 1.5.2
Moodle chat daemon v1.0 on PHP 4.4.0 (2005031000)

Message log from the daemon:-
[2005-11-02 12:35:35] *IMPORTANT* User has disconnected, destroying uid 18 with SID EHDL54fFt8EWbb9Wi74J6a2pA1CWUFVK
[2005-11-02 12:35:35] *CRITICAL* [php] Undefined index: EHDL54fFt8EWbb9Wi74J6a2pA1CWUFVK on line 711
[2005-11-02 12:35:35] *CRITICAL* [php] Undefined index: EHDL54fFt8EWbb9Wi74J6a2pA1CWUFVK on line 723
[2005-11-02 12:35:35] *CRITICAL* [php] Undefined index: on line 268
[2005-11-02 12:35:35] *CRITICAL* [php] Invalid argument supplied for foreach() on line 270
[2005-11-02 12:35:35] *CRITICAL* [php] Undefined index: lastinfocommit on line 216
[2005-11-02 12:35:35] *CRITICAL* [php] socket_shutdown() unable to shutdown socket [107]: Transport endpoint is not connected on line 463
[2005-11-02 12:35:36] *CRITICAL* [php] socket_select(): 92 is not a valid Socket resource on line 686

There is also a frequent error in the apache logs, but this appears whenever a user opens the chat window, even when the chat is working.
Errors from Apache:-
[Wed Nov 02 13:07:53 2005] [error] [client 172.16.10.44] script '/srv/www/htdocs/cms-test/mod/chat/gui_sockets/empty.php' not found or unable to stat, referer: http://172.16.10.131/cms-test/mod/chat/gui_sockets/index.php?id=5

Can anyone shed any light?

Thanks in advance.

William.
Average of ratings: -
In reply to William Mudge

Re: Chat daemon failing after a certain period

by Rob Barreca -
For the empty.php error, go into gui_sockets/index.php and make sure line 67 reads something like this:

   <frame src="../empty.php" name="empty" scrolling="auto" noresize marginwidth="2" marginheight="0">

As far as the other stuff, not sure.
In reply to Rob Barreca

Re: Chat daemon failing after a certain period

by William Mudge -
Hmmm... weird...

The line read src="empty.php"... changing it to "../empty.php" has removed the error from the apache logs but I don't know if it will fix the problem with the daemon "failing". Unfortunately it was never an instantly reproducible error.

I'll just have to wait a few days and see how it goes. I'll update this post though.

The path of that file is interesting on it's own... even the latest (1.6) version in cvs also has the path "wrong". Is this something that should be changed? I suppose it doesn't seem to affect functionality, but it's "wrong" isn't it?

Thoughts?
In reply to William Mudge

Re: Chat daemon failing after a certain period

by N Hansen -
William-I'm getting the same problem and since I know even less about these things than you, I've submitted it as bug 4306.
In reply to N Hansen

Re: Chat daemon failing after a certain period

by Matt Gibson -
I have the same issue, but can't seem to vote for the bug - it says 'you have voted already' even though i only just made a new account. Have i missed something?

Matt
In reply to Matt Gibson

Re: Chat daemon failing after a certain period

by Matt Gibson -
I'm just trying to get more info on this, but cannot find the chat log file. How do you go about making the daemon log it's errors? I have tried to create a log file in the mod/chat directory with touch chatd.log but nothing changes when i start it. tried editing chatd.php and altering $_logfile to true, but this didn't help. Any ideas?

Thanks in advance,

Matt
In reply to William Mudge

Re: Chat daemon failing after a certain period

by Roger Emery -
Just to note we have the same problem with chat deamon working great for a few hours, then dying for no reason.
We're using Moodle 1.7.1+ (2006101010) on a SuSE 9 server, running Apache with MySQL 5.0.27, with PHP 5.2.0.

Our server guy said that the chat deamon that came with the 1.71 build was version1.0 and he has upgraded this to v1.3 if that makes any difference?

I'll vote for the bug fix. Such a major feature that needs reliability foremost over fancy features.




In reply to Roger Emery

Re: Chat daemon failing after a certain period

by Roger Emery -
We have a work around for now.
Our server guy has put a cronm job tto restart the chatd script every few hours.
Not ideal, but at least its reliable now.

In reply to Roger Emery

Re: Chat daemon failing after a certain period

by Bryce Holland -
How did he set that up? There is no "restart" argument for the "php chat.php --start &" command. Did he find a way to terminate the old process first?

Thanks!
In reply to Roger Emery

Re: Chat daemon failing after a certain period

by Luciano Rodriguez -
I too had this problem with chatd crashing after a day or so with PHP 5. So I used PHP 4.4.7 and its seems to work okay now. With PHP5 it was taking too much resources, and with PHP 4 it uses half of those resources.

We have Moodle 1.8.2+ Mac OS 10.4 servers. Apache 1.3, PHP 4 & 5.


Just thought I let you know.
In reply to Luciano Rodriguez

Re: Chat daemon failing after a certain period

by Bryce Holland -
I'm running a CentOS 5 Linux server. It wouldn't be wise for me to run a different version of PHP. The about cron job solution will work for me, I would just like to know how it was done.

Thanks!