Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-7055 YARN Timeline Service v.2: beta 1 / GA
  3. YARN-8247

Incorrect HTTP status code returned by ATSv2 for non-whitelisted users

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 2.10.0, 3.2.0, 3.1.1, 3.0.3
    • ATSv2
    • None
    • Reviewed

    Description

      When using the below configuration in ATSv2 reader,

      yarn.timeline-service.read.authentication.enabled=true
      yarn.timeline-service.read.allowed.users=user1,user2

      A query with user3 throws a Forbidden Exception with a status code of 500 (Internal Server Error) instead of the expected 403 for Forbidden. Stack trace of the response,

      HTTP ERROR 500
      Problem accessing /ws/v2/timeline/apps/application_1525427743175_0009. Reason:
      
          Server Error
      Caused by:
      org.apache.hadoop.yarn.webapp.ForbiddenException: java.lang.Exception: user user3 is not allowed to read TimelineService V2 data
      	at org.apache.hadoop.yarn.server.timelineservice.reader.security.TimelineReaderWhitelistAuthorizationFilter.doFilter(TimelineReaderWhitelistAuthorizationFilter.java:80)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
      	at org.apache.hadoop.security.authentication.server.AuthenticationFilter.doFilter(AuthenticationFilter.java:644)
      	at org.apache.hadoop.security.authentication.server.AuthenticationFilter.doFilter(AuthenticationFilter.java:592)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
      	at org.apache.hadoop.security.http.CrossOriginFilter.doFilter(CrossOriginFilter.java:98)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
      	at org.apache.hadoop.http.HttpServer2$QuotingInputFilter.doFilter(HttpServer2.java:1601)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
      	at org.apache.hadoop.http.NoCacheFilter.doFilter(NoCacheFilter.java:45)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
      	at org.eclipse.jetty.server.Server.handle(Server.java:534)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)
      	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
      	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
      	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
      	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.Exception: user user3 is not allowed to read TimelineService V2 data
      	at org.apache.hadoop.yarn.webapp.ForbiddenException.<init>(ForbiddenException.java:41)
      	... 34 more

      cc vrushalic rohithsharma

      Attachments

        1. YARN-8247.02.patch
          12 kB
          Rohith Sharma K S
        2. YARN-8247.01.patch
          11 kB
          Rohith Sharma K S

        Activity

          People

            rohithsharma Rohith Sharma K S
            charanh Charan Hebri
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: