<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: NIFI exceute script : Not reading the psql password in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NIFI-exceute-script-Not-reading-the-psql-password/m-p/175549#M137806</link>
    <description>&lt;P&gt;An alternative to using an environment variable is to use the file-based Variable Registry, where you could create a file perhaps called var_registry.properties with the entry&lt;/P&gt;&lt;PRE&gt;PGPASSWORD=&amp;lt;my_pg_password&amp;gt;&lt;/PRE&gt;&lt;P&gt;And edit conf/nifi.properties to use that file for the registry:&lt;/P&gt;&lt;PRE&gt;nifi.variable.registry.properties=var_registry.properties&lt;/PRE&gt;&lt;P&gt;Then you could use PGPASSWORD in your groovy script the same way you'd use an environment variable:&lt;/P&gt;&lt;PRE&gt;${PGPASSWORD}&lt;/PRE&gt;</description>
    <pubDate>Wed, 29 Mar 2017 22:26:11 GMT</pubDate>
    <dc:creator>mburgess</dc:creator>
    <dc:date>2017-03-29T22:26:11Z</dc:date>
    <item>
      <title>NIFI exceute script : Not reading the psql password</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-exceute-script-Not-reading-the-psql-password/m-p/175547#M137804</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have installed NIFI on EC2 instance where I am invoking PostgreSQL  psql utility. When I invoke the following command from the EC2 instance, it works fine:&lt;/P&gt;&lt;PRE&gt;psql --host=&amp;lt;AWS RDS host&amp;gt;--port=5432 --dbname=&amp;lt;DBname&amp;gt; --username=&amp;lt;DB user&amp;gt; --no-password --command="create database kiran_test_10"
This creates the database
&lt;/PRE&gt;&lt;P&gt;But when I embed the same command in the groovy script and try to execute from the NIFI execute processor, it throws out&lt;/P&gt;&lt;P&gt;"Error: psql: fe_sendauth: no password supplied"&lt;/P&gt;&lt;P&gt;I have setup an environment variable PGPASSWORD on the EC2 instance. The psql command when executed on the EC2 instance is able to pick up the password but when executed from the NIFI execute script processor is not picking up the password.&lt;/P&gt;&lt;P&gt;Do I need to configure environment variables differently on EC2 for NIFI to read them?&lt;/P&gt;&lt;P&gt;Please let me know&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 22:04:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-exceute-script-Not-reading-the-psql-password/m-p/175547#M137804</guid>
      <dc:creator>krdsranga</dc:creator>
      <dc:date>2017-03-27T22:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI exceute script : Not reading the psql password</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-exceute-script-Not-reading-the-psql-password/m-p/175548#M137805</link>
      <description>&lt;P&gt;Are you sure this environment variable is set for the NiFi user, and not just for the user you are ssh'd in as?
A test for this would be to invoke a common system variable like USER and see what you get.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 14:36:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-exceute-script-Not-reading-the-psql-password/m-p/175548#M137805</guid>
      <dc:creator>dchaffey</dc:creator>
      <dc:date>2017-03-29T14:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI exceute script : Not reading the psql password</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-exceute-script-Not-reading-the-psql-password/m-p/175549#M137806</link>
      <description>&lt;P&gt;An alternative to using an environment variable is to use the file-based Variable Registry, where you could create a file perhaps called var_registry.properties with the entry&lt;/P&gt;&lt;PRE&gt;PGPASSWORD=&amp;lt;my_pg_password&amp;gt;&lt;/PRE&gt;&lt;P&gt;And edit conf/nifi.properties to use that file for the registry:&lt;/P&gt;&lt;PRE&gt;nifi.variable.registry.properties=var_registry.properties&lt;/PRE&gt;&lt;P&gt;Then you could use PGPASSWORD in your groovy script the same way you'd use an environment variable:&lt;/P&gt;&lt;PRE&gt;${PGPASSWORD}&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Mar 2017 22:26:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-exceute-script-Not-reading-the-psql-password/m-p/175549#M137806</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2017-03-29T22:26:11Z</dc:date>
    </item>
  </channel>
</rss>

