Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-12586

EZ createZone returns IllegalArgumentException when using protocol in path

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      When trying to create an EZ and sending protocol (hdfs://) as part of the path, -createZone reports an IllegalArgumentException.
      IllegalArgumentException: hdfs://<namenode-address>/tmp/fooez1 is not the root of an encryption zone. Do you mean /tmp/fooez1?

      Here's a sequence:
      1. mkdir the path
      bash-4.1$ hadoop fs -mkdir /tmp/fooez1
      2. try to make EZ using hdfs protocol, and get error
      hdfs crypto -createZone -keyName key1 -path hdfs://<namenode-address>/tmp/fooez1/
      IllegalArgumentException: hdfs://<namenode-address>/tmp/fooez1 is not the root of an encryption zone. Do you mean /tmp/fooez1?

      It fails while provisioning trash for ez root directory.
      The relevant chunk of code.

      HdfsAdmin.java
      private void provisionEZTrash(Path path) throws IOException {
         ...
         ...
          String ezPath = ez.getPath();
          if (!path.toString().equals(ezPath)) {
            throw new IllegalArgumentException(path + " is not the root of an " +
                "encryption zone. Do you mean " + ez.getPath() + "?");
          }
      

      It is comparing the supplied path with path component of EncryptionZone#path which doesn't contain scheme and authority.

      Attachments

        Issue Links

          Activity

            People

              shahrs87 Rushabh Shah
              shahrs87 Rushabh Shah
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: