The "modules.sql.fail" trigger no longer fires #1923

Closed
spbnick opened this Issue Feb 24, 2017 · 2 comments

Comments

Projects
None yet
2 participants
Collaborator

spbnick commented Feb 24, 2017

Issue type

  • Defect - Crash or memory corruption.
  • Defect - Non compliance with a standards document, or incorrect API usage.
  • Defect - Unexpected behaviour (obvious or verified by project member).
  • Feature request.

Defect/Feature description

FreeRADIUS no longer fires "modules.sql.fail" trigger, even though it is still present in trigger.conf.

See also: https://bugzilla.redhat.com/show_bug.cgi?id=1425869

How to reproduce issue

Start the server connected to a database. E.g. MySQL.
Stop the database server.
Execute an authentication request.
Observe no "fail" trigger firing.

Output of [radiusd|freeradius] -X showing issue occurring

(0) sql: Executing select query: SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'paptestuser' ORDER BY id
rlm_sql_mysql: Socket destructor called, closing socket
rlm_sql (sql): Reconnecting (0)
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Couldn't connect to MySQL server radius@127.0.0.1:radius
rlm_sql_mysql: MySQL error: Can't connect to MySQL server on '127.0.0.1' (111)
rlm_sql_mysql: Socket destructor called, closing socket
Trigger modules.sql.close -> /usr/bin/snmptrap -v2c -c public localhost '' FREERADIUS-NOTIFICATION-MIB::serverModuleConnectionDown radiusdModuleName s sql radiusdModuleInstance s ''
(0) Executing: /usr/bin/snmptrap -v2c -c public localhost '' FREERADIUS-NOTIFICATION-MIB::serverModuleConnectionDown radiusdModuleName s sql radiusdModuleInstance s '':

Output of [radiusd|freeradius] -X in v3.0.4

rlm_sql (sql): Executing query: 'SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'paptestuser' ORDER BY id'
rlm_sql_mysql: MYSQL check_error: 2006, returning RLM_SQL_RECONNECT
Trigger modules.sql.close -> /usr/bin/snmptrap -v2c -c public localhost '' FREERADIUS-NOTIFICATION-MIB::serverModuleConnectionDown radiusdModuleName s sql radiusdModuleInstance s ''
Executing: /usr/bin/snmptrap -v2c -c public localhost '' FREERADIUS-NOTIFICATION-MIB::serverModuleConnectionDown radiusdModuleName s sql radiusdModuleInstance s '':
rlm_sql_mysql: Socket destructor called, closing socket
rlm_sql (sql): Reconnecting (4)
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Couldn't connect socket to MySQL server radius@127.0.0.1:radius
rlm_sql_mysql: Mysql error 'Can't connect to MySQL server on '127.0.0.1' (111)'
Trigger modules.sql.fail -> /usr/bin/snmptrap -v2c -c public localhost '' FREERADIUS-NOTIFICATION-MIB::serverModuleConnectionFail radiusdModuleName s sql radiusdModuleInstance s ''
Executing: /usr/bin/snmptrap -v2c -c public localhost '' FREERADIUS-NOTIFICATION-MIB::serverModuleConnectionFail radiusdModuleName s sql radiusdModuleInstance s '':
Collaborator

spbnick commented Feb 24, 2017

Apparently the trigger was removed in a6d822d.

@alandekok alandekok added a commit that referenced this issue Feb 24, 2017

@alandekok alandekok add modules.sql.fail trigger. Fixes #1923
The connection pool knows when connections are opened / closed.
It doesn't know as much when a connection fails
09bf905
Collaborator

spbnick commented Feb 27, 2017

Thanks, Alan!

I assume GitHub doesn't pick up Fixes tag from commit subject, so it didn't close this issue.

alandekok closed this Feb 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment