Re: sql returns fail for some stop requests

2012-08-08 Thread Amir Tal
After moving MYSQL to a clustered environment, and moving all backup and not 
related tasks to slave hosts,
It seems the issue is resolved, radius has been running for several days 
without any errors and/or sessions not being stopped.

Thanks for all your help and suggestions,

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

RE: sql returns fail for some stop requests

2012-07-24 Thread Amir Tal
After additional debugging the fault seems to be with a rouge backup process 
running on DB host, causing it to be slow to un-responsive for 10-20 minutes.
(all unclosed sessions are within this time frame)

This is easy to fix, but I'm looking for a way to make a fail-safe solution.
There can always be occasions where DB connection is momentarily slow due to 
some other issue like network or storage,
Since SQL is used here only for accounting data, is there a way to set the 
radius to accept all users (or reject all) in case DB is not-available, 
possibly keeping a buffer of accounting data to be written when DB access is 
restored?

I am currently considering two possible solitions:
Create a fail over for sql to allow login if sql is n/a, Similar to:
redundant {
 sql
 ok
   }

and/or use buffered-sql to catch these queries and update them in sql at later 
time.
Is it possible to use buffered-sql and still perform simultaneous use checks 
based on same DB?

Thanks for all replies,

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

RE: sql returns fail for some stop requests

2012-07-22 Thread Amir Tal
Adding unique key to the database results in the following being returned from 
rlm_sql,
What happen to accounting data when a duplicate entry is encountered?
In addition, currently there is no scheduled clearing of the data in radacct 
table, wont this increase in occurrence?

--
[sql]   expand: %{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}} - shimoni
[sql] sql_set_user escaped user -- 'shimoni'
[sql]   expand: %{Acct-Input-Gigawords} - 0
[sql]   expand: %{Acct-Input-Octets} - 0
[sql]   expand: %{Acct-Output-Gigawords} - 0
[sql]   expand: %{Acct-Output-Octets} - 0
[sql]   expand: %{Acct-Delay-Time} - 12
[sql]   expand:  UPDATE radacct SET  acctstoptime   = '%S',  
acctsessiontime= '%{Acct-Session-Time}',  acctinputoctets= 
'%{%{Acct-Input-Gigawords}:-0}'  32 | '%{%{Acct-Input-Octets}:-0}',  
acctoutputoctets   = '%{%{Acct-Output-Gigawords}:-0}'  32 | 
'%{%{Acct-Output-Octets}:-0}',  acctterminatecause = '%{Acct-Terminate-Cause}', 
 acctstopdelay  = '%{%{Acct-Delay-Time}:-0}',  connectinfo_stop   = 
'%{Connect-Info}' WHERE acctsessionid   = '%{Acct-Session-Id}' AND username 
 = '%{SQL-User-Name}' AND nasipaddress  = '%{NAS-IP-Address}' -  
UPDATE radacct SET  acctstoptime   = '2012-07-22 02:03:28',  
acctsessiontime= '0',  acctinputoctets= '0'  32 | '0',  
acctoutputoctets   = '0'  32 | '0',  acctterminatecause = 'User-Error',  
acctstopdelay  = '12',  connectinfo_stop   = '' WHERE acctsessionid   = 
'erx ip:109.226.0.9:172.29.81.67:3280:96f8:1aa8:87fb:4d2:0062712021' AND 
username  = 'shimoni' AND nasipaddress  = '109.226.1.12'
[sql]   expand: /var/log/radius/sqltrace.sql - /var/log/radius/sqltrace.sql
rlm_sql_mysql: MYSQL check_error: 1062 received
[sql] Couldn't insert SQL accounting STOP record - Duplicate entry 
'c6d3d253355b3dcf' for key 2
rlm_sql_mysql: MYSQL check_error: 1062 received
rlm_sql_mysql: Cannot store result
rlm_sql_mysql: MySQL error 'Duplicate entry 'c6d3d253355b3dcf' for key 2'
rlm_sql (sql): Released sql socket id: 11
++[sql] returns fail
--
[detail.moreshet] /var/log/radius/radacct/moreshet.relay expands to 
/var/log/radius/radacct/moreshet.relay
[sql]   expand: %{Acct-Delay-Time} - 0
[detail.moreshet]   expand: %t - Sun Jul 22 02:03:34 2012
[sql]   expand:  UPDATE radacct SET  acctstoptime   = '%S',  
acctsessiontime= '%{Acct-Session-Time}',  acctinputoctets= 
'%{%{Acct-Input-Gigawords}:-0}'  32 | '%{%{Acct-Input-Octets}:-0}',  
acctoutputoctets   = '%{%{Acct-Output-Gigawords}:-0}'  32 | 
'%{%{Acct-Output-Octets}:-0}',  acctterminatecause = '%{Acct-Terminate-Cause}', 
 acctstopdelay  = '%{%{Acct-Delay-Time}:-0}',  connectinfo_stop   = 
