You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "who.cat" <wh...@qq.com> on 2017/02/22 09:07:24 UTC

agent status_command can not get the component configurations

Hi all
Adding a cusom services on Ambari all works well except status checking.The details is the  agent could not get the component from 
the 'status_params.py' which revoked as  'status_params.config['configurations']['config-name']['atrribute name'] .The error is :
----------error message start--------------------------
 File "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/format.py", line 95, in format
    return ConfigurationFormatter().format(format_string, args, **result)
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/format.py", line 59, in format
    result_protected = self.vformat(format_string, args, all_params)
  File "/usr/lib64/python2.7/string.py", line 549, in vformat
    result = self._vformat(format_string, args, kwargs, used_args, 2)
  File "/usr/lib64/python2.7/string.py", line 582, in _vformat
    result.append(self.format_field(obj, format_spec))
  File "/usr/lib64/python2.7/string.py", line 599, in format_field
    return format(value, format_spec)
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/config_dictionary.py", line 73, in __getattr__
    raise Fail("Configuration parameter '" + self.name + "' was not found in configurations dictionary!")
Fail: Configuration parameter 'config-name' was not found in configurations dictionary!
---------error message end--------------------------
I added a print statement like  'print status_params.config['configurations']['config-name']['atrribute name']', during the service installation it printed the valued correctly but in the status check it shows the error above .
My meteainfo.xml had added the the configuation in <configfies>mark ,like this :
<configFiles>
    <configFile>
        <type>xml</type>
        <fileName>config.cnf</fileName>
        <dictionaryName>config.cnf</dictionaryName>
    </configFile>
</configFiles>How can  solve the prolem ,anyone any ideas must be thankful!Best  regards.

Re: agent status_command can not get the component configurations

Posted by "who.cat" <wh...@qq.com>.
got the case .the config file must be named as "service-name-env".


------------------ Original ------------------
From:  "who.cat";<wh...@qq.com>;
Date:  Wed, Feb 22, 2017 05:07 PM
To:  "dev"<de...@ambari.apache.org>; 

Subject:  agent status_command  can not get the component configurations



Hi all
Adding a cusom services on Ambari all works well except status checking.The details is the  agent could not get the component from 
the 'status_params.py' which revoked as  'status_params.config['configurations']['config-name']['atrribute name'] .The error is :
----------error message start--------------------------
 File "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/format.py", line 95, in format
    return ConfigurationFormatter().format(format_string, args, **result)
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/format.py", line 59, in format
    result_protected = self.vformat(format_string, args, all_params)
  File "/usr/lib64/python2.7/string.py", line 549, in vformat
    result = self._vformat(format_string, args, kwargs, used_args, 2)
  File "/usr/lib64/python2.7/string.py", line 582, in _vformat
    result.append(self.format_field(obj, format_spec))
  File "/usr/lib64/python2.7/string.py", line 599, in format_field
    return format(value, format_spec)
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/config_dictionary.py", line 73, in __getattr__
    raise Fail("Configuration parameter '" + self.name + "' was not found in configurations dictionary!")
Fail: Configuration parameter 'config-name' was not found in configurations dictionary!
---------error message end--------------------------
I added a print statement like  'print status_params.config['configurations']['config-name']['atrribute name']', during the service installation it printed the valued correctly but in the status check it shows the error above .
My meteainfo.xml had added the the configuation in <configfies>mark ,like this :
<configFiles>
    <configFile>
        <type>xml</type>
        <fileName>config.cnf</fileName>
        <dictionaryName>config.cnf</dictionaryName>
    </configFile>
</configFiles>How can  solve the prolem ,anyone any ideas must be thankful!Best  regards.