spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Christophe Dauchy (Jira)" <>
Subject [jira] [Commented] (SPARK-28504) Web UI does not always honor spark.ui.proxyBase and X-Forwarded-Context
Date Wed, 18 Dec 2019 14:30:00 GMT


Jean-Christophe Dauchy commented on SPARK-28504:

Tested your implementation, it does not work :(

But applied this Jira and it worked : [SPARK-30240][core] Support HTTP redirects directly
to a proxy server

It crashes with the following stack trace : no protocol:
 at org.apache.spark.ui.JettyUtils$$anon$4.doRequest(JettyUtils.scala:179)
 at org.apache.spark.ui.JettyUtils$$anon$4.doGet(JettyUtils.scala:161)
 at javax.servlet.http.HttpServlet.service(
 at javax.servlet.http.HttpServlet.service(
 at org.spark_project.jetty.servlet.ServletHolder.handle(
 at org.spark_project.jetty.servlet.ServletHandler$CachedChain.doFilter(
 at org.apache.spark.deploy.history.ApplicationCacheCheckFilter.doFilter(ApplicationCache.scala:405)
 at org.spark_project.jetty.servlet.ServletHandler$CachedChain.doFilter(
 at org.spark_project.jetty.servlet.ServletHandler.doHandle(
 at org.spark_project.jetty.server.handler.ContextHandler.doHandle(
 at org.spark_project.jetty.servlet.ServletHandler.doScope(
 at org.spark_project.jetty.server.handler.ContextHandler.doScope(
 at org.spark_project.jetty.server.handler.ScopedHandler.handle(
 at org.spark_project.jetty.server.handler.ContextHandlerCollection.handle(
 at org.spark_project.jetty.server.handler.HandlerWrapper.handle(
 at org.spark_project.jetty.server.Server.handle(
 at org.spark_project.jetty.server.HttpChannel.handle(
 at org.spark_project.jetty.server.HttpConnection.onFillable(
 at org.spark_project.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(
 at org.spark_project.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(
 at org.spark_project.jetty.util.thread.QueuedThreadPool.runJob(
 at org.spark_project.jetty.util.thread.QueuedThreadPool$


> Web UI does not always honor spark.ui.proxyBase and X-Forwarded-Context
> -----------------------------------------------------------------------
>                 Key: SPARK-28504
>                 URL:
>             Project: Spark
>          Issue Type: Bug
>          Components: Web UI
>    Affects Versions: 2.4.3
>            Reporter: Kyle Winkelman
>            Priority: Major
> When running the Web UI behind a proxy, links in the html correctly honor spark.ui.proxyBase
and X-Forwarded-Context in [UIUtils#uiRoot|[]].
> Two items that I have found that do not honor spark.ui.proxyBase and X-Forwarded-Context:
>  # History server links from the main page produce a request like [http://localhost:8888/proxy/18080/history/spark-application-1563978242545/1/jobs/] which
will then redirect to [http://localhost:8888/history/spark-application-1563975642858/jobs/].
>  # Static redirects like when entering the Web UI with a request like [http://localhost:8888/proxy/4040] which
will then redirect to [http://localhost:8888/jobs].
> I believe that these correspond to:
>  # [HistoryServer#loaderServlet|[|]]
>  # [JettyUtils#createRedirectHandler|[]]
> I do not know if this is a complete list but I think these instances can be fixed by
using UIUtils.uiRoot.
> {code:java}
> // HistoryServer
> val requestURI = UIUtils.uiRoot(req) + Option(req.getQueryString).map("?" + _).getOrElse("")
> // JettyUtils
> val newUrl = new URL(new URL(UIUtils.uiRoot(request)), prefixedDestPath).toString{code}

This message was sent by Atlassian Jira

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message