How to fix an “Unexpected error communicating with Stripe …

At the time of ordering, some websites started to display "Unexpected error communicating with Stripe ... (Network error[errno 2] : easy handle already used in the multi handle) ". If you are facing such problem with your site, this article will show you how to fix it.

How to fix an

We got the message “Unexpected communication error with Stripe – Network error Errno 2” suddenly on the website of one of my clients using Magento. The text entered as the error message was “If this problem persists, please let us know at support@strip.com [Network error Errno 2]. This was an unusual error, as the error code was different from some of the error codes we were used to seeing.

 

Learn more about the issues and technology, causing the errno 2 network error.

From our findings, we understood that the problem is not explicitly related to Magento 2 but the CURL version. For example, many people have reported on GitHub and Stack Overflow how their Stripe suddenly stopped working. Or their email system could not work and displayed the Network error[errno 2]. A discussion on GitHub shows that the issue is still being investigated. If you are using a different technology than Magento, you can check this link to understand how to fix your site’s problem.

 

How to fix network error errno 2 on Magento 2 for Stripe?

If you encounter a network error[errno 2] on your website Magento 2, which is preventing your band or payment method from working, you can do the following:

  • Go to your Magento 2 installation folder.
  • Check the file “seller / Stripe / Stripe-php / lib / HttpClient / CurlClient.php”.
  • Then modify:
protected $enablePersistentConnections = true;

for

protected $enablePersistentConnections = false;
  • Finally, save and try to check out.

If you follow the steps above, you will find that your order will work fine.

Other solutions to fix the problem

From the discussion on the internet, some people could solve the problem by using either of these methods:

  • Update the version of their server,
  • Downgrade their version of curl or
  • Update of their website.

Conclusion and final remark

The problem may occur on other modules of your website. From what I understand, setting the persistent connection / HTTP keep-alive to false will give you a temporary fix. As a member of the Stripe support team mentioned, the approach suggested above is a temporary fix. Internal investigations are still ongoing. I am commenting here by GitHub. “Note, however, that this is only a workaround, not a proper fix, and is suboptimal, as it disables persistent connections (meaning that every request to Stripe’s API will create a new connection, resulting in additional latency). ”

Thanks for reading. I hope this article helps you save a few hours. If you need help with any of your Magento projects, you can contact us.

Leave a Reply

Do you want a quality website, ecommerce or tools?

Please leave us a message, and an expert will contact you within the next few hours for a free 15 min consultation

Free Estimate