Cannot insert duplicate key row in object 'dbo.radacct' with unique index 'AcctUniqueId'

Alan DeKok aland at
Fri Jun 27 14:24:08 CEST 2014

info Redlibre wrote:
> Hello, i'am using freeradius 2.1.12+dfsg-1.2 on debian wheezy, AAA is in
> MS-SQL backend using iodbc, the system is a hotspot with mikrotik
> routerboard using radius client, everything is fine the users can
> authenticate from radcheck table but in accounting log i receive this
> message
> Error: sql_query: failed:  [FreeTDS][SQL Server]Cannot insert duplicate
> key row in object 'dbo.radacct' with unique index 'AcctUniqueId'. The
> duplicate key value is (4785db03c....

  That seems clear.

> the problem is the radacct table is not registering info like,
> acctstoptime, acctsessiontime and others, only acctstarttime

  The raddacct table doesn't invent information.  It gets information
from accounting packets.  So... the accounting packets don't have the
information you're looking for.

> i'm using the following schema
> and the query from

  That's really not recommended.  The code in v2 is VERY different from
v3.  You MUST use the v2 schema and queries with v2.

> I am wondering if can i use the mysql query file to achieve this?
> (obviously, making a little changes into querys )

  Using queries intended for other SQL servers is completely wrong.

  Alan DeKok.

More information about the Freeradius-Users mailing list