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

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

                Author: ASF GitHub Bot
            Created on: 17/Sep/20 11:37
            Start Date: 17/Sep/20 11:37
    Worklog Time Spent: 10m 
      Work Description: iain-buclaw-sociomantic opened a new pull request #375:
URL: https://github.com/apache/knox/pull/375


   ## What changes were proposed in this pull request?
   
   For unexplained reasons, most of the time SHS links are in the format 
`http://host:port/proxy/application_123_456`, but sometimes they can be 
`/proxy/application_123_456`.
   
   This causes broken URLs on the page, along with the following logged error.
   
   ```
   Failed to rewrite URL: /proxy/application_1597654526563_0024/, direction: 
OUT via rule: YARNUI/yarn/outbound/apps/history, status: FAILURE
   ```
   
   This patch fixes the issue.
   
   ## How was this patch tested?
   
   Tested in local production cluster.  Spawned up hundreds of spark jobs and 
checked links, without this patch every 1 in 20 or so is broken.  With the 
patch, all previously broken links now work.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


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

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

> SHS links sometimes broken on FINISHED jobs page
> ------------------------------------------------
>
>                 Key: KNOX-2456
>                 URL: https://issues.apache.org/jira/browse/KNOX-2456
>             Project: Apache Knox
>          Issue Type: Bug
>    Affects Versions: 1.4.0
>            Reporter: Iain Buclaw
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> For unexplained reasons, most of the time SHS links are in the format 
> `http://host:port/proxy/application_123_456`, but sometimes they can be 
> `/proxy/application_123_456`.
> This causes broken URLs on the page, along with the following logged error.
> {noformat}
> 2020-08-17 11:22:35,653 ERROR knox.gateway 
> (UrlRewriteProcessor.java:rewrite(166)) - Failed to rewrite URL: 
> /proxy/application_1597654526563_0024/, direction: OUT via rule: 
> YARNUI/yarn/outbound/apps/history, status: FAILURE{noformat}
> This patch fixes the issue.
> {code:java}
> --- 
> a/gateway-service-definitions/src/main/resources/services/yarnui/2.7.0/rewrite.xml
> +++ 
> b/gateway-service-definitions/src/main/resources/services/yarnui/2.7.0/rewrite.xml
> @@ -246,9 +246,13 @@
>  </rule>
>  
>  
> -<rule dir="OUT" name="YARNUI/yarn/outbound/apps/history">
> -    <match pattern="*://*:*/proxy/{**}"/>
> -    <rewrite template="{$frontend[url]}/yarn/proxy/{**}/"/>
> +<rule flow="OR" dir="OUT" name="YARNUI/yarn/outbound/apps/history">
> +    <match pattern="*://*:*/proxy/{**}">
> +        <rewrite template="{$frontend[url]}/yarn/proxy/{**}/"/>
> +    </match>
> +    <match pattern="/proxy/{**}">
> +        <rewrite template="{$frontend[url]}/yarn/proxy/{**}/"/>
> +    </match>
>  </rule>
>  <rule dir="OUT" name="YARNUI/yarn/outbound/apps/history1">
>      <match pattern="/proxy/{**}?{**}"/>
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to