'%{Connect-Info}' WHERE acctsessionid   = '%{Acct-Session-Id}' AND username 
 = '%{SQL-User-Name}' AND nasipaddress  = '%{NAS-IP-Address}' -  
UPDATE radacct SET  acctstoptime   = '2012-07-22 02:03:34',  
acctsessiontime= '0',  acctinputoctets= '0'  32 | '0',  
acctoutputoctets   = '0'  32 | '0',  acctterminatecause = 'User-Error',  
acctstopdelay  = '0',  connectinfo_stop   = '' WHERE acctsessionid   = 'erx 
ip:109.226.0.9:172.24.245.233:2653:c9e:101:e0ba:4d2:0062712040' AND username
  = 'mosh19703' AND nasipaddress  = '109.226.1.12'
[sql]   expand: /var/log/radius/sqltrace.sql - /var/log/radius/sqltrace.sql
[detail.moreshet]   expand: /var/log/radius/radacct/moreshet.relay - 
/var/log/radius/radacct/moreshet.relay
[detail.moreshet] /var/log/radius/radacct/moreshet.relay expands to 
/var/log/radius/radacct/moreshet.relay
[detail.moreshet]   expand: %t - Sun Jul 22 02:03:34 2012
++[detail.moreshet] returns ok
rlm_sql_mysql: MYSQL check_error: 1062 received
[sql] Couldn't insert SQL accounting ALIVE record - Duplicate entry 
'923952cbd6569744' for key 2
rlm_sql_mysql: MYSQL check_error: 1062 received
rlm_sql_mysql: Cannot store result
rlm_sql_mysql: MySQL error 'Duplicate entry '923952cbd6569744' for key 2'
rlm_sql (sql): Released sql socket id: 27
++[sql] returns fail
--


Just wanted to state that I had started with the default provided configuration 
files,
Alredy changed the rlm_sql source code, default SQL queries, default DB 
structure.

There are still unclosed accounting packets existing.
Log shows a lot of warning messages:

rlm_sql (sql): Reserving sql socket id: 31
rlm_sql_mysql: query:   UPDATE radacct SET  acctstoptime   = '2012-07-22 
02:04:57',  acctsessiontime= '0',  acctinputoctets= '0'  32 | '0',  
acctoutputoctets   = '0'  32 | '0',  acctterminatecause = 'User-Request',  
acctstopdelay  = '0',  connectinfo_stop   = '' WHERE acctsessionid   = 'erx 
ip:109.226.0.17:172.23.184.73:dd94:1847:fcca:a66:4d2:0051412783' AND username   
   = 'yali4780' AND nasipaddress  = '109.226.1.20'
[sql]   expand: %{Acct-Input-Gigawords} - 0
[sql]   expand: %{Acct-Input-Octets} - 0
[sql]   expand: %{Acct-Output-Gigawords} - 0
[sql]   expand: %{Acct-Output-Octets} - 0
[sql]   expand: %{Acct-Delay-Time} - 

RE: sql returns fail for some stop requests

2012-07-19 Thread Amir Tal
I have increased the value of MAX_QUERY_LEN in 
freeradius-server-2.1.12/src/modules/rlm_sql/conf.h
(#define MAX_QUERY_LEN   8192)

There are still duplicated connections/sessions , example sqltrace:
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  ('erx 
ip:109.226.0.17:147.235.134.47:ef47:632c:606b:498b:4fdbe98:0050515007', 
'e2faac6ede73a716',  '37444332',  'ccc', '109.226.1.20', '23437230',  
'Virtual', '2012-07-19 01:54:07', NULL,  '0', 'RADIUS', '',  '', '0', '0',  '', 
'47 5/1 vlan-id 1421:32', '',  'Framed-User', 'PPP', '109.226.50.244',  '0', 
'0', '');
 UPDATE radacct SET  acctstoptime   = '2012-07-19 01:54:55',  
acctsessiontime= '48',  acctinputoctets= '0'  32 | '60',  
acctoutputoctets   = '0'  32 | '60',  acctterminatecause = 'NAS-Request',  
acctstopdelay  = '0',  connectinfo_stop   = '' WHERE acctsessionid   = 'erx 
ip:109.226.0.17:147.235.134.47:ef47:632c:606b:498b:4fdbe98:0050515007' AND 
username  = '37444332' AND nasipaddress  = '109.226.1.20';
 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  ('erx 
ip:109.226.0.17:147.235.134.47:ef47:632c:35a4:4aaa:4fdc13c:0050515459', 
'ec2da39d0766abef',  '37444332',  'ccc', '109.226.1.20', '23438030',  
'Virtual', '2012-07-19 01:56:02', NULL,  '0', 'RADIUS', '',  '', '0', '0',  '', 
'47 5/1 vlan-id 1421:32', '',  'Framed-User', 'PPP', '109.226.50.185',  '0', 
'0', '');
 UPDATE radacct SET  acctstoptime   = '2012-07-19 01:56:52',  
acctsessiontime= '50',  acctinputoctets= '0'  32 | '60',  
acctoutputoctets   = '0'  32 | '510',  acctterminatecause = 'NAS-Request',  
acctstopdelay  = '0',  connectinfo_stop   = '' WHERE acctsessionid   = 'erx 
ip:109.226.0.17:147.235.134.47:ef47:632c:35a4:4aaa:4fdc13c:0050515459' AND 
username  = '37444332' AND nasipaddress  = '109.226.1.20';
 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  ('erx 
ip:109.226.0.17:147.235.134.47:ef47:632c:cfbc:4aff:4fdc2b2:0050515722', 
'bfede13c66b4f238',  '37444332',  'ccc', '109.226.1.20', '23438472',  
'Virtual', '2012-07-19 01:57:05', NULL,  '0', 'RADIUS', '',  '', '0', '0',  '', 
'47 5/1 vlan-id 1421:32', '',  'Framed-User', 'PPP', '37.19.123.248',  '0', 
'0', '');
 UPDATE radacct SET  acctstoptime   = '2012-07-19 01:57:54',  
acctsessiontime= '49',  acctinputoctets= '0'  32 | '60',  
acctoutputoctets   = '0'  32 | '8366',  acctterminatecause = 'NAS-Request',  
acctstopdelay  = '0',  connectinfo_stop   = '' WHERE acctsessionid   = 'erx 
ip:109.226.0.17:147.235.134.47:ef47:632c:cfbc:4aff:4fdc2b2:0050515722' AND 
username  = '37444332' AND nasipaddress  = '109.226.1.20';
 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  ('erx 
ip:109.226.0.17:147.235.134.47:ef47:632c:3374:4b57:4fdc420:0050515966', 
'457b5c3e9fc92416',  '37444332',  'ccc', '109.226.1.20', '23438894',  
'Virtual', '2012-07-19 01:58:07', NULL,  '0', 'RADIUS', '',  '', '0', '0',  '', 
'47 5/1 vlan-id 1421:32', '',  'Framed-User', 'PPP', '109.226.50.123',  '0', 
'0', '');
 UPDATE radacct SET  acctstoptime   = '2012-07-19 01:58:55',  
acctsessiontime= '48',  acctinputoctets= '0'  32 | '60',  
acctoutputoctets   = '0'  32 | '60',  acctterminatecause = 'NAS-Request',  
acctstopdelay  = '0',  connectinfo_stop   = '' WHERE acctsessionid   = 'erx 

RE: sql returns fail for some stop requests

2012-07-15 Thread Amir Tal
(sorry if this is duplicate)

i have modified the sql queries and removed unnecessary whitespace,
but am still getting some queries cut-off in the log.
the main issue is with accounting stop requests.
(i am using the default queries provided with freeradius 2.1.12 - dialup.conf)

is there a way to increase the space/memory available for sql queries?
the main issue is with accounting stop requests.

in addition i have found the following in the logs:
rlm_sql (sql): There are no DB handles to use! skipped 0, tried to connect 0
++[sql] returns fail

number of DB connections has already been raised from the default 5 to 25,
this is a rare error, but it still exists, might be related.

Amir.


From: Amir Tal
Sent: Wednesday, July 11, 2012 4:48 PM
To: 'freeradius-users@lists.freeradius.org'
Subject: sql returns fail for some stop requests

Freeradius ver 2.1.12, configured to use ldap for auth, sql for acct.

Sometimes users' sessions get stuck and have to be closed manualy (simultaneous 
use is turned on for all users).
After extensive debugging I have found the following in the logs (radius -X)


[thread] # Executing section preacct from file 
/etc/raddb/sites-enabled/default
[thread] +- entering group preacct {...}
++[preprocess] returns ok
[acct_unique] Hashing 'NAS-Port = 14117776,Client-IP-Address = 
xx.xx.xx.xx,NAS-IP-Address = xx.xx.xx.xx,Acct-Session-Id = erx 
ip:109.226.0.9:147.235.234.115:1e47:6248:14c2:8b6a:5dac845:0060992452,Use
r-Name = x@ccc'
[acct_unique] Acct-Unique-Session-ID = d49ba42fa077f5f0.
++[acct_unique] returns ok
[suffix] Looking up realm ccc for User-Name = x@ccc
[suffix] Found realm ccc
[suffix] Adding Stripped-User-Name = x
[suffix] Adding Realm = ccc
[suffix] Accounting realm is LOCAL.
++[suffix] returns ok
++[files] returns noop
# Executing section accounting from file /etc/raddb/sites-enabled/default
+- entering group accounting {...}
[detail]expand: %{Packet-Src-IP-Address} - xx.xx.xx.xx
[detail]expand: 
/var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d
 - /var/log/radius/radacct/xx.xx.xx.xx/detail-20120711
[detail] 
/var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d
 expands to /var/log/radius/radacct/xx.xx.xx.xx/detail-20120711
[detail]expand: %t - Wed Jul 11 02:03:45 2012
Cleaning up request 12612249 ID 93 with timestamp +729235
++[detail] returns ok
[detail.moreshet]   expand: /var/log/radius/radacct/moreshet.relay - 
/var/log/radius/radacct/moreshet.relay
[detail.moreshet] /var/log/radius/radacct/moreshet.relay expands to 
/var/log/radius/radacct/moreshet.relay
[detail.moreshet]   expand: %t - Wed Jul 11 02:03:45 2012
++[detail.moreshet] returns ok
++[unix] returns ok
[sql]   expand: %{Stripped-User-Name} - x
[sql]   expand: %{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}} - x
[sql] sql_set_user escaped user -- 'x'
[sql]   expand: %{Acct-Input-Gigawords} - 0
[sql]   expand: %{Acct-Input-Octets} - 4001
[sql]   expand: %{Acct-Output-Gigawords} - 0
[sql]   expand: %{Acct-Output-Octets} - 8134
[sql]   expand: %{Acct-Delay-Time} - 0
[sql]   expand:UPDATE radacct SET  acctstoptime   = 
'%S',  acctsessiontime= '%{Acct-Session-Time}',  
acctinputoctets= '%{%{Acct-Input-Gigawords}:-0}'  32 |
   '%{%{Acct-Input-Octets}:-0}',  acctoutputoctets   = 
'%{%{Acct-Output-Gigawords}:-0}'  32 |   
'%{%{Acct-Output-Octets}:-0}',  acctterminatecause = 
'%{Acct-Terminate-Cause}',  acctstopdelay  = 
'%{%{Acct-Delay-Time}:-0}',  connectinfo_stop   = '%{Connect-Info}' 
  WHERE acctsessionid   = '%{Acct-Session-Id}'   AND username   
   = '%{SQL-User-Name}'   AND nasipaddress  = 
'%{NAS-IP-Address}' -UPDATE radacct SET  acctstoptime  
 = '2012-07-11 02:03:45',  acctsessiontime= '517',  
acctinputoctets= '0'  32 |   '4001',  
acctoutputoctets   = '0'  32 |

[sql]   expand: /var/log/radius/sqltrace.sql - /var/log/radius/sqltrace.sql
Cleaning up request 12612250 ID 95 with timestamp +729235
++[sql] returns fail
Thread 20 got semaphore
Thread 19 got semaphore

It seems the last SQL query line is cut off for some reason, this only happens 
on some connections, while others are stopped correctly.
Not specific to users or time of day.

Versions information:

cat /etc/issue :
CentOS release 5.6 (Final)
Kernel \r on an \m

rpm -qa | grep radius :
freeradius2-python-2.1.12-7
freeradius2-ldap-2.1.12-7
freeradius2-2.1.12-7
freeradius2-krb5-2.1.12-7
freeradius2-mysql-2.1.12-7
freeradius2-utils-2.1.12-7
freeradius2-postgresql-2.1.12-7
freeradius2-perl-2.1.12-7
freeradius2-unixODBC-2.1.12-7

additional logs and/or information can be provided

sql returns fail for some stop requests

2012-07-11 Thread Amir Tal
Freeradius ver 2.1.12, configured to use ldap for auth, sql for acct.

Sometimes users' sessions get stuck and have to be closed manualy (simultaneous 
use is turned on for all users).
After extensive debugging I have found the following in the logs (radius -X)


[thread] # Executing section preacct from file 
/etc/raddb/sites-enabled/default
[thread] +- entering group preacct {...}
++[preprocess] returns ok
[acct_unique] Hashing 'NAS-Port = 14117776,Client-IP-Address = 
xx.xx.xx.xx,NAS-IP-Address = xx.xx.xx.xx,Acct-Session-Id = erx 
ip:109.226.0.9:147.235.234.115:1e47:6248:14c2:8b6a:5dac845:0060992452,Use
r-Name = x@ccc'
[acct_unique] Acct-Unique-Session-ID = d49ba42fa077f5f0.
++[acct_unique] returns ok
[suffix] Looking up realm ccc for User-Name = x@ccc
[suffix] Found realm ccc
[suffix] Adding Stripped-User-Name = x
[suffix] Adding Realm = ccc
[suffix] Accounting realm is LOCAL.
++[suffix] returns ok
++[files] returns noop
# Executing section accounting from file /etc/raddb/sites-enabled/default
+- entering group accounting {...}
[detail]expand: %{Packet-Src-IP-Address} - xx.xx.xx.xx
[detail]expand: 
/var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d
 - /var/log/radius/radacct/xx.xx.xx.xx/detail-20120711
[detail] 
/var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d
 expands to /var/log/radius/radacct/xx.xx.xx.xx/detail-20120711
