freeradius 3.2.5 - sql module with if fail ok - still fails the entire authorize section
Alan DeKok
aland at deployingradius.com
Sat Aug 16 12:53:46 UTC 2025
On Aug 16, 2025, at 8:17 AM, Ricardo Esteves <maverick.pt at gmail.com> wrote:
> I'm having an issue with sql module, i want to continue in the authorize section even if the sql module fails, but is not working.
>
> I have this in the authorize section:
>
> sql
> if (fail) {
> ok
> }
>
> When i try radtest i see that the sql module fails (when my mysql is down) but the if condition is not respected and entire authorize section fails:
The "fail" result causes the "authorize" section to the stopped. That's by design.
> Anyone has any idea what might be wrong?
Nothing is wrong.
If you want to override the fail, you have two options:
# if SQL fails, then run "ok"
redundant {
sql
ok
}
or
sql {
fail = 2 # over-rides the "stop on fail"
}
if (fail) {
ok
}
Alan DeKok.
More information about the Freeradius-Users
mailing list