[ 
https://issues.apache.org/jira/browse/KNOX-3171?focusedWorklogId=976244&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-976244
 ]

ASF GitHub Bot logged work on KNOX-3171:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Jul/25 11:32
            Start Date: 25/Jul/25 11:32
    Worklog Time Spent: 10m 
      Work Description: Kimahriman opened a new pull request, #1066:
URL: https://github.com/apache/knox/pull/1066

   (It is very **important** that you created an Apache Knox JIRA for this 
change and that the PR title/commit message includes the Apache Knox JIRA ID!)
   
   ## What changes were proposed in this pull request?
   Remove trailing slash is YARN proxy rewrite rules which now cause issues 
with Spark 4.0.0 UI. I don't see any other rewrite rules for YARN including a 
trailing slash, so not sure why the proxy ones ever needed to.
   
   (Please fill in changes proposed in this fix)
   
   ## How was this patch tested?
   
   Manual tested locally.
   
   Before:
   
   <img width="1728" height="893" alt="Screenshot 2025-07-25 at 7 23 42 AM" 
src="https://github.com/user-attachments/assets/e819bf51-db3a-431c-914a-1572bf0d286a";
 />
   
   After:
   
   <img width="1728" height="893" alt="Screenshot 2025-07-25 at 7 23 42 AM" 
src="https://github.com/user-attachments/assets/9c40eae3-ce87-4779-8085-db6b246e21fa";
 />
   
   
   Please review [Knox Contributing 
Process](https://cwiki.apache.org/confluence/display/KNOX/Contribution+Process#ContributionProcess-GithubWorkflow)
 before opening a pull request.
   




Issue Time Tracking
-------------------

            Worklog Id:     (was: 976244)
    Remaining Estimate: 0h
            Time Spent: 10m

> YARN proxy rewrite causes issues for Spark 4.0.0 UI
> ---------------------------------------------------
>
>                 Key: KNOX-3171
>                 URL: https://issues.apache.org/jira/browse/KNOX-3171
>             Project: Apache Knox
>          Issue Type: Bug
>            Reporter: Adam Binford
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Spark UI is not fully functional when viewed through the YARN UI proxy due to 
> the rewrite rules for proxying adding a trailing slash. Somehow this seems to 
> not have caused a problem until now, but there is a new inline script that 
> does not function correctly
> Original code:
> ```
>                 <div class="col-12">
>                     <div id="active-executors"></div>
>                     <script type="module" 
> src="/proxy/application_1753390029632_0001/static/utils.js"></script>
>                     <script type="module" 
> src="/proxy/application_1753390029632_0001/static/executorspage.js"></script>
>                     <script type="module">
>                         import {setThreadDumpEnabled, 
> setHeapHistogramEnabled} from 
> "/proxy/application_1753390029632_0001/static/executorspage.js";
>                         setThreadDumpEnabled(true);
>                         setHeapHistogramEnabled(true)
>                     </script>
>                 </div>
> ```
> Knox rewrite:
> ```
>             <div class="col-12">
>               <div id="active-executors"></div>
>               <script type="module" 
> src="https://localhost:8443/gateway/sandbox/yarn/proxy/application_1753390029632_0001/static/utils.js/";></script>
>               <script type="module" 
> src="https://localhost:8443/gateway/sandbox/yarn/proxy/application_1753390029632_0001/static/executorspage.js/";></script>
>               <script type="module">
>                 import {setThreadDumpEnabled, setHeapHistogramEnabled} from 
> "https://localhost:8443/gateway/sandbox/yarn/proxy/application_1753390029632_0001/static/executorspage.js";;
>                 setThreadDumpEnabled(true);
>                 setHeapHistogramEnabled(true);
>               /</script>
>             </div>
> ```
> This leads to two errors in the browser console:
> ```
> GET 
> https://localhost:8443/gateway/sandbox/yarn/proxy/application_1753390683205_0007/static/executorspage.js/utils.js
>  net::ERR_ABORTED 404 (Not Found)Understand this error
> executors/:62 Uncaught SyntaxError: Unexpected end of input (at 
> executors/:62:2)
> ```
> The first is because `executorspage.js` has a import from `./utils.js`, so 
> some part of that import gets messed up with the trailing slash. The second 
> is because of the `/` right before the `</script>` tag that the rewrite rule 
> seems to erroneously add. Either way the trailing slashes don't really make 
> sense and shouldn't be needed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to