[detail]expand: %t - Wed Jul 11 02:03:45 2012
Cleaning up request 12612249 ID 93 with timestamp +729235
++[detail] returns ok
[detail.moreshet]   expand: /var/log/radius/radacct/moreshet.relay - 
/var/log/radius/radacct/moreshet.relay
[detail.moreshet] /var/log/radius/radacct/moreshet.relay expands to 
/var/log/radius/radacct/moreshet.relay
[detail.moreshet]   expand: %t - Wed Jul 11 02:03:45 2012
++[detail.moreshet] returns ok
++[unix] returns ok
[sql]   expand: %{Stripped-User-Name} - x
[sql]   expand: %{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}} - x
[sql] sql_set_user escaped user -- 'x'
[sql]   expand: %{Acct-Input-Gigawords} - 0
[sql]   expand: %{Acct-Input-Octets} - 4001
[sql]   expand: %{Acct-Output-Gigawords} - 0
[sql]   expand: %{Acct-Output-Octets} - 8134
[sql]   expand: %{Acct-Delay-Time} - 0
[sql]   expand:UPDATE radacct SET  acctstoptime   = 
'%S',  acctsessiontime= '%{Acct-Session-Time}',  
acctinputoctets= '%{%{Acct-Input-Gigawords}:-0}'  32 |
   '%{%{Acct-Input-Octets}:-0}',  acctoutputoctets   = 
'%{%{Acct-Output-Gigawords}:-0}'  32 |   
'%{%{Acct-Output-Octets}:-0}',  acctterminatecause = 
'%{Acct-Terminate-Cause}',  acctstopdelay  = 
'%{%{Acct-Delay-Time}:-0}',  connectinfo_stop   = '%{Connect-Info}' 
  WHERE acctsessionid   = '%{Acct-Session-Id}'   AND username   
   = '%{SQL-User-Name}'   AND nasipaddress  = 
'%{NAS-IP-Address}' -UPDATE radacct SET  acctstoptime  
 = '2012-07-11 02:03:45',  acctsessiontime= '517',  
acctinputoctets= '0'  32 |   '4001',  
acctoutputoctets   = '0'  32 |
[sql]   expand: /var/log/radius/sqltrace.sql - /var/log/radius/sqltrace.sql
Cleaning up request 12612250 ID 95 with timestamp +729235
++[sql] returns fail
Thread 20 got semaphore
Thread 19 got semaphore

It seems the last SQL query line is cut off for some reason, this only happens 
on some connections, while others are stopped correctly.
Not specific to users or time of day.

Versions information:

cat /etc/issue :
CentOS release 5.6 (Final)
Kernel \r on an \m

rpm -qa | grep radius :
freeradius2-python-2.1.12-7
freeradius2-ldap-2.1.12-7
freeradius2-2.1.12-7
freeradius2-krb5-2.1.12-7
freeradius2-mysql-2.1.12-7
freeradius2-utils-2.1.12-7
freeradius2-postgresql-2.1.12-7
freeradius2-perl-2.1.12-7
freeradius2-unixODBC-2.1.12-7

additional logs and/or information can be provided if required.
Help would be appreciated.

The Cloud has no limit !

[cid:image001.jpg@01CD5F84.25487600]http://www.ccc.co.il/

Amir Tal

Systems Automation Expert

Cloud Services

Direct: 972-(0)3-9201471

Fax: 972-(0)-3-9201442

www.ccc.co.ilhttp://www.ccc.co.il/   [cid:image002.png@01CD5F84.25487600] 
http://www.facebook.com/triplec.il




inline: image001.jpginline: image002.png-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

RE: segmentation fault freeradius 2.1.7 using rlm_sql

2011-08-02 Thread Amir Tal
Upgraded freeradius to 2.1.11 (built from source)

This time it brought the whole machine down:

radiusd[8644]: segfault at 00c8 rip 2aad51190cfb rsp 
504b8770 error 4
radiusd[16348]: segfault at 00c8 rip 2afffa168cfb rsp 
46c00170 error 4
radiusd[22540]: segfault at 04b8 rip 2b10e5147850 rsp 
4707c2c8 error 4
radiusd[30297]: segfault at 00c8 rip 2b848c84bcfb rsp 
54924750 error 4
audispd invoked oom-killer: gfp_mask=0x201d2, order=0, oomkilladj=0

