Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-19023

After adding an Atlas server the first restart command fails since stop doesn't have any configs; if no pid dir exists during stop, perform no-op

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.4.0
    • 2.5.0
    • stacks
    • None

    Description

      Whenever adding an Atlas Server on a host, if the user executes the first command as a "restart" (stop+start) instead of a "start" command, then the stop command will fail because Ambari will not have generated any configs yet so Atlas' atlas_stop.py will fail.

      To fix it, during a stop command,
      If the pid dir doesn't exist, this means either
      1. The user just added Atlas service and issued a restart command (stop+start). So stop should be a no-op since there's nothing to stop because the pid dir does not exist.

      OR

      2. The user changed the value of the pid dir config and incorrectly issued a restart command.
      In which case the stop command cannot do anything since Ambari doesn't know which process to kill.
      The start command will spawn another instance.
      The user should have issued a stop, changed the config, and then started it.

      Ambari generated this error.

      Traceback (most recent call last):
        File "/var/lib/ambari-agent/cache/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py", line 199, in <module>
          MetadataServer().execute()
        File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in execute
          method(env)
        File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 685, in restart
          self.stop(env, upgrade_type=upgrade_type)
        File "/var/lib/ambari-agent/cache/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py", line 95, in stop
          user=params.metadata_user,
        File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 155, in __init__
          self.env.run()
        File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
          self.run_action(resource, action)
        File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
          provider_action()
        File "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py", line 273, in action_run
          tries=self.resource.tries, try_sleep=self.resource.try_sleep)
        File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 71, in inner
          result = function(command, **kwargs)
        File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 93, in checked_call
          tries=tries, try_sleep=try_sleep)
        File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 141, in _call_wrapper
          result = _call(command, **kwargs_copy)
        File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 294, in _call
          raise Fail(err_msg)
      resource_management.core.exceptions.Fail: Execution of 'source /etc/atlas/conf/atlas-env.sh; /usr/hdp/current/atlas-server/bin/atlas_stop.py' returned 255.
      Exception: [Errno 13] Permission denied: '/usr/hdp/2.5.0.0-1169/atlas/logs' 
      Traceback (most recent call last):
        File "/usr/hdp/current/atlas-server/bin/atlas_stop.py", line 68, in <module>
          returncode = main()
        File "/usr/hdp/current/atlas-server/bin/atlas_stop.py", line 31, in main
          mc.dirMustExist(mc.logDir(atlas_home))
        File "/usr/hdp/2.5.0.0-1169/atlas/bin/atlas_config.py", line 147, in dirMustExist
          os.mkdir(dirname)
      OSError: [Errno 13] Permission denied: '/usr/hdp/2.5.0.0-1169/atlas/logs'
      

      Attachments

        1. AMBARI-19023.patch
          3 kB
          Alejandro Fernandez

        Issue Links

          Activity

            People

              afernandez Alejandro Fernandez
              afernandez Alejandro Fernandez
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: