Jorge,

These properties do support Expression Language. However, they do not support 
evaluating FlowFile Attributes,
only values from the Variable Registry. So this is going to be invalid unless 
you define a variable in the variable
registry for both the Principal and the Keytab.

Unfortunately, in past versions of NiFi, this was not made very clear, when a 
property supported Expression Language
but only against the Variable Registry. Fortunately, in the next version, 
1.7.0, the UI will clearly indicate whether Expression
Language can be evaluated against FlowFile Attributes or only the Variable 
Registry, so it should help to clear up
some of this confusion.

Thanks
-Mark


> On Jun 4, 2018, at 6:43 AM, Jorge Machado <jom...@me.com> wrote:
> 
> Sivaprasanna, 
> Yes I have that property set, the Unit test is failing IMHO it should not.
> 
> 
> Jorge Machado
> Best Regards
> 
> 
>> On 4 Jun 2018, at 12:09, Sivaprasanna <sivaprasanna...@gmail.com> wrote:
>> 
>> Jorge,
>> 
>> Both 'Kerberos Principal' abd 'Kerberos Keytab' support NiFi expression 
>> language so ${principal} and ${keytab} is valid here. Can you check if the 
>> property "nifi.kerberos.krb5.file" is set in nifi.properties file? Looks 
>> like this has to be set according to the description of those properties.
>> 
>> -
>> Sivaprasanna
>> 
>> On Mon, Jun 4, 2018 at 1:27 PM, Jorge Machado <jom...@me.com 
>> <mailto:jom...@me.com>> wrote:
>> Hi Guys, 
>> 
>> I’m facing the issue that I cannot start the DeleteHDFS with the error: 
>> "Kerberos Principal must be provided when using a secure configuration”
>> 
>> 
>> I’m able to reproduce this with this test: 
>> @Test
>> public void testKerberosOptionsWithCredentialServices() throws Exception {
>>    SimpleHadoopProcessor processor = new 
>> SimpleHadoopProcessor(kerberosProperties);
>>    TestRunner runner = TestRunners.newTestRunner(processor);
>> 
>>    // initialize the runner with EL for the kerberos properties
>>    
>> runner.setProperty(AbstractHadoopProcessor.HADOOP_CONFIGURATION_RESOURCES, 
>> "${variableHadoopConfigResources}");
>>    runner.setProperty(kerberosProperties.getKerberosPrincipal(), 
>> "${variablePrincipal}");
>>    runner.setProperty(kerberosProperties.getKerberosKeytab(), 
>> "${variableKeytab}");
>> 
>>    // add variables for all the kerberos properties except for the keytab
>>    runner.setVariable("variableHadoopConfigResources", 
>> "src/test/resources/core-site-security.xml");
>>    runner.assertValid();
>> }
>> In our case the ${principal} and ${keytab} is coming as a attribute on the 
>> incomming the Flowfile, the problem is that this validation of the attribute 
>> is happening before. 
>> Should this work like this? In all other places if we are using a variable 
>> it can be evaluate at run time... 
>> 
>> Jorge Machado
>> 
>> 
>> 
>> 
>> 
>> 
> 

Reply via email to