spatwin

RESTful API Illegal hex characters in escape pattern

Discussion created by spatwin on Sep 24, 2018
Latest reply on Sep 26, 2018 by Yu_Ishitani

I'm having an error with UIM 8.5.1 where I'm trying to pull QoS data out of the RESTful API and I'm receiving "Illegal hex characters in escape pattern" when trying to leverage certain QoS targets that include "%" characters. Robot of the UIM host is version 7.93.

 

For example if without encoding the URL looks like pulling from the vmware probe:

 

http://198.51.100.100/rest/qos/data/name/QOS_DS_DISK_FREE/vSphereExample/ExampleGroup/ExampleDataStore/Free (in % of Capacity)/201824090000/now/1

 

When the url properly encoded it looks like:

 

http://198.51.100.100/rest/qos/data/name/QOS_DS_DISK_FREE/vSphereExample/ExampleGroup%2FExampleDataStore%2FFree%20%28in%20%25%20of%20Capacity%29/201824090000/now/1

 

When trying to access this resource UIM throws an error of:

 

<html>
   <head>
      <title>Apache Tomcat/6.0.26 - Error report</title>
      <style>
         <!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}-->
      </style>
   </head>
   <body>
      <h1>HTTP Status 500 - </h1>
      <HR size="1" noshade="noshade">
      <p><b>type</b> Exception report</p>
      <p><b>message</b> <u></u></p>
      <p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p>
      <p><b>exception</b>
      <pre>java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: " o"      java.net.URLDecoder.decode(Unknown Source)      com.nimsoft.nms.nimwscommon.controller.QoSController.getData(QoSController.java:56)      com.nimsoft.nms.restfulws.services.QosResource.getData(QosResource.java:220)      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)      sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)      sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)      java.lang.reflect.Method.invoke(Unknown Source)      com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)      com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)      com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)      com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)      com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)      com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)      com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)      com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)      com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)      com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)      com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)      com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)      com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)      com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)      com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)      javax.servlet.http.HttpServlet.service(HttpServlet.java:717) </pre>
      </p>
      <p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/6.0.26 logs.</u></p>
      <HR size="1" noshade="noshade">
      <h3>Apache Tomcat/6.0.26</h3>
   </body>
</html>

 

As soon as I remove the "%25" from the encoded URL the error is no longer present and UIM just returns an empty dataset.

 

I have a case already open with CA but I wanted to check with the community to see if anybody had run into this error before. I have ALLOW_ENCODED_SLASH and ALLOW_BACKSLASH enabled but I don't think those really matter for this situation since I can successfully pass encoded forward slashes(%2F) without receiving any errors.

 

Any insight would be appreciated.

Outcomes