1.1.7 and rlm_sql_mysql duplicated query
Hello, I'm seeing duplicated queries made to the database when any (linux/pppoe) user logs in through freeradius 1.1.7. Log from mysql logger: 646 Query INSERT INTO radacct (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctStopTime, AcctSessionTime, AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay, XAscendSessionSvrKey) VALUES ('47B769162F4300', '66cf2392669a4dc6', 'time160', '', 'xx.xx.xxx.22', '0', 'Async', '2008-02-17 00:52:10', '0', '0', 'RADIUS', '', '', '0', '0', '', '00:13:20:xx.xx.xx', '', 'Framed-User', 'PPP', 'xx.xx.xxx.110', '0', '0', '') 645 Query INSERT INTO radacct (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctStopTime, AcctSessionTime, AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay, XAscendSessionSvrKey) VALUES ('47B7691A2F4301', '82cd8d24e280bd07', 'time160', '', 'xx.xx.xx.22', '0', 'Async', '2008-02-17 00:52:10', '0', '0', 'RADIUS', '', '', '0', '0', '', '00:13:20:xx.xx.xx', '', 'Framed-User', 'PPP', 'xx.xx.xx.110', '0', '0', '') After user logs off the following query is passed to mysql: 080217 0:54:21 663 Query UPDATE radacct SET AcctStopTime = '2008-02-17 00:54:21', AcctSessionTime = '135', AcctInputOctets = '0' << 32 | '2556', AcctOutputOctets = '0' << 32 | '1486', AcctTerminateCause = 'User-Request', AcctStopDelay = '0', ConnectInfo_stop = '' WHERE AcctSessionId = '47B7691A2F4301' AND UserName = 'time160' AND NASIPAddress = 'xx.xx.xx.22' So when the user logs I have two queries inserting similar data with different sessions ids: 47B7691A2F4300 and 47B7691A2F4301 And when the user logs off I have only one query that notes the action in the database for session 47B7691A2F4301. So generally I get one "hanging" session in radacct table for a particular user where AcctStopTime is null. sql.conf is a default one with only db connect info changed. Tried to remove some of the insert statements but the only result I'm getting is no insert statement in radacct table at all or the double insert statement pointed above. I would really appreciate some guidance from this point on as I'm pretty much out of ideas. Thanks upfront
So when the user logs I have two queries inserting similar data with different sessions ids:
47B7691A2F4300 and 47B7691A2F4301
I would really appreciate some guidance from this point on as I'm pretty much out of ideas.
Your NAS is broken / misbehaving. It sends the Acct-Session-Id and it's sending two. Consult your NAS documentation for possible reasons (e.g. some Cisco NAS send accounting sessions for the PPP LCP and IPCP layers - this can be disabled) or open a bug with the vendor.
The answer is not totally correct. Because a microcuts in the connectibity of hotspot cause that hotspot re-sends the acct request. In that case, you have to desactivate: - accounting_start_query_alt - accounting_stop_query_alt Maybe It can cause that some requests do not register, and it is a risk that you must accept.> Date: Mon, 18 Feb 2008 01:36:54 +0000> From: p.mayers@imperial.ac.uk> To: freeradius-users@lists.freeradius.org> Subject: Re: 1.1.7 and rlm_sql_mysql duplicated query> > > So when the user logs I have two queries inserting similar data with different sessions ids:> > > > 47B7691A2F4300 and 47B7691A2F4301> > > > > > I would really appreciate some guidance from this point on as I'm pretty much out of ideas.> > Your NAS is broken / misbehaving. It sends the Acct-Session-Id and it's > sending two. Consult your NAS documentation for possible reasons (e.g. > some Cisco NAS send accounting sessions for the PPP LCP and IPCP layers > - this can be disabled) or open a bug with the vendor.> > -> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html _________________________________________________________________ La vida de los famosos al desnudo en MSN Entretenimiento http://entretenimiento.es.msn.com/
Santiago Balaguer García wrote:
The answer is not totally correct. Because a microcuts in the connectibity of hotspot cause that hotspot re-sends the acct request.
No, because then the Acct-Session-Id would remain the same.
In that case, you have to desactivate: - accounting_start_query_alt - accounting_stop_query_alt
No. Re-read the original post. The Acct-Session-Id is different, hence 2 sessions are being inserted into SQL, but no Accounting-Stop ever gets send for the 1st. The NAS is misbehaving.
Maybe It can cause that some requests do not register, and it is a risk that you must accept.
Date: Mon, 18 Feb 2008 01:36:54 +0000 From: p.mayers@imperial.ac.uk To: freeradius-users@lists.freeradius.org Subject: Re: 1.1.7 and rlm_sql_mysql duplicated query
So when the user logs I have two queries inserting similar data with different sessions ids:
47B7691A2F4300 and 47B7691A2F4301
I would really appreciate some guidance from this point on as I'm pretty much out of ideas.
Your NAS is broken / misbehaving. It sends the Acct-Session-Id and it's sending two. Consult your NAS documentation for possible reasons (e.g. some Cisco NAS send accounting sessions for the PPP LCP and IPCP layers - this can be disabled) or open a bug with the vendor.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
------------------------------------------------------------------------ Sigue los principales acontecimientos deportivos en directo. MSN Motor <http://video.msn.com/video.aspx?mkt=es-es>
------------------------------------------------------------------------
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Georgi Alexandrov -
Phil Mayers -
Santiago Balaguer García