freeradius 3.1 sqlcounter[41]: Attribute Daily-Session-Time already defined with different flags

mpajarin plexus mpajarin.plexus at gmail.com
Wed Mar 1 21:34:20 CET 2017


Im running  freeradius 3.1.0 version, on Centos  and on debug  -X  get an
error like this:

 # Loaded module "rlm_sqlcounter"
  # Loading module "dailycounter" from file /etc/raddb/mods-enabled/
sqlcounter
  sqlcounter dailycounter {
        sql_module_instance = "sql"
        query = "SELECT SUM(acctsessiontime - GREATEST((%%b -
UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username =
'%{&User-Name}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%%b'"
        reset = "daily"
  }
/etc/raddb/mods-enabled/sqlcounter[41]: Failed defining counter attribute:
Attribute Daily-Session-Time already defined with different flags
/etc/raddb/mods-enabled/sqlcounter[41]: Instantiation failed for module
"dailycounter"


Really i dont have any modification on the default config:

radiusd -X  -d /etc/raddb
FreeRADIUS Version 3.1.0
Copyright (C) 1999-2016 The FreeRADIUS server project and contributors
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE
You may redistribute copies of FreeRADIUS under the terms of the
GNU General Public License
For more information about these matters, see the file named COPYRIGHT
Starting - reading configuration files ...
including dictionary file /usr/local/freeradius/share/freeradius/dictionary
including dictionary file /usr/local/freeradius/share/
freeradius/dictionary.dhcp
including dictionary file /usr/local/freeradius/share/
freeradius/dictionary.vqp
including dictionary file /etc/raddb/dictionary
including configuration file /etc/raddb/radiusd.conf
including configuration file /etc/raddb/proxy.conf
including configuration file /etc/raddb/clients.conf
including files in directory /etc/raddb/mods-enabled/
including configuration file /etc/raddb/mods-enabled/replicate
including configuration file /etc/raddb/mods-enabled/sql
including configuration file /etc/raddb/mods-config/sql/driver/mysql
including configuration file /etc/raddb/mods-config/sql/
main/mysql/queries.conf
including configuration file /etc/raddb/mods-enabled/expr
including configuration file /etc/raddb/mods-enabled/logintime
including configuration file /etc/raddb/mods-enabled/eap_inner
including configuration file /etc/raddb/mods-enabled/ntlm_auth
including configuration file /etc/raddb/mods-enabled/pap
including configuration file /etc/raddb/mods-enabled/sqlcounter
including configuration file /etc/raddb/mods-config/sql/
counter/mysql/dailycounter.conf
including configuration file /etc/raddb/mods-config/sql/
counter/mysql/monthlycounter.conf
including configuration file /etc/raddb/mods-config/sql/
counter/mysql/noresetcounter.conf
including configuration file /etc/raddb/mods-config/sql/
counter/mysql/expire_on_login.conf
including configuration file /etc/raddb/mods-enabled/passwd
including configuration file /etc/raddb/mods-enabled/cache_eap
including configuration file /etc/raddb/mods-enabled/linelog
including configuration file /etc/raddb/mods-enabled/unix
including configuration file /etc/raddb/mods-enabled/radutmp
including configuration file /etc/raddb/mods-enabled/attr_filter
including configuration file /etc/raddb/mods-enabled/preprocess
including configuration file /etc/raddb/mods-enabled/dhcp
including configuration file /etc/raddb/mods-enabled/digest
including configuration file /etc/raddb/mods-enabled/detail.log
including configuration file /etc/raddb/mods-enabled/mschap
including configuration file /etc/raddb/mods-enabled/unpack
including configuration file /etc/raddb/mods-enabled/soh
including configuration file /etc/raddb/mods-enabled/files
including configuration file /etc/raddb/mods-enabled/exec
including configuration file /etc/raddb/mods-enabled/sradutmp
including configuration file /etc/raddb/mods-enabled/detail
including configuration file /etc/raddb/mods-enabled/expiration
including configuration file /etc/raddb/mods-enabled/chap
including configuration file /etc/raddb/mods-enabled/always
including configuration file /etc/raddb/mods-enabled/realm
including configuration file /etc/raddb/mods-enabled/eap
including configuration file /etc/raddb/mods-enabled/utf8
including configuration file /etc/raddb/mods-enabled/dynamic_clients
including configuration file /etc/raddb/mods-enabled/echo
including files in directory /etc/raddb/policy.d/
including configuration file /etc/raddb/policy.d/abfab-tr
including configuration file /etc/raddb/policy.d/operator-name
including configuration file /etc/raddb/policy.d/accounting
including configuration file /etc/raddb/policy.d/filter
including configuration file /etc/raddb/policy.d/vendor
including configuration file /etc/raddb/policy.d/dhcp
including configuration file /etc/raddb/policy.d/cui
including configuration file /etc/raddb/policy.d/canonicalization
including configuration file /etc/raddb/policy.d/control
including configuration file /etc/raddb/policy.d/eap
including configuration file /etc/raddb/policy.d/debug
including files in directory /etc/raddb/sites-enabled/
including configuration file /etc/raddb/sites-enabled/default
including configuration file /etc/raddb/sites-enabled/inner-tunnel
main {
 security {
        allow_core_dumps = no
 }
        name = "radiusd"
        prefix = "/usr/local/freeradius"
        localstatedir = "/usr/local/freeradius/var"
        logdir = "/usr/local/freeradius/var/log/radius"
        run_dir = "/usr/local/freeradius/var/run/radiusd"
}
main {
        name = "radiusd"
        prefix = "/usr/local/freeradius"
        localstatedir = "/usr/local/freeradius/var"
        sbindir = "/usr/local/freeradius/sbin"
        logdir = "/usr/local/freeradius/var/log/radius"
        run_dir = "/usr/local/freeradius/var/run/radiusd"
        libdir = "/usr/local/freeradius/lib"
        radacctdir = "/usr/local/freeradius/var/log/radius/radacct"
        hostname_lookups = no
        max_request_time = 30
        cleanup_delay = 5
        continuation_timeout = 15
        max_requests = 16384
        pidfile = "/usr/local/freeradius/var/run/radiusd/radiusd.pid"
        checkrad = "/usr/local/freeradius/sbin/checkrad"
        debug_level = 0
        proxy_requests = yes
 log {
        stripped_names = no
        auth = no
        auth_badpass = no
        auth_goodpass = no
        colourise = yes
        msg_denied = "You are already logged in - access denied"
 }
 resources {
 }
 security {
        max_attributes = 200
        reject_delay = 1.000000
        status_server = yes
        allow_vulnerable_openssl = "no"
 }
}
radiusd: #### Loading Realms and Home Servers ####
 proxy server {
        retry_delay = 5
        retry_count = 3
        default_fallback = no
        dynamic = no
        dead_time = 120
        wake_all_if_all_dead = no
 }
 home_server localhost {
        ipaddr = 127.0.0.1
        port = 1812
        type = "auth"
        secret = <<< secret >>>
        response_window = 20.000000
        response_timeouts = 1
        max_outstanding = 65536
        zombie_period = 40
        status_check = "status-server"
        ping_interval = 30
        check_interval = 30
        check_timeout = 4
        num_answers_to_alive = 3
        revive_interval = 120
  limit {
        max_connections = 16
        max_requests = 0
        lifetime = 0
        idle_timeout = 0
  }
  coa {
        irt = 2
        mrt = 16
        mrc = 5
        mrd = 30
  }
 }
 home_server_pool my_auth_failover {
        type = fail-over
        home_server = localhost
 }
 realm example.com {
        auth_pool = my_auth_failover
 }
 realm LOCAL {
 }
radiusd: #### Loading Clients ####
 client localhost {
        ipaddr = 127.0.0.1
        require_message_authenticator = no
        secret = <<< secret >>>
        nas_type = "other"
        proto = "*"
  limit {
        max_connections = 16
        lifetime = 0
        idle_timeout = 30
  }
 }
 client localhost_ipv6 {
        ipv6addr = ::1
        require_message_authenticator = no
        secret = <<< secret >>>
  limit {
        max_connections = 16
        lifetime = 0
        idle_timeout = 30
  }
 }
Debugger not attached
 thread pool {
        start_servers = 5
        max_servers = 32
        min_spare_servers = 3
        max_spare_servers = 10
        max_requests_per_server = 0
        cleanup_delay = 5
        max_queue_size = 65536
        queue_priority = "default"
        auto_limit_acct = no
 }
listen {
        type = "auth"
        ipaddr = *
        port = 0
        recv_buff = 0
   limit {
        max_connections = 16
        lifetime = 0
        idle_timeout = 30
   }
}
listen {
        type = "acct"
        ipaddr = *
        port = 0
        recv_buff = 0
   limit {
        max_connections = 16
        lifetime = 0
        idle_timeout = 30
   }
}
listen {
        type = "auth"
        ipv6addr = ::
        port = 0
        recv_buff = 0
   limit {
        max_connections = 16
        lifetime = 0
        idle_timeout = 30
   }
}
listen {
        type = "acct"
        ipv6addr = ::
        port = 0
        recv_buff = 0
   limit {
        max_connections = 16
        lifetime = 0
        idle_timeout = 30
   }
}
  # Creating Auth-Type = PAP
  # Creating Auth-Type = CHAP
  # Creating Auth-Type = MS-CHAP
  # Creating Auth-Type = eap
  # Creating Auth-Type = digest
listen {
        type = "auth"
        ipaddr = 127.0.0.1
        port = 18120
        recv_buff = 0
}
radiusd: #### Loading modules ####
 modules {
  # Loaded module "rlm_replicate"
  # Loading module "replicate" from file /etc/raddb/mods-enabled/replicate
  # Loaded module "rlm_sql"
  # Loading module "sql" from file /etc/raddb/mods-enabled/sql
  sql {
        driver = "rlm_sql_mysql"
        server = "localhost"
        port = 3306
        login = "radius"
        password = <<< secret >>>
        radius_db = "radius"
        read_groups = yes
        read_profiles = yes
        read_clients = no
        delete_stale_sessions = yes
        sql_user_name = "%{User-Name}"
        group_attribute = "sql-sql-Group"
        default_user_profile = ""
        client_query = "SELECT id, nasname, shortname, type, secret, server
FROM nas"
        authorize_check_query = "SELECT id, username, attribute, value, op
FROM radcheck WHERE username = '%{SQL-User-Name}' ORDER BY id"
        authorize_reply_query = "SELECT id, username, attribute, value, op
FROM radreply WHERE username = '%{SQL-User-Name}' ORDER BY id"
        authorize_group_check_query = "SELECT id, groupname, attribute,
Value, op FROM radgroupcheck WHERE groupname = '%{sql-sql-Group}' ORDER BY
id"
        authorize_group_reply_query = "SELECT id, groupname, attribute,
value, op FROM radgroupreply WHERE groupname = '%{sql-sql-Group}' ORDER BY
id"
        group_membership_query = "SELECT groupname FROM radusergroup WHERE
username = '%{SQL-User-Name}' ORDER BY priority"
        simul_count_query = "SELECT COUNT(*) FROM radacct WHERE username =
'%{SQL-User-Name}' AND acctstoptime IS NULL"
        simul_verify_query = "SELECT radacctid, acctsessionid, username,
nasipaddress, nasportid, framedipaddress, callingstationid, framedprotocol
FROM radacct WHERE username = '%{SQL-User-Name}' AND acctstoptime IS NULL"
        safe_characters = "@abcdefghijklmnopqrstuvwxyzABCD
EFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"
   accounting {
        reference = "%{tolower:type.%{Acct-Status-Type}.query}"
    type {
     accounting-on {
        query = "UPDATE radacct SET acctstoptime =
FROM_UNIXTIME(%{integer:Event-Timestamp}), acctsessiontime   =
'%{integer:Event-Timestamp}' - UNIX_TIMESTAMP(acctstarttime),
acctterminatecause = '%{%{Acct-Terminate-Cause}:-NAS-Reboot}' WHERE
acctstoptime IS NULL AND nasipaddress   = '%{NAS-IP-Address}' AND
acctstarttime <= FROM_UNIXTIME(%{integer:Event-Timestamp})"
     }
     accounting-off {
        query = "UPDATE radacct SET acctstoptime =
FROM_UNIXTIME(%{integer:Event-Timestamp}), acctsessiontime   =
'%{integer:Event-Timestamp}' - UNIX_TIMESTAMP(acctstarttime),
acctterminatecause = '%{%{Acct-Terminate-Cause}:-NAS-Reboot}' WHERE
acctstoptime IS NULL AND nasipaddress   = '%{NAS-IP-Address}' AND
acctstarttime <= FROM_UNIXTIME(%{integer:Event-Timestamp})"
     }
     start {
        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) VALUES ('%{Acct-Session-Id}',
'%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}',
'%{NAS-IP-Address}', '%{%{NAS-Port-ID}:-%{NAS-Port}}', '%{NAS-Port-Type}',
FROM_UNIXTIME(%{integer:Event-Timestamp}),
FROM_UNIXTIME(%{integer:Event-Timestamp}),
NULL, '0', '%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0',
'%{Called-Station-Id}', '%{Calling-Station-Id}', '', '%{Service-Type}',
'%{Framed-Protocol}', '%{Framed-IP-Address}')"
        query = "UPDATE radacct SET acctstarttime       =
FROM_UNIXTIME(%{integer:Event-Timestamp}), acctupdatetime     =
FROM_UNIXTIME(%{integer:Event-Timestamp}), connectinfo_start =
'%{Connect-Info}' WHERE AcctUniqueId = '%{Acct-Unique-Session-Id}'"
     }
     interim-update {
        query = "UPDATE radacct SET acctupdatetime  =
(@acctupdatetime_old:=acctupdatetime),
acctupdatetime  = FROM_UNIXTIME(%{integer:Event-Timestamp}), acctinterval
 = %{integer:Event-Timestamp} - UNIX_TIMESTAMP(@acctupdatetime_old),
framedipaddress = '%{Framed-IP-Address}', acctsessiontime =
%{%{Acct-Session-Time}:-NULL}, acctinputoctets =
'%{%{Acct-Input-Gigawords}:-0}' << 32 | '%{%{Acct-Input-Octets}:-0}',
acctoutputoctets = '%{%{Acct-Output-Gigawords}:-0}' << 32 |
'%{%{Acct-Output-Octets}:-0}' WHERE AcctUniqueId =
'%{Acct-Unique-Session-Id}'"
        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) VALUES ('%{Acct-Session-Id}',
'%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}',
'%{NAS-IP-Address}', '%{%{NAS-Port-ID}:-%{NAS-Port}}', '%{NAS-Port-Type}',
FROM_UNIXTIME(%{integer:Event-Timestamp} - %{%{Acct-Session-Time}:-0}),
FROM_UNIXTIME(%{integer:Event-Timestamp}), NULL,
%{%{Acct-Session-Time}:-NULL}, '%{Acct-Authentic}', '%{Connect-Info}', '',
'%{%{Acct-Input-Gigawords}:-0}' << 32 | '%{%{Acct-Input-Octets}:-0}',
'%{%{Acct-Output-Gigawords}:-0}' << 32 | '%{%{Acct-Output-Octets}:-0}',
'%{Called-Station-Id}', '%{Calling-Station-Id}', '', '%{Service-Type}',
'%{Framed-Protocol}', '%{Framed-IP-Address}')"
     }
     stop {
        query = "UPDATE radacct SET acctstoptime        =
FROM_UNIXTIME(%{integer:Event-Timestamp}), acctsessiontime    =
%{%{Acct-Session-Time}:-NULL}, acctinputoctets=
'%{%{Acct-Input-Gigawords}:-0}' << 32 | '%{%{Acct-Input-Octets}:-0}',
acctoutputoctets = '%{%{Acct-Output-Gigawords}:-0}' << 32 |
'%{%{Acct-Output-Octets}:-0}', acctterminatecause =
'%{Acct-Terminate-Cause}', connectinfo_stop = '%{Connect-Info}' WHERE
AcctUniqueId = '%{Acct-Unique-Session-Id}'"
        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) VALUES ('%{Acct-Session-Id}',
'%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}',
'%{NAS-IP-Address}', '%{%{NAS-Port-ID}:-%{NAS-Port}}', '%{NAS-Port-Type}',
FROM_UNIXTIME(%{integer:Event-Timestamp} - %{%{Acct-Session-Time}:-0}),
FROM_UNIXTIME(%{integer:Event-Timestamp}),
FROM_UNIXTIME(%{integer:Event-Timestamp}),
%{%{Acct-Session-Time}:-NULL}, '%{Acct-Authentic}', '', '%{Connect-Info}',
'%{%{Acct-Input-Gigawords}:-0}' << 32 | '%{%{Acct-Input-Octets}:-0}',
'%{%{Acct-Output-Gigawords}:-0}' << 32 | '%{%{Acct-Output-Octets}:-0}',
'%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Acct-Terminate-Cause}',
'%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}')"
     }
    }
   }
   post-auth {
        reference = ".query"
        query = "INSERT INTO radpostauth (username, pass, reply, authdate)
VALUES ( '%{SQL-User-Name}', '%{%{User-Password}:-%{Chap-Password}}',
'%{reply:Packet-Type}', '%S')"
   }
  }
rlm_sql (sql) - Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and
linked
Creating attribute sql-sql-Group
  # Loaded module "rlm_expr"
  # Loading module "expr" from file /etc/raddb/mods-enabled/expr
  expr {
        safe_characters = "@abcdefghijklmnopqrstuvwxyzABCD
EFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /äéöüàâæçèéêëîïôœùûüaÿÄÉÖÜßÀÂÆÇ
ÈÉÊËÎÏÔŒÙÛÜŸ"
  }
  # Loaded module "rlm_logintime"
  # Loading module "logintime" from file /etc/raddb/mods-enabled/logintime
  logintime {
        minimum_timeout = 60
  }
  # Loaded module "rlm_eap"
  # Loading module "inner-eap" from file /etc/raddb/mods-enabled/eap_inner
  eap inner-eap {
        default_eap_type = "mschapv2"
        ignore_unknown_eap_types = no
        cisco_accounting_username_bug = no
  }
   # Linked to sub-module rlm_eap_md5
   # Linked to sub-module rlm_eap_gtc
   gtc {
        challenge = "Password: "
        auth_type = "PAP"
   }
   # Linked to sub-module rlm_eap_mschapv2
   mschapv2 {
        with_ntdomain_hack = no
        send_error = no
   }
rlm_eap (inner-eap) - Ignoring EAP method tls because we don't have OpenSSL
support
  # Loaded module "rlm_exec"
  # Loading module "ntlm_auth" from file /etc/raddb/mods-enabled/ntlm_auth
  exec ntlm_auth {
        wait = yes
        program = "/path/to/ntlm_auth --request-nt-key --domain=MYDOMAIN
--username=%{mschap:User-Name} --password=%{User-Password}"
        shell_escape = yes
  }
  # Loaded module "rlm_pap"
  # Loading module "pap" from file /etc/raddb/mods-enabled/pap
  pap {
        normalise = yes
  }
  # Loaded module "rlm_sqlcounter"
  # Loading module "dailycounter" from file /etc/raddb/mods-enabled/
sqlcounter
  sqlcounter dailycounter {
        sql_module_instance = "sql"
        query = "SELECT SUM(acctsessiontime - GREATEST((%%b -
UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username =
'%{&User-Name}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%%b'"
        reset = "daily"
  }
/etc/raddb/mods-enabled/sqlcounter[41]: Failed defining counter attribute:
Attribute Daily-Session-Time already defined with different flags
/etc/raddb/mods-enabled/sqlcounter[41]: Instantiation failed for module
"dailycounter"


Some idea?
Thanks


More information about the Freeradius-Users mailing list