Re: problem with table radacct column acctstarttime acctstoptime
On 24.05.2018 11:59, Alexandr wrote:
I found function strftime, i think it writes time , but i found error contain strftime
(12) sql: ERROR: rlm_sql_mysql: ERROR 1305 (FUNCTION radius_serv.strftime does not exist): 42000 (12) sql: SQL query returned: server error
How do fix it?
some sql queries ( insert / update)
INSERT:
rlm_sql (sql): Reserved connection (0) (11) sql: EXPAND %{User-Name} (11) sql: --> systemn (11) sql: SQL-User-Name set to 'systemn' (11) 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) VALUES ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{%{NAS-Port-ID}:-%{NAS-Port}}', '%{NAS-Port-Type}', %{%{integer:Event-Timestamp}:-date('now')}, %{%{integer:Event-Timestamp}:-date('now')}, NULL, '0', '%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}', '%{Calling-Station-Id}', '', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}')
(11) 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) VALUES ('8D3C0B6681A85E4F', '4884926a9a6b3dadbdd270f22e5fd4c4', 'systemn', '', '192.168.10.26', '2', 'Wireless-802.11', 1527148106, 1527148106, NULL, '0', 'RADIUS', 'CONNECT 54Mbps 802.11g', '', '0', '0', '60-E3-27-72-BF-5A:DEvChata_new', '38-2D-D1-32-61-1E', '', 'Framed-User', '', '')
(11) 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) VALUES ('8D3C0B6681A85E4F', '4884926a9a6b3dadbdd270f22e5fd4c4', 'systemn', '', '192.168.10.26', '2', 'Wireless-802.11', 1527148106, 1527148106, NULL, '0', 'RADIUS', 'CONNECT 54Mbps 802.11g', '', '0', '0', '60-E3-27-72-BF-5A:DEvChata_new', '38-2D-D1-32-61-1E', '', 'Framed-User', '', '') (11) sql: SQL query returned: success (11) sql: 1 record(s) updated
UPDATE: rlm_sql (sql): Reserved connection (1) (13) sql: EXPAND %{User-Name} (13) sql: --> systemn (13) sql: SQL-User-Name set to 'systemn' (13) sql: EXPAND UPDATE radacct SET acctstoptime = %{%{integer:Event-Timestamp}:-date('now')}, 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}'
(13) sql: --> UPDATE radacct SET acctstoptime = 1527150519, acctsessiontime = 36, acctinputoctets = 0 << 32 | 282380, acctoutputoctets = 0 << 32 | 1486385, acctterminatecause = 'User-Request', connectinfo_stop = 'CONNECT 54Mbps 802.11g' WHERE AcctUniqueId = '4ac1349d1e910f79fba700d0d1a1abba'
(13) sql: Executing query: UPDATE radacct SET acctstoptime = 1527150519, acctsessiontime = 36, acctinputoctets = 0 << 32 | 282380, acctoutputoctets = 0 << 32 | 1486385, acctterminatecause = 'User-Request', connectinfo_stop = 'CONNECT 54Mbps 802.11g' WHERE AcctUniqueId = '4ac1349d1e910f79fba700d0d1a1abba'
rlm_sql_mysql: Rows matched: 1 Changed: 1 Warnings: 1 (13) sql: SQL query returned: success (13) sql: 1 record(s) updated
On 23.05.2018 13:51, Alan DeKok wrote:
On May 23, 2018, at 4:00 AM, Alexandr<systemn17088@gmail.com> wrote:
freeradius -v3.0.18
Instead db mysql in table radacct shows incorrect time column acctstartime and acctstoptime in v.3 , if I will use v.2 or v.4 it will be ok. It's a bug ? Those times are created by the access point. FreeRADIUS just writes them to the database.
Run the server in debugging mode to see what's going on.
Alan DeKok.
- List info/subscribe/unsubscribe? Seehttp://www.freeradius.org/list/users.html
On May 24, 2018, at 8:29 AM, Alexandr <systemn17088@gmail.com> wrote:
On 24.05.2018 11:59, Alexandr wrote:
I found function strftime, i think it writes time , but i found error contain strftime
(12) sql: ERROR: rlm_sql_mysql: ERROR 1305 (FUNCTION radius_serv.strftime does not exist): 42000 (12) sql: SQL query returned: server error
How do fix it?
Read the MySQL documentation to see what functions it accepts. If you edit the SQL queries, you should know how to do that, and how to debug issues with them. And *read* the debug output. ALL OF IT. Try to understand what it's doing: http://wiki.freeradius.org/radius-X If you only look at 1-2 lines of the output, you will never understand the problem. And therefore never fix it. Alan DeKok.
participants (2)
-
Alan DeKok -
Alexandr