Project

General

Profile

Bug #25150

Updated by Marco Mambelli 3 months ago

The items specified as "attr" in the Frontend and Factory configuration are called internally (in the code) parameters (params) if they can change (const=False) and attributes (attrs) if they are constant (const=True, cannot be overridden).
They end up in descript.xml in the entries directories, in the attributes and params sections of the file.

Some parameters in the Factory are set to default values and they cannot be changed in the configuration (creation/lib/cgWParamDict.py): configuration:
<pre>
class glideinMainDicts(cgWDictFile.glideinMainDicts):
...
def populate(self, other=None):
...
# add the basic standard params
self.dicts['params'].add("GLIDEIN_Report_Failed", 'NEVER')
self.dicts['params'].add("CONDOR_OS", 'default')
self.dicts['params'].add("CONDOR_ARCH", 'default')
self.dicts['params'].add("CONDOR_VERSION", 'default')
</pre>

The error you see during the Factory upgrade is
<pre>
# faupgrade
Using default factory config file: /etc/gwms-factory/glideinWMS.xml
Error parsing attr main[CONDOR_VERSION]: Key 'CONDOR_VERSION' already exists
Upgrading the factory [FAILED]
</pre>

Changing the code you can see the stack trace and the cause:
<pre>
# su -c 'reconfig_glidein -force_name "gfactory_instance" -writeback yes -update_scripts yes -xml "/etc/gwms-factory/glideinWMS.xml" -fix_rrd -verbose' - gfactory
MMDB: overwriting key not allowed CONDOR_OS default -> rhel7
Traceback (most recent call last):
File "/usr/sbin/reconfig_glidein", line 278, in <module>
main(conf, update_scripts, update_def_cfg, comment=comment)
File "/usr/sbin/reconfig_glidein", line 98, in main
glidein_dicts_obj.populate(old_glidein_dicts_obj)
File "/usr/lib/python2.7/site-packages/glideinwms/creation/lib/cgWParamDict.py", line 621, in populate
self.main_dicts.populate(other)
File "/usr/lib/python2.7/site-packages/glideinwms/creation/lib/cgWParamDict.py", line 283, in populate
add_attr_unparsed(attr, self.dicts, "main")
File "/usr/lib/python2.7/site-packages/glideinwms/creation/lib/cgWParamDict.py", line 782, in add_attr_unparsed
add_attr_unparsed_real(attr, dicts)
File "/usr/lib/python2.7/site-packages/glideinwms/creation/lib/cgWParamDict.py", line 816, in add_attr_unparsed_real
dicts['params'].add(attr_name, attr_val)
File "/usr/lib/python2.7/site-packages/glideinwms/creation/lib/cWDictFile.py", line 103, in add
raise ImportError("Key '%s' already exists" % key)
ImportError: Key 'CONDOR_OS' already exists
</pre>

There is the additional complication that if an attribute in the configuration is changed from constant to variable (or vice versa), then there are 2 copies of the same attribute/parameter, one in attributes, one in params.
<pre>
/var/lib/gwms-factory/work-dir/entry_ITB_FC_CE2/monitor/descript.xml: <attributes CONDOR_VERSION="8.9.9" GLEXEC_JOB="False" GLIDEIN_Downtime_Comment="" GLIDEIN_Gatekeeper="fermicloud025.fnal.gov fermicloud025.fnal.gov:9619" GLIDEIN_GlobusRSL="" GLIDEIN_GridType="condor" GLIDEIN_REQUIRE_GLEXEC_USE="False" GLIDEIN_REQUIRE_VOMS="False" GLIDEIN_SINGULARITY_REQUIRE="PREFERRED" GLIDEIN_Site="ITB_FC_CE2" GLIDEIN_SlotsLayout="fixed" GLIDEIN_SupportedAuthenticationMethod="grid_proxy" GLIDEIN_TrustDomain="grid" GLIDEIN_Verbosity="std" GLIDEIN_WorkDir="OSG" USE_CCB="True" USE_MATCH_AUTH="True"/>
/var/lib/gwms-factory/work-dir/entry_ITB_FC_CE2/monitor/descript.xml: <params CONDOR_ARCH="default" CONDOR_OS="rhel7" CONDOR_VERSION="default" GLIDEIN_Collector="Fake" GLIDEIN_Report_Failed="NEVER"/>
</pre>

The goal is to clarify the behavior and allow changes when those should be possible (or is expected by the operators).

Back