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

Stream create with owner fails, even though the owner is same as namespace owner

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.0
    • Fix Version/s: 4.1.0
    • Component/s: Security, Streams
    • Labels:
      None
    • Rank:
      1|hzzw6n:

      Description

      Steps to reproduce:
      1. Create a namespace, impersonating 'alice'
      2. Create a stream in this namespace. It will be owned by 'alice', because the namespace is owned by 'alice'.
      3. Attempt to create the stream again explicitly specifying 'alice'. It will fail due to the following check. It shouldn't fail though.

      2017-02-23 00:09:52,882 - ERROR [appfabric-executor-369:c.c.c.g.h.AppLifecycleHttpHandler$1@397] - Deploy failure
      java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: 'stream:ns2.purchaseStream' already exists and the specified 'principal' : 'kerberosprincipal:alice'
       is not same as existing one. 'principal' of an entity cannot be updated.
              at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:294) ~[com.google.guava.guava-13.0.1.jar:na]
              at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:281) ~[com.google.guava.guava-13.0.1.jar:na]
              at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116) ~[com.google.guava.guava-13.0.1.jar:na]
              at co.cask.cdap.internal.app.services.ApplicationLifecycleService.deployApp(ApplicationLifecycleService.java:605) ~[na:na]
              at co.cask.cdap.internal.app.services.ApplicationLifecycleService.deployApp(ApplicationLifecycleService.java:424) ~[na:na]
              at co.cask.cdap.gateway.handlers.AppLifecycleHttpHandler$1.onFinish(AppLifecycleHttpHandler.java:385) ~[na:na]
              at co.cask.cdap.common.http.AbstractBodyConsumer.finished(AbstractBodyConsumer.java:65) [na:na]
              at co.cask.http.HttpMethodInfo.bodyConsumerFinish(HttpMethodInfo.java:149) [co.cask.http.netty-http-0.16.0.jar:na]
              at co.cask.http.HttpMethodInfo.invoke(HttpMethodInfo.java:93) [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.ja
      r: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.lang.IllegalArgumentException: 'stream:ns2.purchaseStream' already exists and the specified 'principal' : 'kerberosprincipal:alice' is not same as existing one. 
      'principal' of an entity cannot be updated.
              at com.google.common.base.Preconditions.checkArgument(Preconditions.java:92) ~[com.google.guava.guava-13.0.1.jar:na]
              at co.cask.cdap.internal.app.deploy.pipeline.ApplicationVerificationStage.verifyOwner(ApplicationVerificationStage.java:179) ~[na:na]
              at co.cask.cdap.internal.app.deploy.pipeline.ApplicationVerificationStage.verifyData(ApplicationVerificationStage.java:167) ~[na:na]
              at co.cask.cdap.internal.app.deploy.pipeline.ApplicationVerificationStage.process(ApplicationVerificationStage.java:119) ~[na:na]
              at co.cask.cdap.internal.app.deploy.pipeline.ApplicationVerificationStage.process(ApplicationVerificationStage.java:76) ~[na:na]
              at co.cask.cdap.pipeline.AbstractStage.process(AbstractStage.java:52) ~[na:na]
              at co.cask.cdap.internal.pipeline.SynchronousPipeline.execute(SynchronousPipeline.java:55) ~[na:na]
              at co.cask.cdap.internal.app.deploy.LocalApplicationManager.deploy(LocalApplicationManager.java:133) ~[na:na]
              ... 21 common frames omitted
      

        Attachments

          Activity

            People

            • Assignee:
              rsinha Rohit Sinha
              Reporter:
              ali.anwar Ali Anwar
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: