Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-8929

Cryptic error message when namespace creation fails because of existing HDFS directory

    Details

    • Rank:
      1|hzzxfj:

      Description

      In the UI:
      hdfs://<host>:8020/cdap/namespaces/hello

      In the CLI:
      Error: 500: hdfs://<host>:8020/cdap/namespaces/hello

      In the logs:

      2017-03-09 06:54:03,178 - ERROR [appfabric-executor-3392:c.c.c.c.HttpExceptionHandler@68] - Unexpected error: request=PUT /v3/namespaces/hello user=bhooshan:
      co.cask.cdap.common.NamespaceCannotBeCreatedException: 'namespace:hello' cannot be created. Reason: hdfs://10.128.0.43:8020/cdap/namespaces/hello
      	at co.cask.cdap.internal.app.namespace.DefaultNamespaceAdmin.create(DefaultNamespaceAdmin.java:226) ~[na:na]
      	at co.cask.cdap.gateway.handlers.NamespaceHttpHandler.create(NamespaceHttpHandler.java:112) ~[na:na]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_75]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_75]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_75]
      	at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_75]
      	at co.cask.http.HttpMethodInfo.invoke(HttpMethodInfo.java:80) ~[co.cask.http.netty-http-0.16.0.jar:na]
      	at co.cask.http.HttpDispatcher.messageReceived(HttpDispatcher.java:38) [co.cask.http.netty-http-0.16.0.jar:na]
      	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) [io.netty.netty-3.6.6.Final.jar:na]
      	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) [io.netty.netty-3.6.6.Final.jar:na]
      	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) [io.netty.netty-3.6.6.Final.jar:na]
      	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.messageReceived(SimpleChannelUpstreamHandler.java:124) [io.netty.netty-3.6.6.Final.jar:na]
      	at co.cask.cdap.common.http.AuthenticationChannelHandler.messageReceived(AuthenticationChannelHandler.java:64) [na:na]
      	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) [io.netty.netty-3.6.6.Final.jar:na]
      	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) [io.netty.netty-3.6.6.Final.jar:na]
      	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) [io.netty.netty-3.6.6.Final.jar:na]
      	at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43) [io.netty.netty-3.6.6.Final.jar:na]
      	at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67) [io.netty.netty-3.6.6.Final.jar:na]
      	at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:314) [io.netty.netty-3.6.6.Final.jar:na]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_75]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_75]
      	at java.lang.Thread.run(Thread.java:745) [na:1.7.0_75]
      Caused by: java.nio.file.FileAlreadyExistsException: hdfs://10.128.0.43:8020/cdap/namespaces/hello
      	at co.cask.cdap.internal.app.namespace.AbstractStorageProviderNamespaceAdmin.createLocation(AbstractStorageProviderNamespaceAdmin.java:141) ~[na:na]
      	at co.cask.cdap.internal.app.namespace.AbstractStorageProviderNamespaceAdmin.create(AbstractStorageProviderNamespaceAdmin.java:73) ~[na:na]
      	at co.cask.cdap.internal.app.namespace.DistributedStorageProviderNamespaceAdmin.create(DistributedStorageProviderNamespaceAdmin.java:69) ~[na:na]
      	at co.cask.cdap.internal.app.namespace.DefaultNamespaceAdmin$2.call(DefaultNamespaceAdmin.java:218) ~[na:na]
      	at co.cask.cdap.internal.app.namespace.DefaultNamespaceAdmin$2.call(DefaultNamespaceAdmin.java:215) ~[na:na]
      	at co.cask.cdap.security.impersonation.ImpersonationUtils$1.run(ImpersonationUtils.java:46) ~[na:na]
      	at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_75]
      	at javax.security.auth.Subject.doAs(Subject.java:415) ~[na:1.7.0_75]
      	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657) ~[hadoop-common-2.7.1.2.3.4.7-4.jar:na]
      	at co.cask.cdap.security.impersonation.ImpersonationUtils.doAs(ImpersonationUtils.java:43) ~[na:na]
      	at co.cask.cdap.internal.app.namespace.DefaultNamespaceAdmin.create(DefaultNamespaceAdmin.java:215) ~[na:na]
      	... 21 common frames omitted
      

      Also, if a directory exists, the response code should be 409.

        Attachments

          Activity

            People

            • Assignee:
              deepak Deepak Wadhwani
              Reporter:
              bhooshan Bhooshan Mogal
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: