Uploaded image for project: 'Pentaho Data Integration - Kettle'
  1. Pentaho Data Integration - Kettle
  2. PDI-16045

Rest Client step does not encode parameter list properly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: Urgent
    • Resolution: Fixed
    • Affects Version/s: 7.0.0 GA
    • Fix Version/s: 7.1.0 GA
    • Component/s: Step
    • Labels:
    • Story Points:
      0
    • PDI Sub-component:
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.
    • Sprint Team:
      Tatooine (Maint)

      Description

      This issue currently only happens in 7.0. This was tested in 6.1 and it works there. When adding parameters in the Rest Client step, under the "Parameters" or "Matrix Parameters" tab, the list is not encoded properly in the URL being sent out by the step.

      A variation of this error happens when using Parameters in the "Rest Client" step:

      2017/01/27 13:49:02 - MARS Request One.0 - Caused by: java.net.URISyntaxException: Illegal character in path at index 325: HTTPS://servername:8443/dbapi.do;MARSHOST=servername;MARSPROTOCOL=HTTPS;MARSPORT=8443;MARSTOKEN=Basic%20YWRtaW46SGl0QGNoaTE%3D;start_time=20170106_180000;end_time=20170106_190000;array_to_query=.*;transmit_url=HTTPS:%2F%2Fservername:8443%2Fdbapi.do%3Faction%3Dquery&dataset%3DdefaultDs&processSync%3Dtrue;body=%7B"query":"*raidStorage[=name rx .*]/raidPool[=name rx (?i).*]&[@readResponseTime rx b .+][@writeResponseTime rx b .+][@readIOPS rx b .+][@writeIOPS rx b .+][@readTransRate rx b .+][@writeTransRate rx b .+]","startTime":"20170106_180000","endTime":"20170106_190000"%7D?action=query&dataset=defaultDs&processSync=true
      

      Running the transformation in debug mode and extracting the URL in 7.0 shows it like this:

      HTTPS://172.17.237.132:8443/dbapi.do;MARSHOST=172.17.237.132;MARSPROTOCOL=HTTPS;MARSPORT=8443;MARSTOKEN=Basic%20YWRtaW46SGl0QGNoaTE%3D;start_time=20170106_180000;end_time=20170106_190000;array_to_query=.*;transmit_url=HTTPS:%2F%2F172.17.237.132:8443%2Fdbapi.do%3Faction%3Dquery&dataset%3DdefaultDs&processSync%3Dtrue;body=%7B"query":"raidStorage/raidPool","startTime":"20170106_180000","endTime":"20170106_190000"%7D?action=query&dataset=defaultDs&processSync=true
      

      At index 325 is where the parameter list starts. The same URL taken from a successful debug log run in 6.1 shows it like this:

      HTTPS://servername:8443/dbapi.do;MARSHOST=servername;MARSPROTOCOL=HTTPS;MARSPORT=8443;MARSTOKEN=Basic%20YWRtaW46SGl0QGNoaTE%3D;start_time=20170106_180000;end_time=20170106_190000;array_to_query=.*;transmit_url=HTTPS:%2F%2Fservername:8443%2Fdbapi.do%3Faction%3Dquery&dataset%3DdefaultDs&processSync%3Dtrue;body=%7B%22query%22:%22raidStorage%2FraidPool%22,%22startTime%22:%2220170106_180000%22,%22endTime%22:%2220170106_190000%22%7D?action=query&dataset=defaultDs&processSync=true 
      

      As you can see, in the 6.1 successful run, the double-quotes get encoded properly with %22. In the 7.0 errored run, the double-quotes do not get encoded and are sent as literal characters.

        Attachments

          Activity

            People

            Assignee:
            upihin Uladzimir Pihin (Inactive)
            Reporter:
            cmorehouse Christopher Morehouse
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: