[
https://issues.apache.org/jira/browse/KNOX-3171?focusedWorklogId=994965&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-994965
]
ASF GitHub Bot logged work on KNOX-3171:
----------------------------------------
Author: ASF GitHub Bot
Created on: 05/Dec/25 15:06
Start Date: 05/Dec/25 15:06
Worklog Time Spent: 10m
Work Description: Kimahriman commented on PR #1066:
URL: https://github.com/apache/knox/pull/1066#issuecomment-3617294670
> @Kimahriman and @pan3793 Can you close the JIRA and also update it with
the proper release version (`2.1.0`) Thank you a lot for your contribution the
Apache Knox!
Closed as resolved and set the version to 3.0.0 since it looks like 2.1.0
was already released?
> feedback - applied this patch to our internal cluster, now Knox works as
expected with Spark 4.0 and 4.1
Thanks for verifying!
We've also hit another error unrelated to this on the structured streaming
page for a single stream. I'll write up an issue but basically there's a nested
module-based script in the HTML that gets rewritten from
```html
<script type="module">
import {drawHistogram} from
"/proxy/application_xxx_xxx/static/streaming-page.js";
import {drawAreaStack} from
"/proxy/application_xxx_xxx/static/streaming-page.js";
import {registerTimeline} from
"/proxy/application_xxx_xxx/static/streaming-page.js";
import {registerHistogram} from
"/proxy/application_xxx_xxx/static/streaming-page.js";
import {drawTimeline} from
"/proxy/application_xxx_xxx/static/streaming-page.js";
```
to
```html
<script type="module">
import {drawHistogram} from
"https://knox.example.com/gateway/topology-name/yarn/proxy/application_xxx_xxx/static/streaming-page.js";
import {drawAreaStack} from
"/proxy/application_xxx_xxx/static/streaming-page.js";
import {registerTimeline} from
"/proxy/application_xxx_xxx/static/streaming-page.js";
import {registerHistogram} from
"/proxy/application_xxx_xxx/static/streaming-page.js";
import {drawTimeline} from
"/proxy/application_xxx_xxx/static/streaming-page.js";
```
Only the first one gets rewritten
Issue Time Tracking
-------------------
Worklog Id: (was: 994965)
Time Spent: 2h (was: 1h 50m)
> 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
> Fix For: 3.0.0
>
> Time Spent: 2h
> Remaining Estimate: 0h
>
> Spark UI is not fully functional in 4.0.0 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)