Call Trace:
 [800c961b] out_of_memory+0x8e/0x2f3
 [8002e3fc] __wake_up+0x38/0x4f
 [8000f625] __alloc_pages+0x27f/0x308
 [8001300a] __do_page_cache_readahead+0x96/0x179
 [80013945] filemap_nopage+0x14c/0x360
 [80008964] __handle_mm_fault+0x1fb/0x1039
 [8006720b] do_page_fault+0x4cb/0x874
 [8005dde9] error_exit+0x0/0x84

Mem-info:
Node 0 DMA per-cpu:
cpu 0 hot: high 0, batch 1 used:0
cpu 0 cold: high 0, batch 1 used:0
cpu 1 hot: high 0, batch 1 used:0
cpu 1 cold: high 0, batch 1 used:0
Node 0 DMA32 per-cpu:
cpu 0 hot: high 186, batch 31 used:18
cpu 0 cold: high 62, batch 15 used:45
cpu 1 hot: high 186, batch 31 used:31
cpu 1 cold: high 62, batch 15 used:61
Node 0 Normal per-cpu:
cpu 0 hot: high 186, batch 31 used:61
cpu 0 cold: high 62, batch 15 used:49
cpu 1 hot: high 186, batch 31 used:24
cpu 1 cold: high 62, batch 15 used:52
Node 0 HighMem per-cpu: empty
Free pages:   22180kB (0kB HighMem)
Active:535129 inactive:455633 dirty:0 writeback:0 unstable:0 free:5545 
slab:3369 mapped-file:1085 mapped-anon:990241 pagetables:5050
Node 0 DMA free:10116kB min:16kB low:20kB high:24kB active:0kB inactive:0kB 
present:9748kB pages_scanned:0 all_unreclaimable? yes
lowmem_reserve[]: 0 3000 4010 4010
Node 0 DMA32 free:10052kB min:6052kB low:7564kB high:9076kB active:1623644kB 
inactive:1405408kB present:3072160kB pages_scanned:19313612 all_unreclaimable? 
yes
lowmem_reserve[]: 0 0 1010 1010
Node 0 Normal free:2012kB min:2036kB low:2544kB high:3052kB active:508040kB 
inactive:425828kB present:1034240kB pages_scanned:2193259 all_unreclaimable? yes
lowmem_reserve[]: 0 0 0 0
Node 0 HighMem free:0kB min:128kB low:128kB high:128kB active:0kB inactive:0kB 
present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
Node 0 DMA: 5*4kB 2*8kB 4*16kB 3*32kB 5*64kB 3*128kB 0*256kB 0*512kB 1*1024kB 
0*2048kB 2*4096kB = 10116kB
Node 0 DMA32: 13*4kB 4*8kB 1*16kB 13*32kB 1*64kB 0*128kB 1*256kB 0*512kB 
1*1024kB 0*2048kB 2*4096kB = 10052kB
Node 0 Normal: 17*4kB 19*8kB 0*16kB 0*32kB 0*64kB 0*128kB 1*256kB 1*512kB 
1*1024kB 0*2048kB 0*4096kB = 2012kB
Node 0 HighMem: empty
1662 pagecache pages
Swap cache: add 1095074, delete 1094514, find 2338993/2348642, race 0+1
Free swap  = 0kB
Total swap = 4096564kB
Free swap:0kB
1310720 pages of RAM
299836 reserved pages
8240 pages shared
560 pages swap cached
Out of memory: Killed process 18723, UID 95, (radiusd).



-Original Message-
From: freeradius-users-bounces+amir=ccc.co...@lists.freeradius.org 
[mailto:freeradius-users-bounces+amir=ccc.co...@lists.freeradius.org] On Behalf 
Of Alan DeKok
Sent: Wednesday, July 27, 2011 4:33 PM
To: FreeRadius users mailing list
Subject: Re: segmentation fault freeradius 2.1.7 using rlm_sql

