Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0C9F7200D26 for ; Fri, 20 Oct 2017 19:07:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0B195160BCB; Fri, 20 Oct 2017 17:07:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 00F811609ED for ; Fri, 20 Oct 2017 19:07:55 +0200 (CEST) Received: (qmail 20257 invoked by uid 500); 20 Oct 2017 17:07:55 -0000 Mailing-List: contact user-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ambari.apache.org Delivered-To: mailing list user@ambari.apache.org Received: (qmail 20247 invoked by uid 99); 20 Oct 2017 17:07:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Oct 2017 17:07:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3C58B1805B5 for ; Fri, 20 Oct 2017 17:07:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id OAto-KIlHS2B for ; Fri, 20 Oct 2017 17:07:52 +0000 (UTC) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id A7B325F238 for ; Fri, 20 Oct 2017 17:07:51 +0000 (UTC) Received: by mail-lf0-f46.google.com with SMTP id b190so13876391lfg.9 for ; Fri, 20 Oct 2017 10:07:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=SjS5eD2md0vo/BnnmU9kkvf1E+oQV6lxa6CBTNl7npY=; b=enR2B88NRA7Xfd0YFGg1P5C3EEGCB3XuuB+81vAfD5XmX1V3JK9eLWAMFBKNnOXQ2P q/jAcR9PxEM8u2R9EXwedxanHWBWsgnl0kbvPzRB6p22m4H2vLqz+mhQG8/LLYROibIG oWA2MUrrJyh5ZtTnA+mFgxo6y9LBrB4f6f0Se1JoX8McW9MFCm5RXvpqX2esJT/+zKSN OvJSi72El0wdDfEHVndlB8edMGGXvSB1xuYJOebOpQ2msBbx7xqNJNdm8TENJnnVHR64 t1omZHP5RxjCOpOqSiwHFzHB31Mcf6t6yo2k1T0YehWpXhB171Qr6R6dvRAenxyF3u0P EiPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=SjS5eD2md0vo/BnnmU9kkvf1E+oQV6lxa6CBTNl7npY=; b=lvyvGribA20kPfp6KJuOi8HDRHgcbgQTv9afPznbAEajMj7CdrL6n0mPqjsdeSyayU B6fVLDBFMmJOmMQxb6zh347pqc8NgBPeX1kDjqs6jE77QC5Z/G3IgcImXCZWWqTevkOI ZowJUtsM61uGKs+1jmm5kUiEQACB/y258VpzRfD3zF+qZRpqV8avud4k/y7bcvHMuIOK dSTgP0iInFhYM89d8UJSHtKgz42d9bAOBpf/UdHdbq1AiHBNc6eBSGQovdh4LiIzNwFR Qfu3GxingNOdkub2onuWDvNswV6EUV2sK+NoqCtbylfBMbNcwU2Wnb0Gq4lGHn9GQzz3 2fqQ== X-Gm-Message-State: AMCzsaVIRWfkrCDIVrYI5/fUbQaTYLhYRthKdBwxg+XV4Uw2tz0jJFBB /FKH/7BY3x7iGdgYZqJszm8EhdvUMngqwtYE3tfzFQ== X-Google-Smtp-Source: ABhQp+QrSYMW8ys5g10PVPPHwD3ZLtYv138mv/t01Gdcmxpp3TJZqrQYmZcxqlwztGx9UfivzdtDadVFK/E/gYs+8m8= X-Received: by 10.25.156.66 with SMTP id f63mr1970576lfe.194.1508519270751; Fri, 20 Oct 2017 10:07:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.92.4 with HTTP; Fri, 20 Oct 2017 10:07:49 -0700 (PDT) In-Reply-To: References: From: Gonzalo Herreros Date: Fri, 20 Oct 2017 18:07:49 +0100 Message-ID: Subject: Re: Why hook is executed when installing custom service To: user@ambari.apache.org Content-Type: multipart/alternative; boundary="001a11411bc645242c055bfd8384" archived-at: Fri, 20 Oct 2017 17:07:57 -0000 --001a11411bc645242c055bfd8384 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable As the name implies, those hooks trigger on any component installation. However if you see that line source, it should not execute unless you have the Ranger Admin component in the cluster. If you do have Ranger installed, then it should have the ranger-env set, have a look or delete and reinstall the service. It's also possible your component configurations overrides other services, double check your service configurations folder. Or than your service has a component that makes ambari think Ranger is installed. Regards, Gonzalo On 20 October 2017 at 17:12, Markovich wrote: > Hello everyone! > > I'm creating a custom service, when Ambari is going to install my service > it's trying to execute some hook from HDP 2.0.6. And in this hook there i= s > hardcoded ranger-env propertie. > > Why my service triggers this hook? > What can be done to avoid this? > > Regards, > Andrey > > Here is some logs from my service install. My python script isn't being > triggered... > > stderr: /var/lib/ambari-agent/data/errors-406.txt > > Traceback (most recent call last): > File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scr= ipts/hook.py", line 35, in > BeforeAnyHook().execute() > File "/usr/lib/python2.6/site-packages/resource_management/libraries/sc= ript/script.py", line 329, in execute > method(env) > File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scr= ipts/hook.py", line 26, in hook > import params > File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scr= ipts/params.py", line 254, in > user_to_groups_dict[ranger_user] =3D [ranger_group] > File "/usr/lib/python2.6/site-packages/resource_management/libraries/sc= ript/config_dictionary.py", line 73, in __getattr__ > raise Fail("Configuration parameter '" + self.name + "' was not found= in configurations dictionary!") > resource_management.core.exceptions.Fail: Configuration parameter 'ranger= -env' was not found in configurations dictionary! > Error: Error: Unable to run the custom hook script ['/usr/bin/python', '/= var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.p= y', 'ANY', '/var/lib/ambari-agent/data/command-406.json', '/var/lib/ambari-= agent/cache/stacks/HDP/2.0.6/hooks/before-ANY', '/var/lib/ambari-agent/data= /structured-out-406.json', 'INFO', '/var/lib/ambari-agent/tmp', 'PROTOCOL_T= LSv1', ''] > > stdout: /var/lib/ambari-agent/data/output-406.txt > > 2017-10-20 12:07:42,825 - Stack Feature Version Info: Cluster Stack=3D2.6= , Cluster Current Version=3D2.6.2.0-205, Command Stack=3DNone, Command Vers= ion=3D2.6.2.0-205 -> 2.6.2.0-205 > 2017-10-20 12:07:42,836 - Using hadoop conf dir: /usr/hdp/current/hadoop-= client/conf > Error: Error: Unable to run the custom hook script ['/usr/bin/python', '/= var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.p= y', 'ANY', '/var/lib/ambari-agent/data/command-406.json', '/var/lib/ambari-= agent/cache/stacks/HDP/2.0.6/hooks/before-ANY', '/var/lib/ambari-agent/data= /structured-out-406.json', 'INFO', '/var/lib/ambari-agent/tmp', 'PROTOCOL_T= LSv1', ''] > > Command failed after 1 tries > > --001a11411bc645242c055bfd8384 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
As the name implies, those hooks trigger on any component = installation.
However if you see that line source, it should not e= xecute unless you have the Ranger Admin component in the cluster.

If you do have Ranger installed, then it should have the ranger-= env set, have a look or delete and reinstall the service.
It's also = possible your component configurations overrides other services, double che= ck your service configurations folder.=C2=A0
Or than your service has a= component that makes ambari think Ranger is installed.

= Regards,
Gonzalo

On 20 October 2017 at 17:12, Markovich <= amrivkin@gmail.com> wrote:
=
Hello everyone!

I'm creating a cust= om service, when Ambari is going to install my service it's trying to e= xecute some hook from HDP 2.0.6. And in this hook there is hardcoded ranger= -env propertie.

Why my service triggers this hook?=
What can be done to avoid this?

Regards= ,
Andrey

Here is some logs from my servi= ce install. My python script isn't being triggered...

stderr: =C2=A0=C2=A0/var/lib/ambari-agent/data/errors-406= .txt
Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before=
-ANY/scripts/hook.py", line 35, in <module>
    BeforeAnyHook().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 329, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before=
-ANY/scripts/hook.py", line 26, in hook
    import params
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before=
-ANY/scripts/params.py", line 254, in <module>
    user_to_groups_dict[ranger_user] =3D [ranger_group]
  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!")
resource_management.core.exceptions.Fail: Configuration parameter '=
;ranger-env' was not found in configurations dictionary!
Error: Error: Unable to run the custom hook script ['/usr/bin/python=
9;, '/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py', 'ANY', '/var/lib/ambari-agent/data/=
command-406.json', '/var/lib/ambari-agent/cache/stacks/HD=
P/2.0.6/hooks/before-ANY', '/var/lib/ambari-agent/data/st=
ructured-out-406.json', 'INFO', '/var/lib/ambari-agent/tmp&=
#39;, 'PROTOCOL_TLSv1', '']
stdout: =C2=A0=C2=A0/= var/lib/ambari-agent/data/output-406.txt
2017-10-20 12=
:07:42,825 - Stack Feature Version Info: Cluster Stack=3D2.6, Cluster Curre=
nt Version=3D2.6.2.0-205, Command Stack=3DNone, Command Version=3D2.6.2.0-2=
05 -> 2.6.2.0-205
2017-10-20 12:07:42,836 - Using hadoop conf dir: /usr/hdp/current/hadoop-client/conf
Error: Error: Unable to run the custom hook script ['/usr/bin/python=
9;, '/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py', 'ANY', '/var/lib/ambari-agent/data/=
command-406.json', '/var/lib/ambari-agent/cache/stacks/HD=
P/2.0.6/hooks/before-ANY', '/var/lib/ambari-agent/data/st=
ructured-out-406.json', 'INFO', '/var/lib/ambari-agent/tmp&=
#39;, 'PROTOCOL_TLSv1', '']

Command failed after 1 tries

--001a11411bc645242c055bfd8384--