FreeRADIUS + Postgresql dies unexpectedly

Duarte Fonseca fonseca.duarte at gmail.com
Thu Oct 22 18:11:03 CEST 2009


Hi,

I've got a freeRadius (v2.1.7) install running on CentOs using
postgresql to store accounting data and have noticed that occasionally
freeRadius seems to die unexpectedly.
After some time investigating this and going over the logs I can now
reproduce this behavior easily by following these steps:

1 - In my sql configuration file (/etc/raddb/postgresql.conf) I
specify server = "localhost" (freeRADIUS connects to the database
through TCP/IP)
2 - Restart radiusd
3 - Use radclient to send several accounting requests without an
Acct-session-Time attribute (radclient -p 200 -f 1.txt
10.1.60.141:1813 acct secret)

After a few requests radiusd dies.

If i change my sql configuration file (/etc/raddb/postgresql.conf) so
server = "" (freeRADIUS connects to DB using Unix-domain socket)
radiusd doesn't die.
If i run radiusd in debug mode it doesn't die.
If i send accounting requests with the Acct-Session-Time set to a
positive integer radiusd doesn't die.

The following are extracts from the freeRADIUS log and Postgresql log
during a test where the radiusd dies

extract from radius.log

# cat /var/log/radius/radius.log
Thu Oct 22 16:20:30 2009 : Info: rlm_sql (sql): Driver
rlm_sql_postgresql (module rlm_sql_postgresql) loaded and linked
Thu Oct 22 16:20:30 2009 : Info: rlm_sql (sql): Attempting to connect
to postgres at localhost:/gapdb
Thu Oct 22 16:20:30 2009 : Info: Loaded virtual server <default>
Thu Oct 22 16:20:30 2009 : Info: Ready to process requests.
Thu Oct 22 16:20:51 2009 : Error: [sql] stop packet with zero session
length. [user '0017f24eff31', nas '172.20.200.66']
Thu Oct 22 16:20:51 2009 : Error: [sql] stop packet with zero session
length. [user '0012f0aac218', nas '172.20.200.66']
Thu Oct 22 16:20:55 2009 : Error: [sql] stop packet with zero session
length. [user 'admin', nas '172.20.200.226']
Thu Oct 22 16:20:55 2009 : Error: [sql] stop packet with zero session
length. [user 'JoePublic7', nas '172.20.200.226']
Thu Oct 22 16:20:55 2009 : Error: [sql] stop packet with zero session
length. [user 'admin', nas '172.20.200.226']
Thu Oct 22 16:20:55 2009 : Error: [sql] stop packet with zero session
length. [user 'admin', nas '172.20.200.226']


extract from postgresql log

<2009-10-22 16:20:55.095 BST> LOG:  SSL error: sslv3 alert bad record mac
<2009-10-22 16:20:55.095 BST> LOG:  could not receive data from
client: Connection reset by peer
<2009-10-22 16:20:55.095 BST> LOG:  unexpected EOF on client connection
<2009-10-22 16:20:55.097 BST> LOG:  could not receive data from
client: Connection reset by peer
<2009-10-22 16:20:55.097 BST> LOG:  unexpected EOF on client connection
<2009-10-22 16:20:55.097 BST> LOG:  could not receive data from
client: Connection reset by peer
<2009-10-22 16:20:55.097 BST> LOG:  unexpected EOF on client connection
<2009-10-22 16:20:55.098 BST> LOG:  could not receive data from
client: Connection reset by peer
<2009-10-22 16:20:55.098 BST> LOG:  unexpected EOF on client connection
<2009-10-22 16:20:55.098 BST> LOG:  could not receive data from
client: Connection reset by peer
<2009-10-22 16:20:55.098 BST> LOG:  could not receive data from
client: Connection reset by peer
<2009-10-22 16:20:55.098 BST> LOG:  unexpected EOF on client connection
<2009-10-22 16:20:55.098 BST> LOG:  unexpected EOF on client connection
<2009-10-22 16:20:55.103 BST> LOG:  could not receive data from
client: Connection reset by peer
<2009-10-22 16:20:55.103 BST> LOG:  unexpected EOF on client connection
<2009-10-22 16:20:55.103 BST> LOG:  could not receive data from
client: Connection reset by peer
<2009-10-22 16:20:55.103 BST> LOG:  unexpected EOF on client connection
<2009-10-22 16:20:55.103 BST> LOG:  could not receive data from
client: Connection reset by peer
<2009-10-22 16:20:55.103 BST> LOG:  unexpected EOF on client connection
<2009-10-22 16:20:55.103 BST> LOG:  could not receive data from
client: Connection reset by peer
<2009-10-22 16:20:55.104 BST> LOG:  unexpected EOF on client connection
<2009-10-22 16:20:55.105 BST> LOG:  could not receive data from
client: Connection reset by peer
<2009-10-22 16:20:55.105 BST> LOG:  unexpected EOF on client connection
<2009-10-22 16:20:55.111 BST> LOG:  could not receive data from
client: Connection reset by peer
<2009-10-22 16:20:55.111 BST> LOG:  unexpected EOF on client connection

# radiusd -v
radiusd: FreeRADIUS Version 2.1.7, for host i386-redhat-linux-gnu,
built on Sep 18 2009 at 10:59:17

How would you guys advise me to proceed with resolving this issue, is
it a bug, is it something wrong in my configuration?


Thank you,

Duarte

--
Duarte Fonseca
------------------------------
Mobile: +44 753 4262674
E-mail: fonseca.duarte at gmail.com




More information about the Freeradius-Users mailing list