Marcos-Dimitris Fetcu created NIFI-16514:
--------------------------------------------

             Summary: StandardPGPPrivateKeyService Service Error On Startup
                 Key: NIFI-16514
                 URL: https://issues.apache.org/jira/browse/NIFI-16514
             Project: Apache NiFi
          Issue Type: Bug
          Components: Tools and Build
    Affects Versions: 2.12.0
         Environment: Linux CentOS 7
            Reporter: Marcos-Dimitris Fetcu


I recently migrated from NiFi 1.x to latest NiFi 2.12.0.

During the upgrade process I had to replace some deprecated components.
In my flow I was using an *EncryptContent* processor set up for decryption, and 
{*}I replaced it with the current processor for decryption: 
DecryptContentPGP{*}.

Additionally, to the DecryptContentPGP component *I had also to configure a 
StandardPGPPrivateKeyService* service and 
*AzureKeyVaultSecretsParameterProvider parameter provider* for the PGP password.
My configuration is the following:

*DecryptContentPGP:*
Decryption Strategy: DECRYPTED
Passphrase: No value set
Private Key Service: StandardPGPPrivateKeyService

*StandardPGPPrivateKeyService:*
Keyring File: $(the_path_where_the_keyring_file_is_stored)
Keyring: No value set
Key Password: 
#\{parameter_variable_fetched_from_azure_containing_the_decryption_password}

Here for testing purposes, I am supposed to stop and restart NiFi very often.
And *after a fresh startup I notice that each time I have a one-time error 
related to StandardPGPPrivateKeyService failing to load the Keyring file.* I 
mention that the keyring file is available at the specified path and is not 
loaded dynamically at each start, so at the time the service is starting I know 
that there does not exist a problem with that file being unavailable.


ERROR Message:
Could not start 
StandardControllerServiceNode[service=StandardPGPPrivateKeyService[id=UUID], 
name=StandardPGPPrivateKeyService, active=true] due to 
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: 
Enabling 
StandardControllerServiceNode[service=StandardPGPPrivateKeyService[id=UUID], 
name=StandardPGPPrivateKeyService, active=true] failed: Validation Status 
[INVALID] Errors ['Keyring File' is invalid because Reading Secret Keyring File 
Failed: Reading Secret Keyring File [/path/to/file/pgp_private_key_file] 
Failed, 'StandardPGPPrivateKeyService' is invalid because No Private Keys Read 
from [Keyring File] or [Keyring]]
Regarding to *AzureKeyVaultSecretsParameterProvider* I am able to see in the 
logs that the parameters are fetched successfully before this ERROR is thrown, 
at least with one second earlier. Meaning, according to the logs the parameter 
secret is available when it attempts to enable the 
*StandardPGPPrivateKeyService.*
Also, the *StandardPGPPrivateKeyService* is enabled successfully around 10 
seconds after the given ERROR. Therefore, I consider this one-time ERROR as 
being a bug.

Could you please address this issue?



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to