4

From 1st of October ,we start getting following error, before that it was working fine...

We are on Drupal 9, CiviCRM 5.33.5 version.

Issue is with Paypal Pro.

Oct 04 18:55:19  [error]
$Fatal Error Details = array:3 [
  "message" => "cURL error 61: Unrecognized content encoding type. libcurl understands deflate, gzip content encodings. (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)"
  "code" => null
  "exception" => GuzzleHttp\Exception\RequestException {#1903
    -request: GuzzleHttp\Psr7\Request {#1900
      -method: "POST"
      -requestTarget: null
      -uri: GuzzleHttp\Psr7\Uri {#1892
        -scheme: "https"
        -userInfo: ""
        -host: "api-3t.paypal.com"
        -port: null
        -path: "/nvp"
        -query: ""
        -fragment: ""
      }
      -headers: array:3 [
        "Content-Length" => array:1 [
          0 => "570"
        ]
        "User-Agent" => array:1 [
          0 => "GuzzleHttp/6.5.5 curl/7.58.0 PHP/7.3.31-1+ubuntu18.04.1+deb.sury.org+1"
        ]
        "Host" => array:1 [
          0 => "api-3t.paypal.com"
        ]
      ]
      -headerNames: array:3 [
        "content-length" => "Content-Length"
        "user-agent" => "User-Agent"
        "host" => "Host"
      ]
      -protocol: "1.1"
      -stream: GuzzleHttp\Psr7\Stream {#1894
        -stream: stream resource {@162
          wrapper_type: "PHP"
          stream_type: "TEMP"
          mode: "w+b"
          unread_bytes: 0
          seekable: true
          uri: "php://temp"
          options: []
        }
        -size: 570
        -seekable: true
        -readable: true
        -writable: true
        -uri: "php://temp"
        -customMetadata: []
      }
    }
    -response: GuzzleHttp\Psr7\Response {#1904
      -reasonPhrase: "OK"
      -statusCode: 200
      -headers: array:9 [
        "Connection" => array:1 [
          0 => "keep-alive"
        ]
        "Date" => array:1 [
          0 => "Mon, 04 Oct 2021 23:55:19 GMT"
        ]
        "Cache-Control" => array:1 [
          0 => "max-age=0, no-cache, no-store, must-revalidate"
        ]
        "Paypal-Debug-Id" => array:1 [
          0 => "2f618f7278897"
        ]
        "X-Paypal-Operation-Name" => array:1 [
          0 => "DoDirectPayment"
        ]
        "HTTP_X_PP_AZ_LOCATOR" => array:1 [
          0 => "ccg13.slc"
        ]
        "Strict-Transport-Security" => array:1 [
          0 => "max-age=31536000; includeSubDomains"
        ]
        "x-encoded-content-encoding" => array:1 [
          0 => "NVP"
        ]
        "x-encoded-content-length" => array:1 [
          0 => "187"
        ]
      ]
      -headerNames: array:9 [
        "connection" => "Connection"
        "date" => "Date"
        "cache-control" => "Cache-Control"
        "paypal-debug-id" => "Paypal-Debug-Id"
        "x-paypal-operation-name" => "X-Paypal-Operation-Name"
        "http_x_pp_az_locator" => "HTTP_X_PP_AZ_LOCATOR"
        "strict-transport-security" => "Strict-Transport-Security"
        "x-encoded-content-encoding" => "x-encoded-content-encoding"
        "x-encoded-content-length" => "x-encoded-content-length"
      ]
      -protocol: "1.1"
      -stream: GuzzleHttp\Psr7\Stream {#1902
        -stream: stream resource {@164
          wrapper_type: "PHP"
          stream_type: "TEMP"
          mode: "w+b"
          unread_bytes: 0
          seekable: true
          uri: "php://temp"
          options: []
        }
        -size: 0
        -seekable: true
        -readable: true
        -writable: true
        -uri: "php://temp"
        -customMetadata: []
      }
    }
    -handlerContext: array:34 [
      "errno" => 61
      "error" => "Unrecognized content encoding type. libcurl understands deflate, gzip content encodings."
      "appconnect_time" => 0.110807
      "url" => "https://api-3t.paypal.com/nvp"
      "content_type" => null
      "http_code" => 200
      "header_size" => 358
      "request_size" => 722
      "filetime" => -1
      "ssl_verify_result" => 0
      "redirect_count" => 0
      "total_time" => 2.862486
      "namelookup_time" => 0.004156
      "connect_time" => 0.037036
      "pretransfer_time" => 0.110853
      "size_upload" => 570.0
      "size_download" => 187.0
      "speed_download" => 65.0
      "speed_upload" => 199.0
      "download_content_length" => 187.0
      "upload_content_length" => 570.0
      "starttransfer_time" => 2.862108
      "redirect_time" => 0.0
      "redirect_url" => ""
      "primary_ip" => "173.0.88.69"
      "certinfo" => []
      "primary_port" => 443
      "local_ip" => "198.58.111.95"
      "local_port" => 36104
      "http_version" => 2
      "protocol" => 2
      "ssl_verifyresult" => 0
      "scheme" => "HTTPS"
      "curl_version" => "7.58.0"
    ]
    #message: "cURL error 61: Unrecognized content encoding type. libcurl understands deflate, gzip content encodings. (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)"
    #code: 200
    #file: "/var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php"
    #line: 201
    trace: {
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:155 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:105 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php:43 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:28 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:51 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php:66 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Middleware.php:29 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php:70 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Middleware.php:59 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/HandlerStack.php:71 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Client.php:351 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Client.php:162 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Client.php:182 { …}
      /var/www/web/domain.org/vendor/guzzlehttp/guzzle/src/Client.php:95 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Payment/PayPalImpl.php:1051 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Payment/PayPalImpl.php:562 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Payment.php:1374 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Payment/PayPalImpl.php:493 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Contribute/BAO/Contribution/Utils.php:173 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Contribute/Form/Contribution/Confirm.php:2307 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Contribute/Form/Contribution/Confirm.php:688 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Form.php:513 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/StateMachine.php:144 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/QuickForm/Action/Next.php:43 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/packages/HTML/QuickForm/Controller.php:203 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/packages/HTML/QuickForm/Page.php:103 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Controller.php:347 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php:312 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php:68 { …}
      /var/www/web/domain.org/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php:36 { …}
      /var/www/web/domain.org/web/modules/contrib/civicrm/src/Civicrm.php:88 {
        Drupal\civicrm\Civicrm->invoke($args)
        › ob_start();
        › $content = \CRM_Core_Invoke::invoke($args);
        › $output = ob_get_clean();
        arguments: {
          $args: array:3 [ …3]
        }
      }
      /var/www/web/domain.org/web/modules/contrib/civicrm/src/Controller/CivicrmController.php:80 { …}
      Drupal\civicrm\Controller\CivicrmController->main() {}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:123 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/Render/Renderer.php:573 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:124 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:97 { …}
      /var/www/web/domain.org/vendor/symfony/http-kernel/HttpKernel.php:158 { …}
      /var/www/web/domain.org/vendor/symfony/http-kernel/HttpKernel.php:80 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/StackMiddleware/Session.php:57 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php:47 { …}
      /var/www/web/domain.org/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:106 { …}
      /var/www/web/domain.org/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:85 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php:47 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php:52 { …}
      /var/www/web/domain.org/vendor/stack/builder/src/Stack/StackedHttpKernel.php:23 { …}
      /var/www/web/domain.org/web/core/lib/Drupal/Core/DrupalKernel.php:706 { …}
      /var/www/web/domain.org/web/index.php:19 { …}
    }
  }
]

