Bug #14806
closedFreeradius configuration lost when you reinstall package
100%
Description
I did a simple freeradius configuration and entered a user.
If I reinstall freeradius from the package manager I lose the entire freeradius configuration, including users.
this is the output of the reinstallation of the package:
>>> Upgrading pfSense-pkg-freeradius3... Updating pfSense-core repository catalogue... pfSense-core repository is up to date. Updating pfSense repository catalogue... pfSense repository is up to date. All repositories are up to date. Checking integrity... done (0 conflicting) The following 1 package(s) will be affected (of 0 checked): Installed packages to be REINSTALLED: pfSense-pkg-freeradius3-0.15.10 [pfSense] Number of packages to be reinstalled: 1 [1/1] Reinstalling pfSense-pkg-freeradius3-0.15.10... [1/1] Extracting pfSense-pkg-freeradius3-0.15.10: .......... done Removing freeradius3 components... Menu items... done. Services... done. Loading package instructions... Deinstall commands... done. Saving updated package information... overwrite! Loading package configuration... done. Configuring package components... Loading package instructions... Custom commands... Executing custom_php_install_command()...done. Executing custom_php_resync_config_command()...done. Menu items... done. Services... done. Writing configuration... done. >>> Cleaning up cache... done. Success
after this I no longer have any configuration on freeradius
Related issues
Updated by Kris Phillips over 1 year ago
- Affected Plus Version set to 23.09
Tested this on the latest 23.09 builds. Even with "Save settings after deletion" checked, all settings are erased on reinstall. Confirmed bug.
Updated by Jim Pingle over 1 year ago
I can't replicate this here but I can see how it might have happened.
If you never went to the Settings tab and clicked Save there, then the tag for keep_settings
wouldn't be present in the configuration.
When this package was updated for PHP 8.x, it changed like so:
- if (isset($config['installedpackages']['freeradiussettings']['config'][0]['keep_settings']) &&
- empty($config['installedpackages']['freeradiussettings']['config'][0]['keep_settings'])) {
+ if (!config_path_enabled('installedpackages/freeradiussettings/config/0/', 'keep_settings')) {
Those two tests aren't equivalent. The first tests that the tag is there at all, the second tests if it's empty or not. The new test only checks if the tag is present, which isn't sufficient.
For the old test to be true it had to be present in the config but empty, which means someone saved the settings with that option unchecked. Now it's happening both when that is true and when it's unset, which is also the case if someone had never saved the main settings tab, which shouldn't be needed if the default settings are OK.
Updated by Jim Pingle over 1 year ago
- Status changed from Confirmed to In Progress
- Assignee set to Jim Pingle
Updated by Jim Pingle over 1 year ago
- Related to Bug #14596: FreeRADIUS falsely shows its default is to save data during package reinstall added
Updated by Jim Pingle over 1 year ago
- Status changed from In Progress to Feedback
- % Done changed from 0 to 100
- Affected Plus Version changed from 23.09 to 23.05.1
Fix committed and picked back to CE 2.7.0 and Plus 23.05.1
https://github.com/pfsense/FreeBSD-ports/commit/004892778ef6d5f25661295e2a8e9cb397687b1f
Updated by Paolo Rosso over 1 year ago
I confirm that the <keep_settings> tag is not present in my config.xml.
After entering settings and saving, the <keep_settings> tag appeared on config.xml: value "on" when "Save settings after deletion" is checked, value "" when it is unchecked.
By reinstalling the freeradius package with <keep_settings>on</keep_settings> the configuration was not lost.
Updated by Jim Pingle over 1 year ago
Paolo Rosso wrote in #note-7:
I confirm that the <keep_settings> tag is not present in my config.xml.
After entering settings and saving, the <keep_settings> tag appeared on config.xml: value "on" when "Save settings after deletion" is checked, value "" when it is unchecked.By reinstalling the freeradius package with <keep_settings>on</keep_settings> the configuration was not lost.
The package available on Plus 23.05.1, CE 2.7.0 was fixed yesterday and if you reinstalled after my last update yesterday then it would have worked properly no matter how you had it set. So if you want to try it again without the main settings present, it should have the proper behavior now.
Updated by aleksei prokofiev over 1 year ago
Tested on
23.05.1-RELEASE (amd64)
built on Wed Jun 28 03:57:27 UTC 2023
FreeBSD 14.0-CURRENT
freeradius3 0.15.10_1
After uninstalling/reinstalling freeradius, I can confirm that the settings are not deleted and are retained.