Support Questions
Find answers, ask questions, and share your expertise

KNOX - Help requested for parsing query parameters.

Hi Guys,

I have been struggling with this since a few days now and I can't seem to be able to fix it? It is parsing "id" correctly. But, it is also picking up the entire "amp;attempt" as another query parameter as opposed to just "attempt". Is there a way to strip out extra "amp;" somehow and just keep "attempt=0" or is there another way to fix this? This is KNOX on HDP 2.6.1.

2019-03-07 03:45:16,408 DEBUG hadoop.gateway ( - Rewrote URL: /proxy/application_1551341404019_0002/stages/stage?id=3&attempt=0, direction: OUT via implicit rule: YARNUI/yarn/outbound/proxystage to URL:;attempt=0&id=3

Here's what I have in the rewrite.xml

 <rule dir="OUT" name="YARNUI/yarn/outbound/proxystage" pattern="/proxy/{*}/stages/stage?{**}">     <rewrite template="{$frontend[url]}/yarn/proxy/{*}/stages/stage?{**}"/>  </rule>

Thanks a lot in advance!


EDIT:- Found a workaround! This seems to have resolved the issue.

<rule dir="OUT" name="YARNUI/yarn/outbound/proxystage" pattern="/proxy/{*}/stages/stage?{amp;attempt}?{**}">
    <rewrite template="{$frontend[url]}/yarn/proxy/{*}/stages/stage?attempt={amp;attempt}?{**}"/>