buffered-sql debugging

Alex Sharaz alex.sharaz at york.ac.uk
Thu Dec 1 14:34:27 CET 2016


o.k. running a server in debug mode gives me

o.k. so  running freeradius in debug mode gives me

(975) sql: EXPAND 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,
radiusserverip,sessionstatus,nasidentifier) VALUES('%{Acct-Session-Id}',
'%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', NULLIF('%{Realm}', ''),
'%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}}'::inet,
NULLIF('%{%{NAS-Port-ID}:-%{NAS-Port}}', ''), '%{NAS-Port-Type}',
TO_TIMESTAMP(%{integer:Event-Timestamp}),
TO_TIMESTAMP(%{integer:Event-Timestamp}), NULL,
%{%{Acct-Session-Time}:-NULL}, '%{Acct-Authentic}', '%{Connect-Info}',
NULL, (('%{%{Acct-Input-Gigawords}:-0}'::bigint << 32) +
'%{%{Acct-Input-Octets}:-0}'::bigint),
(('%{%{Acct-Output-Gigawords}:-0}'::bigint << 32) +
'%{%{Acct-Output-Octets}:-0}'::bigint),
'%{%{Called-Station-Id}:-00-00-00-00-00-01}'::macaddr,
'%{%{request:Calling-Station-Id}:-00-00-00-00-00-00}'::macaddr, NULL,
'%{Service-Type}', '%{Framed-Protocol}', NULLIF('%{Framed-IP-Address}',
'')::inet, '144.32.129.2'::inet, 'Interim', '%{NAS-Identifier}')

(975) sql:    --> 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,
radiusserverip,sessionstatus,nasidentifier)
VALUES('bs15jsjh9CF48E8C6068-583E53B6', 'aa118c3b74de1e95b103d5ebf113ab99',
'bs15jsjh at leeds.ac.uk', NULLIF('DEFAULT', ''), '144.32.64.34'::inet,
NULLIF('0', ''), 'Wireless-802.11', TO_TIMESTAMP(1480480483),
TO_TIMESTAMP(1480480483), NULL, 813, '', '', NULL, (('0'::bigint << 32) +
'24107'::bigint), (('0'::bigint << 32) + '31490'::bigint),
'00-1A-1E-00-70-10'::macaddr, '9C-F4-8E-8C-60-68'::macaddr, NULL, '', '',
NULLIF('10.240.49.179', '')::inet, '144.32.129.2'::inet, 'Interim',
'aruba0')

(975) sql: Executing query: 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,
radiusserverip,sessionstatus,nasidentifier)
VALUES('bs15jsjh9CF48E8C6068-583E53B6', 'aa118c3b74de1e95b103d5ebf113ab99',
'bs15jsjh at leeds.ac.uk', NULLIF('DEFAULT', ''), '144.32.64.34'::inet,
NULLIF('0', ''), 'Wireless-802.11', TO_TIMESTAMP(1480480483),
TO_TIMESTAMP(1480480483), NULL, 813, '', '', NULL, (('0'::bigint << 32) +
'24107'::bigint), (('0'::bigint << 32) + '31490'::bigint),
'00-1A-1E-00-70-10'::macaddr, '9C-F4-8E-8C-60-68'::macaddr, NULL, '', '',
NULLIF('10.240.49.179', '')::inet, '144.32.129.2'::inet, 'Interim',
'aruba0')
rlm_sql_postgresql: Status: PGRES_FATAL_ERROR

(975) sql: rlm_sql_postgresql: ERROR:  duplicate key value violates unique
constraint "radacct_acctuniqueid_key"
(975) sql: rlm_sql_postgresql: DETAIL:  Key
(acctuniqueid)=(aa118c3b74de1e95b103d5ebf113ab99) already exists.
(975) sql: SQL query returned: need alt query
(975) sql: No additional queries configured
rlm_sql (sql): Released connection (4)
(975)     [sql] = noop
(975)   } # accounting = noop
(975) detail (/var/spool/freeradius/detail): No response to request.  Will
retry in 30 seconds
(975) Finished request


So even though buffered-sql has

 preacct {
                preprocess

                #
                #  Ensure that we have a semi-unique identifier for every
                #  request, and many NAS boxes are broken.
                acct_unique

                #
                #  Read the 'acct_users' file.  This isn't always
                #  necessary, and can be deleted if you do not use it.
                #files
        }

I'm still hitting another db key that's the same

A

On 1 December 2016 at 11:53, Alex Sharaz <alex.sharaz at york.ac.uk> wrote:

> Is there any way of selectively enabling debugging of the buffered-sql
> server ? Having got past my previous problems with my config, verified that
> it was all working puppetized the config, pushed it to all my outward
> facing eduroam servers, verified that its working  and left it alone ...
> I've now got 4 servers with ~5G detail files
>
> I use
>
>  if ( "%{client:shortname}"  == "xb1sw7" ) {
>             update control {
>                Tmp-String-2 = "%{debug:1}"
>             }
>         }
>
> in my "default" server for example
> A
>


More information about the Freeradius-Users mailing list