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

HTTP Post step fails Digest Based Authentication

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: High
    • Resolution: Fixed
    • Affects Version/s: 7.1.0.3 GA
    • Fix Version/s: 8.2.0 GA
    • Component/s: Step
    • 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)
    • Steps to Reproduce:
      Hide

      Use the HTTP Post step against a service that requires Digest based authentication rather than Basic authentication.

      Show
      Use the HTTP Post step against a service that requires Digest based authentication rather than Basic authentication.

      Description

      Both the HTTP Client step and the HTTP Post step utilise the 

      org.apache.commons.httpclient libraries for HTTP requests.  This library automatically tries basic authentication and then digest authentication if basic fails.  Unfortunately the HTTP Post step fails with the following error:

       

      2018/03/14 18:18:23 - HTTP Post.0 - ERROR (version 7.1.0.3-57, build 1 from 2017-08-23 11.43.14 by buildguy) : Because of an error, this step can't continue: 
      2018/03/14 18:18:23 - HTTP Post.0 - ERROR (version 7.1.0.3-57, build 1 from 2017-08-23 11.43.14 by buildguy) : Because of an error, this step can't continue: 
      2018/03/14 18:18:23 - HTTP Post.0 - Can not result from [http://b401-001-camc.bms.curtin.edu.au/admin-bin/editcgi.cgi?file=/usr/local/package/fallback_parameters.json]2018/03/14 18:18:23 - HTTP Post.0 - Unbuffered entity enclosing request can not be repeated.
      2018/03/14 18:18:23 - HTTP Post.0 - ERROR (version 7.1.0.3-57, build 1 from 2017-08-23 11.43.14 by buildguy) : org.pentaho.di.core.exception.KettleException: 
      2018/03/14 18:18:23 - HTTP Post.0 - Can not result from [http://b401-001-camc.bms.curtin.edu.au/admin-bin/editcgi.cgi?file=/usr/local/package/fallback_parameters.json]2018/03/14 18:18:23 - HTTP Post.0 - Unbuffered entity enclosing request can not be repeated.
      2018/03/14 18:18:23 - HTTP Post.0 - 
      2018/03/14 18:18:23 - HTTP Post.0 - at org.pentaho.di.trans.steps.httppost.HTTPPOST.callHTTPPOST(HTTPPOST.java:326)
      2018/03/14 18:18:23 - HTTP Post.0 - at org.pentaho.di.trans.steps.httppost.HTTPPOST.processRow(HTTPPOST.java:472)
      2018/03/14 18:18:23 - HTTP Post.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
      2018/03/14 18:18:23 - HTTP Post.0 - at java.lang.Thread.run(Thread.java:748)
      2018/03/14 18:18:23 - HTTP Post.0 - Caused by: org.apache.commons.httpclient.ProtocolException: Unbuffered entity enclosing request can not be repeated.
      2018/03/14 18:18:23 - HTTP Post.0 - at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:487)
      2018/03/14 18:18:23 - HTTP Post.0 - at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
      2018/03/14 18:18:23 - HTTP Post.0 - at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
      2018/03/14 18:18:23 - HTTP Post.0 - at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
      2018/03/14 18:18:23 - HTTP Post.0 - at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
      2018/03/14 18:18:23 - HTTP Post.0 - at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
      2018/03/14 18:18:23 - HTTP Post.0 - at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
      2018/03/14 18:18:23 - HTTP Post.0 - at org.pentaho.di.trans.steps.httppost.HTTPPOST.requestStatusCode(HTTPPOST.java:336)
      2018/03/14 18:18:23 - HTTP Post.0 - at org.pentaho.di.trans.steps.httppost.HTTPPOST.callHTTPPOST(HTTPPOST.java:217)
      2018/03/14 18:18:23 - HTTP Post.0 - ... 3 more
      

      I've found changing line 201 of engine/src/org/pentaho/di/trans/steps/httppost/HTTPPOST.java from:

      post.setRequestEntity( new InputStreamRequestEntity( new ByteArrayInputStream( bytes ), bytes.length ) );
      

      to

      post.setRequestEntity( new org.apache.commons.httpclient.methods.ByteArrayRequestEntity(bytes));
      

      this error goes away and HttpClient.executeMethod retries the authentication successfully as Digest authentication.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              scosta Sandra Costa
              Reporter:
              ballmj John Ballment
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: