Problems with Freeradius auth after upgrading to 5.2.0

I recently (yesterday) upgraded from UCS 5.0.9 to 5.2.0 and since then freeradius seems to have some problem.
When freeradius is started via systemd (or the WebUI) and I try to authenticate a wireless device, I get the following error in the radius.log:

*Sun Feb 23 17:24:53 2025 : ERROR: (33) mschap: ERROR: Program returned code (1) and output ''*
*Sun Feb 23 17:24:53 2025 : Auth: (33)   Login incorrect (mschap: Program returned code (1) and output ''): [username/<via Auth-Type = eap>] (from client AP_name port 0 via TLS tunnel)*
*Sun Feb 23 17:24:53 2025 : Auth: (34) Login incorrect (eap_peap: The users session was previously rejected: returning reject (again.)): [username/<via Auth-Type = eap>] (from client AP_name port 1 cli 80-86-D9-4B-F8-16)*
(username and AP_name are vars for the obfuscated original values)

When I stop freeradius (via systemd) and start it manually by freeradius -f,
everything works like a charm and all my clients are authenticated.

When freeradius is started (doesn’t matter which way), I get the following output:
ber_get_next failed, errno=11.

When starting with systemd, the output of systemctl status freeradius.service looks like:

â—Ź freeradius.service - FreeRADIUS multi-protocol policy server
     Loaded: loaded (/lib/systemd/system/freeradius.service; enabled; preset: enabled)
     Active: active (running) since Sun 2025-02-23 17:33:50 CET; 5min ago
       Docs: man:radiusd(8)
             man:radiusd.conf(5)
             http://wiki.freeradius.org/
             http://networkradius.com/doc/
    Process: 630277 ExecStartPre=/usr/sbin/freeradius $FREERADIUS_OPTIONS -Cx -lstdout (code=exited, status=0/SUCCESS)
   Main PID: 630278 (freeradius)
     Status: "Processing requests"
      Tasks: 6 (limit: 9432)
     Memory: 89.2M (limit: 2.0G)
        CPU: 1.217s
     CGroup: /system.slice/freeradius.service
             └─630278 /usr/sbin/freeradius -f

Feb 23 17:33:50 hostname freeradius[630277]: Compiling Post-Auth-Type REJECT for attr Post-Auth-Type
Feb 23 17:33:50 hostname freeradius[630277]: Compiling Autz-Type Status-Server for attr Autz-Type
Feb 23 17:33:50 hostname freeradius[630277]: radiusd: #### Skipping IP addresses and Ports ####
Feb 23 17:33:50 hostname freeradius[630277]: Configuration appears to be OK
Feb 23 17:33:50 hostname freeradius[630278]: ber_get_next failed, errno=11.
Feb 23 17:33:50 hostname freeradius[630278]: ber_get_next failed, errno=11.
Feb 23 17:33:50 hostname freeradius[630278]: ber_get_next failed, errno=11.
Feb 23 17:33:50 hostname freeradius[630278]: ber_get_next failed, errno=11.
Feb 23 17:33:50 hostname freeradius[630278]: ber_get_next failed, errno=11.
Feb 23 17:33:50 hostname systemd[1]: Started freeradius.service - FreeRADIUS multi-protocol policy server.

As a workaround (in order to keep my users connected) I start freeradius manually by issuing: freeradius -f &
This way everything seems to work.

The problem appeared after the upgrade to 5.2.0. All packages are up2date.

Maybe someone got similar problems and has a hint for me.
Thanks in advance.

1 Like

Thanks for your solution with the start mode of freeradius.

I can confirm the same behaviour here, connecting isn’t possible, but when freeradius is started manually from the CLI freeradius -f & it works.

Error log:

Mon Feb 10 08:35:35 2025 : ERROR: (1664) mschap: ERROR: Program returned code (1) and output ''
Mon Feb 10 08:35:35 2025 : Auth: (1664)   Login incorrect (mschap: Program returned code (1) and output ''): [USERNAME/<via Auth-Type = eap>] (from client zar2 port 0 via TLS tunnel)
Mon Feb 10 08:35:35 2025 : Auth: (1665) Login incorrect (eap_peap: The users session was previously rejected: returning reject (again.)): [USERNAME/<via Auth-Type = eap>] (from client zar2 port 406115 cli 2c-33-58-4e-12-95)

Hallo!
Wir haben das selbe Problem, es scheint an einem Schutzmechnismus von der systemd Unit-File zu liegen. Ich bin jetzt leider nicht dazugekommen, herauszubekommen, welcher oder warum - aber hier unser Workaround:

  • systemctl edit freeradius
### Anything between here and the comment below will become the new contents of the file"
[Service]
NoNewPrivileges=false
PrivateTmp=false
ProtectControlGroups=false
ProtectKernelModules=false
ProtectKernelTunables=false
SystemCallArchitectures=
ReadOnlyDirectories=
ReadWriteDirectories=
AmbientCapabilities=
MemoryLimit=infinity
### Lines below this comment will be discarded
  • systemctl stop freeradius.service && systemctl start freeradius

Das ganze sollte natĂĽrlich wieder entfernt werden, sobald das Problem richtig von Univention addressiert wurde - aber aktuell funktioniert es zumindest fĂĽr uns.

LG

1 Like

Thank you for your hint.
I’ve tested a bit with the different options and values and came to the conclusion, that already

AmbientCapabilities=CAP_DAC_OVERRIDE

solves the problem. So the rest of the options could be left with default settings.
So it could be a permission problem when starting freeradius via systemd.

During various service-restarts I noticed the following messages:

Mär 17 12:08:51 hostname freeradius[2606397]: Configuration appears to be OK
Mär 17 12:08:51 hostname freeradius[2606398]: ber_get_next failed, errno=11.
Mär 17 12:08:51 hostname freeradius[2606398]: ber_get_next failed, errno=11.
Mär 17 12:08:51 hostname freeradius[2606398]: ber_get_next failed, errno=11.
Mär 17 12:08:51 hostname freeradius[2606398]: ber_get_next failed, errno=11.
Mär 17 12:08:51 hostname freeradius[2606398]: ber_get_next failed, errno=11.
Mär 17 12:08:51 hostname systemd[1]: Started freeradius.service - FreeRADIUS multi-protocol policy server.

and

Unit uses MemoryLimit=; please use MemoryMax= instead. Support for MemoryLimit= will be removed soon.

The first one showed up even if freeradius was started manually. The seconed one is more of an information about an upcoming change.
So both of them shouldn’t have to do with the problem itself.

2 Likes

Könnte es vielleicht sein, dass dem User freerad nicht erlaubt ist anfragen zu stellen?
Sonst wĂĽrde ja die Nutzung im Debug-Modus ja auch nicht funktionieren!
Habe das selbe Problem nach dem Update auf die neueste Version.
LG

Der Dienst läuft über systemd mit dem User freerad.

:~# ps axu | grep radius
freerad   520400  0.0  1.4 524860 115028 ?       Ssl  05:55   0:00 /usr/sbin/freeradius -f

Da es mit der oben beschriebenen Änderung

AmbientCapabilities=CAP_DAC_OVERRIDE

mittles systemctl edit freeradius funktioniert, scheint es sich um ein Berechtigungsproblem (Zugriff auf bestimmte Dateien) zu handeln.
Welche Dateien das genau sind könnte man evtl. mittels aktivem auditd versuchen zu ermitteln.

Da fĂĽr mich der beschriebene Workaround funktioniert, habe ich vorerst nicht weiter geforscht. Ich hoffe erstmal weiterhin auf einen Fix seitens UCS :crossed_fingers:

I just experienced this problem after updating. For me in the /etc/freeradius/3.0/ directory some files, directories, symlinks had had their permissions updated to root:root instead of the freeradius user and group which explains why running freeradius -X works as root but not as the freeradius service/user.

