rlm_sql: "NUMERIC VALUE OUT OF RANGE" error

ahthrift andyonfire at gmail.com
Thu Jul 7 05:09:36 CEST 2011


I too am experiencing this issue with FreeRadius 2.1.10 and Postgres.   

/rlm_sql_postgresql: query affected rows = 0
[sql]   expand: %{NAS-Port} -> 2153775120
[sql]   expand: %{Acct-Delay-Time} -> 0
[sql]   expand: %{Acct-Session-Time} -> 301
[sql]   expand: %{Acct-Input-Gigawords} -> 0
[sql]   expand: %{Acct-Input-Octets} -> 14189
[sql]   expand: %{Acct-Output-Gigawords} -> 0
[sql]   expand: %{Acct-Output-Octets} -> 31036
[sql]   expand: INSERT INTO radacct   (AcctSessionId, AcctUniqueId,
UserName, Realm, NASIPAddress,   NASPortId, NASPortType, AcctStartTime,  
AcctSessionTime, AcctAuthentic, AcctInputOctets,   AcctOutputOctets,
CalledStationId, CallingStationId,   ServiceType, FramedProtocol,
FramedIPAddress, XAscendSessionSvrKey)   VALUES('%{Acct-Session-Id}',
'%{Acct-Unique-Session-Id}',   '%{SQL-User-Name}', NULLIF('%{Realm}', ''),
'%{NAS-IP-Address}',   %{%{NAS-Port}:-NULL}::integer, '%{NAS-Port-Type}',  
('%S'::timestamp - '%{%{Acct-Delay-Time}:-0}'::interval -
'%{%{Acct-Session-Time}:-0}'::interval),   '%{Acct-Session-Time}',
'%{Acct-Authentic}',   (('%{%{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}',  
'%{Calling-Station-Id}', '%{Service-Type}', '%{Framed-Protocol}',  
NULLIF('%{Framed-IP-Address}', '')::inet, '%{X-Ascend-Session-Svr-Key}') ->
INSERT INTO radacct
rlm_sql_postgresql: Status: PGRES_FATAL_ERROR
rlm_sql_postgresql: Error integer out of range
rlm_sql_postgresql: Postgresql Fatal Error: [22003: NUMERIC VALUE OUT OF
RANGE] Occurred!!
[sql] Couldn't insert SQL accounting ALIVE record - ERROR:  integer out of
range
rlm_sql (sql): Released sql socket id: 2
/

I cannot figure out how to modify the query that is executed for this, I
modified /etc/freeradius/sql.conf with addtional section:

 /       accounting_update_query_alt = "INSERT into ${acct_table1} \
                (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress,
NASPortId, NASPortType, AcctStartTime, \
                AcctSessionTime, AcctAuthentic, AcctInputOctets,
AcctOutputOctets, CalledStationId, CallingStationId, \
                ServiceType, FramedProtocol, FramedIPAddress,
XAscendSessionSvrKey) \
                values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}',
'%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', \
                ('%{NAS-Port}'::bigint, '%{NAS-Port-Type}'),
('%S'::timestamp -  '%{Acct-Delay-Time:-0}'::interval -
'%{Acct-Session-Time:-0}'::interval), \
                '%{Acct-Session-Time}', '%{Acct-Authentic}', \
                (('%{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}', \
                '%{Calling-Station-Id}', '%{Service-Type}',
'%{Framed-Protocol}', \
                NULLIF('%{Framed-IP-Address}', '')::inet,
'%{X-Ascend-Session-Svr-Key}')"
/
as well as start/stop sections but it had no effect on the query run by
FreeRadius.   How am I able to fix this issue ?


Thanks,




Andrew

--
View this message in context: http://freeradius.1045715.n5.nabble.com/rlm-sql-NUMERIC-VALUE-OUT-OF-RANGE-error-tp2776043p4559678.html
Sent from the FreeRadius - User mailing list archive at Nabble.com.



More information about the Freeradius-Users mailing list