Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5625B1081B for ; Wed, 23 Jul 2014 14:46:41 +0000 (UTC) Received: (qmail 84358 invoked by uid 500); 23 Jul 2014 14:46:41 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 84308 invoked by uid 500); 23 Jul 2014 14:46:41 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 84290 invoked by uid 99); 23 Jul 2014 14:46:41 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jul 2014 14:46:41 +0000 Date: Wed, 23 Jul 2014 14:46:41 +0000 (UTC) From: "Charles Lamb (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-6733) Creating encryption zone results in NPE when KeyProvider is null MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-6733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14071799#comment-14071799 ] Charles Lamb commented on HDFS-6733: ------------------------------------ Thanks [~andrew.wang] for the review. I moved testCreateEZWithNoProvider into TestEncryptionZones and as you suggested, grabbed the conf from the minicluster, diddled it, restarted the NN, ... I'll commit this to fs-encryption shortly. > Creating encryption zone results in NPE when KeyProvider is null > ---------------------------------------------------------------- > > Key: HDFS-6733 > URL: https://issues.apache.org/jira/browse/HDFS-6733 > Project: Hadoop HDFS > Issue Type: Sub-task > Components: security > Affects Versions: fs-encryption (HADOOP-10150 and HDFS-6134) > Reporter: Stephen Chu > Assignee: Charles Lamb > Attachments: HDFS-6733.001.patch, HDFS-6733.002.patch > > > When users try to create an encryption zone on a system that is not configured with a KeyProvider, they will run into a NullPointerException. > For example: > [hdfs@schu-enc2 ~]$ hdfs crypto -createZone -keyName abc123 -path /user/hdfs > 2014-07-22 23:18:23,273 WARN [main] crypto.CryptoCodec (CryptoCodec.java:getInstance(70)) - Crypto codec org.apache.hadoop.crypto.OpensslAesCtrCryptoCodec is not available. > RemoteException: java.lang.NullPointerException > This error happens in FSNamesystem.createEncryptionZone(FSNamesystem.java:8456): > {code} > try { > if (keyName == null || keyName.isEmpty()) { > keyName = UUID.randomUUID().toString(); > createNewKey(keyName, src); > createdKey = true; > } else { > KeyVersion keyVersion = provider.getCurrentKey(keyName); > if (keyVersion == null) { > {code} > provider can be null. > An improvement would be to make the error message more specific/say that KeyProvider was not found. -- This message was sent by Atlassian JIRA (v6.2#6252)