You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "fang zhenyi (JIRA)" <ji...@apache.org> on 2018/02/21 07:04:00 UTC
[jira] [Commented] (HADOOP-15234) NPE when initializing KMSWebApp
[ https://issues.apache.org/jira/browse/HADOOP-15234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16371023#comment-16371023 ]
fang zhenyi commented on HADOOP-15234:
--------------------------------------
Thanks [~xiaochen] for report this.I will attach a patch later.
I'm able to reproduce this on trunk when I add the following configuration to kms-site.xml.
{code:java}
<configuration>
<property>
<name>hadoop.kms.key.provider.uri</name>
<value>jcek://file@/${user.home}/kms.keystore</value>
</property>
</configuration>
{code}
I replace 'jceks' with 'jcek'. \{{hadoop.kms.key.provider.uri}} is not null when \{{keyProvider}} is initialized.But \{{keyProvider}} is not initialized when we give wrong \{{hadoop.kms.key.provider.uri}}.\{{keyProvider}} is initialized by scheme \{{jceks}} in \{{JavaKeyStoreProvider.java}}.
{code:java}
/**
* The factory to create JksProviders, which is used by the ServiceLoader.
*/
public static class Factory extends KeyProviderFactory {
@Override
public KeyProvider createProvider(URI providerName,
Configuration conf) throws IOException {
if (SCHEME_NAME.equals(providerName.getScheme())) {
return new JavaKeyStoreProvider(providerName, conf);
}
return null;
}
}
{code}
what do you think?
> NPE when initializing KMSWebApp
> -------------------------------
>
> Key: HADOOP-15234
> URL: https://issues.apache.org/jira/browse/HADOOP-15234
> Project: Hadoop Common
> Issue Type: Bug
> Components: kms
> Reporter: Xiao Chen
> Assignee: fang zhenyi
> Priority: Major
>
> During KMS startup, if the {{keyProvider}} is null, it will NPE inside KeyProviderExtension.
> {noformat}
> java.lang.NullPointerException
> at org.apache.hadoop.crypto.key.KeyProviderExtension.<init>(KeyProviderExtension.java:43)
> at org.apache.hadoop.crypto.key.CachingKeyProvider.<init>(CachingKeyProvider.java:93)
> at org.apache.hadoop.crypto.key.kms.server.KMSWebApp.contextInitialized(KMSWebApp.java:170)
> {noformat}
> We're investigating the exact scenario that could lead to this, but the NPE and log around it can be improved.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org