Anybody have idea about this ?

Here is code block which initiated the above call. vendor/civicrm/civicrm-core/CRM/Core/Payment/PayPalImpl.php :

$response = (string) $this->getGuzzleClient()->post($url, [
  'body' => $nvpreq,
  'curl' => [
    CURLOPT_RETURNTRANSFER => TRUE,
    CURLOPT_SSL_VERIFYPEER => Civi::settings()->get('verifySSL'),
  ],
])->getBody();
4
  • 1
    We are on Drupal 7 with CiviCRM 5.41.0 and getting the same issue.
    – Logan Bear
    Oct 8 at 17:23
  • Same issue on CiviCRM 5.41.1 and CiviCRM 5.39.0 (both websites running latest release of Drupal 7) Oct 8 at 20:10
  • We were getting the same issue for a few days... really inconsistent, most payments would go through, but some would get this error. The last time we got this error was Oct 8 9:43am (pacific). Have not seen it since. Oct 13 at 16:41
  • @JoseTorres, same case with us, it was started on 1st of oct and then may be ended on Oct 8-9. but it stopped. Oct 14 at 16:04
1

I am receiving this as well on a WordPress site, so it's unlikely civicrm specific. Debugging inside WordPress' wp_remote_post function has been annoying, so I was happy to see your findings.

I suspect the clue is this line here in the response:

"x-encoded-content-encoding" => array:1 [
          0 => "NVP"
        ]

After decoding the response, I think cURL usually throws the content-encoding header away, but guzzle maintains the original value in x-encoded-content-encoding.

NVP is definitely not a valid value for content-encoding.

Obviously, NVP is legacy, so it will likely be difficult to convince PayPal to admit to this, or make any corrections to stop sending this header.

I did note that CURLOPT_HTTP_CONTENT_DECODING is a libcurl option that is true by default, but can be set to false to skip response decoding and just pass the content raw. I'm wondering if that might help to get past the error.

Please let me know if this results in success, as I would be very interested to know for my own challenge!

0

UPDATE: Looking closer at the log maybe it's not the certificate issue. The Oct 1 date made me think it might be. Are you able to see what $nvpreq looks like and then run the command manually to see what the content-encoding header of the response really is? e.g. something like curl -X POST -i -d '..insert contents of $nvpreq here...' https://api-3t.paypal.com/nvp


The error might be misleading. My guess is this is the LetsEncrypt issue that's been coming up since Oct 1. https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/

The php/openssl root certificates file on the server probably needs updating.

1
  • using curl -X POST... getting following TIMESTAMP=2021%2d10%2d09T11%3a37%3a27Z&CORRELATIONID=91ccf88d441e9&ACK=Failure&VERSION=3&BUILD=55025969&L_ERRORCODE0=10606&L_SHORTMESSAGE0=Transaction%20cannot%20be%20processed%2e&L_LONGMESSAGE0=Transaction%20cannot%20be%20processed%2e&L_SEVERITYCODE0=Error&AMT=1%2e00&CURRENCYCODE=USD Thats ok because i used dummy card on live processor. Oct 9 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.