Radacct Reused ?

Oscar oscar at jofre.com
Fri Apr 19 01:24:31 CEST 2019


Hi, 

Sorry for this:
  https://wiki.freeradius.org/guide/Users-Mailing-List#full-server-debug-output_things-to-avoid

I'm not going to do it again.

>>If you want to know why your trigger is broken, go read the default queries and see what they do.
>>  i.e. you wrote code to break the server.  Don't do that.

I don't understand what you mean. My freeradius is on default configuration (as far as I know) version 3.0.13

My trigger only add a row on a new table. Don't modify anything from the setup or freeradius database.

What I'm facing is that I have a row from an old time:

radacct=24850583	
acctsessionid=80a00001	
acctuniqueid=6cf28675aa2c38a046d7f46f65e36e72
acctstoptime= 2018-02-24 22:02:26

And yestarday I got from freeradius an insert with same acctsessionid, acctstoptime:

20190417 19:42:18,ip-10-10-2-197,radius,172.31.27.182,46429987,224924771,QUERY,radius,'INSERT INTO radacct (acctsessionid, acctuniqueid, username, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctupdatetime, acctstoptime, acctsessiontime, acctauthentic, connectinfo_start, connectinfo_stop, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, acctterminatecause, servicetype, framedprotocol, framedipaddress) VALUES (\'80a00001\', \'6cf28675aa2c38a046d7f46f65e36e72\', \'SwB_120669_ins_425_E8:11:32:E3:77:AF\', \'\', \'172.16.4.74\', \'bridge-hs\', \'Wireless-802.11\', FROM_UNIXTIME(1555530138), FROM_UNIXTIME(1555530138), NULL, \'0\', \'\', \'\', \'\', \'0\', \'0\', \'4AC704E1E050\', \'E8:11:32:E3:77:AF\', \'\', \'\', \'\', \'10.1.200.203\')',1062

This insert fails due to duplicate key.

Error Code: 1062. Duplicate entry '6cf28675aa2c38a046d7f46f65e36e72' for key 'acctuniqueid'

And then the updates comes:

20190417 19:42:18,ip-10-10-2-197,radius,172.31.27.182,46429987,224924772,QUERY,radius,'UPDATE radacct SET acctstarttime = FROM_UNIXTIME(1555530138), acctupdatetime = FROM_UNIXTIME(1555530138), connectinfo_start = \'\' WHERE AcctUniqueId = \'6cf28675aa2c38a046d7f46f65e36e72\'',0


Can you help me to know how is calculated the 'acctuniqueid' to see why appears duplicated ?

Maybe it is important to share that the freeradius has been working on a server machine the last 2 years and we migrate to a new machine, we move from the old machine to the new all database and we update version from freeradius 3.0.10 on the old machine to 3.0.13 on the new machine.

Thanks,




-----Mensaje original-----
De: Freeradius-Users <freeradius-users-bounces+oscar=jofre.com at lists.freeradius.org> En nombre de Alan DeKok
Enviado el: jueves, 18 de abril de 2019 13:45
Para: FreeRadius users mailing list <freeradius-users at lists.freeradius.org>
Asunto: Re: Radacct Reused ?

  https://wiki.freeradius.org/guide/Users-Mailing-List#full-server-debug-output_things-to-avoid

  Don't post images.  Don't post the same message.  We got it the first time.

  The default configuration works.

  If you want to know why your trigger is broken, go read the default queries and see what they do.

  i.e. you wrote code to break the server.  Don't do that.

> On Apr 18, 2019, at 2:51 AM, Oscar <oscar at jofre.com> wrote:
> 
> 
> 
> -----Mensaje original-----
> De: Freeradius-Users
> <freeradius-users-bounces+oscar=jofre.com at lists.freeradius.org> En 
> nombre de Oscar Enviado el: martes, 16 de abril de 2019 23:52
> Para: 'FreeRadius users mailing list'
> <freeradius-users at lists.freeradius.org>
> Asunto: Radacct Reused ?
> 
> Hi,
> 
> 
> 
> I've created a Trigger to save on a new table the las time a user has 
> been stop connection (acctstoptime).
> 
> 
> 
> So I've createad table and created this trigger:
> 
> 
> 
>                create TRIGGER UpdateStopTime AFTER UPDATE ON radacct
> 
>                FOR EACH ROW
> 
>                BEGIN
> 
>                               INSERT into usuario_instalacion_stoptime 
> (
> 
>                                                               select 
> u.department as user,u.company as insta,if(r.acctstoptime is
> null,now(),r.acctstoptime) stoptime
> 
>                                                                from 
> radacct r,userinfo u where r.username=u.username  and 
> r.radacctid=NEW.radacctid
> 
>                               ) ON DUPLICATE KEY UPDATE 
> stoptime=if(NEW.acctstoptime is null,now(),NEW.acctstoptime) ;
> 
> 
> 
>                END$$
> 
> 
> 
> 
> 
> But now I'm facing that sems that radius rows from the past are beeign 
> used on the present
> 
> 
> 
> I mean, my radacctid is now arround 37.000.000
> 
> 
> 
> And I can see a user autheticated and updating a really old row:
> accstoptime=09-2018 and beeing update today with accstarttime=04-2019
> 
> 
> 
> 
> 
> 
> 
> 
> 
> How is that possible ?
> 
> 
> 
> Is it correct ?
> 
> 
> 
> 
> 
> Thanks,
> 
> 
> -
> List info/subscribe/unsubscribe? See 
> http://www.freeradius.org/list/users.html


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html




More information about the Freeradius-Users mailing list