File module processing error "Invalid operator"
Hi, I am seeing "Invalid operator" error on a file module. # /usr/sbin/radiusd -X Info : Copyright 1999-2023 The FreeRADIUS server project and contributors Info : There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A Info : PARTICULAR PURPOSE Info : You may redistribute copies of FreeRADIUS under the terms of the Info : GNU General Public License Info : For more information about these matters, see the file named COPYRIGHT Info : Starting - reading configuration files ... Debug : Including dictionary file "/etc/raddb/dictionary" Debug : including configuration file /etc/raddb/radiusd.conf Debug : Including files in directory "/etc/raddb/template.d/" Debug : including configuration file /etc/raddb/template.d/default Debug : including configuration file /etc/raddb/clients.conf Debug : Including files in directory "/etc/raddb/global.d/" Debug : including configuration file /etc/raddb/global.d/ldap Debug : Including files in directory "/etc/raddb/mods-enabled/" Debug : including configuration file /etc/raddb/mods-enabled/always Debug : including configuration file /etc/raddb/mods-enabled/files Debug : including configuration file /etc/raddb/mods-enabled/ldap Debug : including configuration file /etc/raddb/mods-enabled/linelog_dhcp Debug : including configuration file /etc/raddb/mods-enabled/redis Debug : including configuration file /etc/raddb/mods-enabled/redis_ippool Debug : including configuration file /etc/raddb/mods-enabled/unpack Debug : Including files in directory "/etc/raddb/policy.d/" ... ... Debug : rlm_redis (redis) [1] - Reserved connection (0) Debug : rlm_redis (redis) [1] - Released connection (0) Debug : Instantiating rlm_always "reject" Debug : Instantiating rlm_files "subnet_policy" Debug : Reading file /etc/raddb/mods-config/files/subnet_policies Error : /etc/raddb/mods-config/files/subnet_policies[1692]: dhcpv4.Router-Address := 25.26.0.1, Error : /etc/raddb/mods-config/files/subnet_policies[1692]: ^ Invalid operator Error : Failed reading /etc/raddb/mods-config/files/subnet_policies Error : /etc/raddb/mods-enabled/files[25]: Instantiation failed for module "subnet_policy" After removing some commented lines or adding some empty lines or empty spaces in the file module, the error goes away. pwd:/etc/raddb/mods-config/files subnet_policies is the file module which gives this error. below is the diff between the problematic file and working file. Just removed a line. # wc subnet_policies* 4438 7982 111085 subnet_policies 4439 7983 111161 subnet_policies.problem # diff subnet_policies.problem subnet_policies 1d0 < ########################################################################### Debug : rlm_redis (redis) [1] - Reserved connection (0) Debug : rlm_redis (redis) [1] - Released connection (0) Debug : Instantiating rlm_always "reject" Debug : Instantiating rlm_files "subnet_policy" Debug : Reading file /etc/raddb/mods-config/files/subnet_policies Debug : Instantiating rlm_files "subscriber_host_policy" Debug : Reading file /etc/raddb/mods-config/files/host_policies Regards, Nagamani Chinnapaiyan
On Oct 30, 2023, at 10:27 AM, Chinnapaiyan, Nagamani <nagamani.chinnapaiyan@viasat.com> wrote:
Error : /etc/raddb/mods-config/files/subnet_policies[1692]: dhcpv4.Router-Address := 25.26.0.1,
Error : /etc/raddb/mods-config/files/subnet_policies[1692]: ^ Invalid operator
You can't use "dhcpv4.Router-Address" as an attribute name. If this is for v3, you need to use the names in dictionary.dhcpv4. If this is for v4, well, that's not released yet. But you still need to use the names in the DHCP dictionaries. Alan DeKok.
Thanks Alan for the respose. Ø You can't use "dhcpv4.Router-Address" as an attribute name. Router-Address is in the dictionary. And dhcpv4.Router-Address attribute is working fine. /usr/share/freeradius/dictionary/dhcpv4/dictionary.rfc2131:ATTRIBUTE Router-Address 3 ipaddr array If the file is having few policies like below, there is no problem. i.e., no problem with the attribute name. # cat /etc/raddb/mods-config/files/subnet_policies 25.0.0.0/20 dhcpv4.Router-Address := 25.0.0.1, dhcpv4.Subnet-Mask := 255.255.240.0 25.0.16.0/20 dhcpv4.Router-Address := 25.0.16.1, dhcpv4.Subnet-Mask := 255.255.240.0 25.0.32.0/20 dhcpv4.Router-Address := 25.0.32.1, dhcpv4.Subnet-Mask := 255.255.240.0 Ø If this is for v4, well, that's not released yet. But you still need to use the names in the DHCP dictionaries. This is v4. The problem is observed when I have 1000s of entries in the subnet_policies file. To solve the problem, I just need to add one/two spaces anywhere in the file. The problem for me is this file is dynamically updated, and this magic random error likely to appear during the update. It will need manual intervention to add/delete one or two spaces/empty_lines in the file when error happens. Regards, Nagamani Chinnapaiyan
On Oct 30, 2023, at 9:22 PM, Chinnapaiyan, Nagamani <Nagamani.Chinnapaiyan@viasat.com> wrote:
The problem is observed when I have 1000s of entries in the subnet_policies file. To solve the problem, I just need to add one/two spaces anywhere in the file.
That's a fairly weird issue.
The problem for me is this file is dynamically updated, and this magic random error likely to appear during the update. It will need manual intervention to add/delete one or two spaces/empty_lines in the file when error happens.
Send one of the broken files to me off-list, and I'll take a look. Alan DeKok.
participants (2)
-
Alan DeKok -
Chinnapaiyan, Nagamani