baiwyc119 / lxmppd

Automatically exported from code.google.com/p/lxmppd
0 stars 0 forks source link

must restart prosody after cold boot. #463

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.cold boot or pc restart.
2.log rotate at night
3.users clients start logging in in the morning.

What is the expected output? What do you see instead?
expected output = nothing in error logs
actual output:
Jan 28 07:36:22 mod_c2s error   Traceback[c2s]: 
/usr/lib/prosody/modules/mod_log_messages_sql.lua:82: connection failed
stack traceback:
.........
Jan 28 07:37:43 mod_c2s error   Traceback[c2s]: 
/usr/lib/prosody/modules/mod_log_messages_sql.lua:81: attempt to index upvalue 
'connection' (a nil value)
stack traceback:
.........
and more, see file uploads.

What version of the product are you using? On what operating system?
Ubuntu server 14 lts
Lua 5.1
Prosody 0.9.7
lua -e 'print(require"luaevent"._VERSION)' = 0.4.4
MySql 5.5.41-0ubuntu0.14.04.1
mod_log_messages_sql.lua (newest as of 2015 01 28)

Please provide any additional information below.
Every morning when i come into work i must restart prosody. (sudo 
/etc/init.d/prosody restart)
After a pc reboot or cold start i must restart prosody. (sudo 
/etc/init.d/prosody restart)
The service is still running and status messages are still passed between 
clients, but no messages are.
After I restart the service it works all day long.

I am using mod_log_messages_sql to archive all messages in MySql.
(prosody.prosodyarchive)
I store roster and vcard info in MySql.
(prosody.prosody)

Original issue reported on code.google.com by justinch...@gmail.com on 28 Jan 2015 at 7:54

Attachments:

GoogleCodeExporter commented 9 years ago
More info:
After log rotate, service is still running. Clients can log in, MySql auth. 
Status announcements are sent to/from the server without error.
When the first message is sent between clients is when the error msg appears in 
the error log.
Service is still running and status announcements are still sent, but no 
messages are sent between clients.
Messages are archived in MySql.

Original comment by justinch...@gmail.com on 29 Jan 2015 at 2:09

GoogleCodeExporter commented 9 years ago
I have the same problem with you,
I am not sure what happend with prosody,
Any suggestion ?

Original comment by dansi...@gmail.com on 5 May 2015 at 8:06

GoogleCodeExporter commented 9 years ago
I ended up with a hack to make it work for me by setting a cron job to restart 
prosody in the morning before work starts. Not a clean fix but its working.
I think it is after the log rotate. it must be losing its connection the the 
mysql server and it is not able to reconnect.

... and on the cold boot or even warm boot
I think it has to do with the start-up sequence.
mysql should be running before prosody is started (?)
I still have to remember to restart prosody manually on reboot...

I use mysql for authentication (prosody.prosody) and to archive all messages. 
(prosody.prosodyarchive).
Perhaps one of those smart prosody programmers could add code to the mysql 
use/connect function.
If the connect fails re-establish the connection. (?)
And then again it could be something totally unrelated to the database.

Except for this I really like the prosody server, it does everything I need it 
to.

Original comment by justinch...@gmail.com on 6 May 2015 at 3:16

GoogleCodeExporter commented 9 years ago
Hi,
I think the problem come from Mysql.
By default, Mysql auto close the inactive connections.
After 8 hours of in-active, Connection will be closed,
I am going to fix the modules and let you know later,

Original comment by dansi...@gmail.com on 25 May 2015 at 9:26