Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Ambari 2.7.3 Failure at Activity Analyzer Install

avatar
New Contributor

I am trying to deploy a HDP cluster with ambari. I met an error when deploying
It reported the error: 

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stack-hooks/before-INSTALL/scripts/hook.py", line 37, in <module>
    BeforeInstallHook().execute()
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 352, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/stack-hooks/before-INSTALL/scripts/hook.py", line 33, in hook
    install_packages()
  File "/var/lib/ambari-agent/cache/stack-hooks/before-INSTALL/scripts/shared_initialization.py", line 37, in install_packages
    retry_count=params.agent_stack_retry_count)
  File "/usr/lib/ambari-agent/lib/resource_management/core/base.py", line 125, in __new__
    cls(names_list.pop(0), env, provider, **kwargs)
  File "/usr/lib/ambari-agent/lib/resource_management/core/base.py", line 166, in __init__
    self.env.run()
  File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/ambari-agent/lib/resource_management/core/providers/packaging.py", line 30, in action_install
    self._pkg_manager.install_package(package_name, self.__create_context())
  File "/usr/lib/ambari-agent/lib/ambari_commons/repo_manager/yum_manager.py", line 211, in install_package
    elif context.is_upgrade or context.use_repos or not self._check_existence(name):
  File "/usr/lib/ambari-agent/lib/ambari_commons/repo_manager/yum_manager.py", line 278, in _check_existence
    return self.yum_check_package_available(name)
  File "/usr/lib/ambari-agent/lib/ambari_commons/repo_manager/yum_manager.py", line 293, in yum_check_package_available
    package_list = yb.rpmdb.simplePkgList()
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1083, in <lambda>
    rpmdb = property(fget=lambda self: self._getRpmDB(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 648, in _getRpmDB
    self._rpmdb = rpmsack.RPMDBPackageSack(root=self.conf.installroot,
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1079, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 386, in _getConfig
    startupconf.pluginconfpath,disabled_plugins,enabled_plugins)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 630, in doPluginSetup
    plugin_types, confpath, disabled_plugins, enabled_plugins)
  File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 166, in __init__
    self.run('config')
  File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 188, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/langpacks.py", line 205, in config_hook
    (lang, encoding) = locale.getdefaultlocale()
  File "/usr/lib64/python2.7/locale.py", line 511, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib64/python2.7/locale.py", line 443, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

 

Anyone can help me to fix this problem? thank you much!

1 ACCEPTED SOLUTION

avatar
Master Collaborator

@khaihustict Add the following under bashrc profile:

export LANG="en_US.UTF-8"

export LC_COLLATE="en_US.UTF-8"

export LC_CTYPE="en_US.UTF-8"

export LC_MESSAGES="en_US.UTF-8"

export LC_MONETARY="en_USUTF-8"

export LC_NUMERIC="en_US.UTF-8"

export LC_TIME="en_US.UTF-8"

export LC_ALL=

 

Sourced this and then restart the ambari-agent 

View solution in original post

3 REPLIES 3

avatar
Master Collaborator

@khaihustict Add the following under bashrc profile:

export LANG="en_US.UTF-8"

export LC_COLLATE="en_US.UTF-8"

export LC_CTYPE="en_US.UTF-8"

export LC_MESSAGES="en_US.UTF-8"

export LC_MONETARY="en_USUTF-8"

export LC_NUMERIC="en_US.UTF-8"

export LC_TIME="en_US.UTF-8"

export LC_ALL=

 

Sourced this and then restart the ambari-agent 

avatar
New Contributor

I have overcome this problem, but I met another one. On ambari-metric-collector installing task:
It reports: 

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/AMBARI_METRICS/package/scripts/metrics_collector.py", line 90, in <module>
    AmsCollector().execute()
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 352, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/AMBARI_METRICS/package/scripts/metrics_collector.py", line 36, in install
    self.install_packages(env)
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 849, in install_packages
    retry_count=agent_stack_retry_count)
  File "/usr/lib/ambari-agent/lib/resource_management/core/base.py", line 166, in __init__
    self.env.run()
  File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/ambari-agent/lib/resource_management/core/providers/packaging.py", line 30, in action_install
    self._pkg_manager.install_package(package_name, self.__create_context())
  File "/usr/lib/ambari-agent/lib/ambari_commons/repo_manager/yum_manager.py", line 219, in install_package
    shell.repository_manager_executor(cmd, self.properties, context)
  File "/usr/lib/ambari-agent/lib/ambari_commons/shell.py", line 753, in repository_manager_executor
    raise RuntimeError(message)
RuntimeError: Failed to execute command '/usr/bin/yum -y install ambari-metrics-collector', exited with code '1', message: 'Failed to set locale, defaulting to C

 What is the problem? Do you know how to fix this? 

avatar
Master Collaborator

@khaihustict  Can you confirm is this failing on the same host, Can you try adding the below lines in  bashrc profile: 

 

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_COLLATE=C
export LC_CTYPE=en_US.UTF-8