Amir Tal wrote:
 For some unknown reason radiusd keeps getting segmentation faults, every few 
 days and even after several hours of work.

  Upgrade.

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

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


RE: segmentation fault freeradius 2.1.7 using rlm_sql

2011-08-02 Thread Amir Tal
This is a production server,
What is the latest stable version to use?

Amir.


-Original Message-
From: freeradius-users-bounces+amir=ccc.co...@lists.freeradius.org 
[mailto:freeradius-users-bounces+amir=ccc.co...@lists.freeradius.org] On Behalf 
Of Fajar A. Nugraha
Sent: Tuesday, August 02, 2011 11:02 AM
To: FreeRadius users mailing list
Subject: Re: segmentation fault freeradius 2.1.7 using rlm_sql

On Tue, Aug 2, 2011 at 2:27 PM, Amir Tal a...@ccc.co.il wrote:
 Upgraded freeradius to 2.1.11 (built from source)

 This time it brought the whole machine down:

Notice how I DIDN'T suggest upgrading to 2.1.11, but to v2.1.x of git branch? 
There's a reason for that, and you just found out the hard way.

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

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


RE: segmentation fault freeradius 2.1.7 using rlm_sql

2011-07-28 Thread Amir Tal
I did, from 1.1.7
And still I get the exact same result (segmentation faults)


-Original Message-
From: freeradius-users-bounces+amir=ccc.co...@lists.freeradius.org 
[mailto:freeradius-users-bounces+amir=ccc.co...@lists.freeradius.org] On Behalf 
Of Alan DeKok
Sent: Wednesday, July 27, 2011 4:33 PM
To: FreeRadius users mailing list
Subject: Re: segmentation fault freeradius 2.1.7 using rlm_sql

Amir Tal wrote:
 For some unknown reason radiusd keeps getting segmentation faults, every few 
 days and even after several hours of work.

  Upgrade.

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

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


segmentation fault freeradius 2.1.7 using rlm_sql

2011-07-27 Thread Amir Tal
Hi all,

freeRADIUS version 2.1.7
(package freeradius2 on centos 5.6)

Radius is configured to store user info (auth) in ldap - running on same 
machine as freeradius,
and use rlm_sql for accounting info (and simultaneous use checks) - running on 
remote machine.

For some unknown reason radiusd keeps getting segmentation faults, every few 
days and even after several hours of work.

Jul 27 04:01:03 RADIUS4 kernel: radiusd[29903]: segfault at 00c8 
rip 2aef39fb9cfb rsp 456d6170 error 4

Last lines in the radius.log :
[sql]   expand:UPDATE radacct SET  acctstoptime   = 
'%S',  acctsessiontime= '%{Acct-Session-Time}',  
acctinputoctets= '%{%{Acct-Input-Gigawords}:-0}'  32 |
   '%{%{Acct-Input-Octets}:-0}',  acctoutputoctets   = 
'%{%{Acct-Output-Gigawords}:-0}'  32 |   
'%{%{Acct-Output-Octets}:-0}',  acctterminatecause = 
'%{Acct-Terminate-Cause}',  acctstopdelay  = 
'%{%{Acct-Delay-Time}:-0}',  connectinfo_stop   = '%{Connect-Info}' 
  WHERE acctsessionid   = '%{Acct-Session-Id}'   AND username   
   = '%{SQL-User-Name}'   AND nasipaddress  = 
'%{NAS-IP-Address}' -UPDATE radacct SET  acctstoptime  
 = '2011-07-27 04:01:03',  acctsessiontime= '0',
  acctinputoctets= '0'  32 |   '0',   
   acc!
 toutputoctets   = '0'  32 |  
[sql]   expand: /var/log/radius/sqltrace.sql - /var/log/radius/sqltrace.sql
rlm_sql (sql): Trying to (re)connect unconnected handle 12..
rlm_sql (sql): Attempting to connect rlm_sql_mysql #12

since configuration files are quite large, I didn't attach complete dump or 
radius -X ,
let me know what other info is needed.

Regards,

Amir Tal.

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