I CD’d to that directory and just ran chown freerad:freerad on each file and directory that was set up with root as owner or group and then restarted freeradius and that solved my problem.

Same issue here :frowning_face:

Changing freeradius.service with

AmbientCapabilities=CAP_DAC_OVERRIDE

fixed the issue.

1 Like

I have just updated to UCS version is 5.2-1 errata107
And can indeed confirm this breaks radius.

Your workarround works perfectly, thanks for suggesting that !
freeradius -f &
All the best from Australia

A change to the service is not normally necessary. I checked the file permissions. One file had incorrect permissions. After correcting this, radius worked normally again.

-rw------- 1 root nogroup 537 26. Dez 2023  /etc/freeradius/3.0/ldap-groups-attrs.conf
chgrp freerad /etc/freeradius/3.0/ldap-groups-attrs.conf
chmod 640 /etc/freeradius/3.0/ldap-groups-attrs.conf
systemctl start freeradius.service

I don’t have this file /etc/freeradius/3.0/ldap-groups-attrs.conf and therefore I can’t confirm that this solves the problem too. But for sure it’s a permission problem (AmbientCapabilities=CAP_DAC_OVERRIDE should allow ignoring the permissions - for this reason it works if set, even if the permissions are not set correctly).
Could anyone show up, what the permissions for the files in the folder
/etc/freeradius/3.0/ should be?

My folder looks like this:

:~# ls -l /etc/freeradius/3.0/
insgesamt 208
drwxr-xr-x  2 freerad freerad  4096 22. Feb 17:45 certs
-rw-r-----  1 freerad freerad  8010 23. Feb 16:52 clients.conf
-rw-r-----  1 freerad freerad  8323 19. Aug 2023  clients.conf.dpkg-dist
-rw-r--r--  1 root    root     1408 27. Feb 2019  clients.conf.example
-rw-------  1 freerad root      361 22. Feb 18:01 clients.univention.conf
-rw-r-----  1 freerad freerad  1420 19. Aug 2023  dictionary
-rw-r-----  1 freerad freerad  2661 27. Nov 2017  experimental.conf
lrwxrwxrwx  1 root    root       28 19. Aug 2023  hints -> mods-config/preprocess/hints
lrwxrwxrwx  1 root    root       33 19. Aug 2023  huntgroups -> mods-config/preprocess/huntgroups
drwxr-xr-x  2 freerad freerad  4096 25. Mai 05:55 mods-available
drwxr-xr-x 11 freerad freerad  4096 22. Feb 17:45 mods-config
drwxr-xr-x  2 freerad freerad  4096  8. Mär 11:23 mods-enabled
-rw-r-----  1 freerad freerad    52 27. Nov 2017  panic.gdb
drwxr-xr-x  2 freerad freerad  4096 22. Feb 17:51 policy.d
-rw-r-----  1 root    freerad   488 22. Feb 17:51 proxy.conf
-rw-r-----  1 freerad freerad 29206 19. Aug 2023  proxy.conf.debian
-rw-r-----  1 root    freerad 31470 22. Feb 18:01 radiusd.conf
-rw-r-----  1 freerad freerad 30773 19. Aug 2023  radiusd.conf.debian
-rw-r-----  1 freerad freerad 20754 19. Aug 2023  README.rst
drwxr-xr-x  2 freerad freerad  4096 22. Feb 17:51 sites-available
drwxr-xr-x  2 freerad freerad  4096 22. Feb 17:44 sites-enabled
-rw-r-----  1 freerad freerad  3470 27. Nov 2017  templates.conf
-rw-r-----  1 freerad freerad  8536 27. Nov 2017  trigger.conf
lrwxrwxrwx  1 root    root       27 19. Aug 2023  users -> mods-config/files/authorize

Had to do this this morning too. Wi-Fi wasn’t working for any users. Must be a cache or something that expired… Strange.