0

My React app randomly throws an error every time I request data from the API using Axios, but it just happened sometimes. When the error shows up, it says that the connection is reset (ECONNRESET) and tls.onwrap and if I refresh the page it's working again. But after some time, it'll happen again.

Pic

What makes it very odd is that the error only happens in the production environment. If I open it in the development environment, everything is okay. Then we checked the TLS version, we used Cloudflare. So we changed the TLS version from 1.0 to 1.2. But the error still occurred.

So what could have been possibly wrong ? is it because of the SSL? because the production environment is using the https protocol or is it because of the axios ?

hazardous
  • 10,627
  • 2
  • 40
  • 52
Loris Tujiba
  • 131
  • 7
  • How are you hosting your backend? This could happen for many reasons and is most probably a server issue. A common cause is when TLS certificate chain does not contain CA certificates. If _some_ calls to your server complete successfully and others fail, there's a problem in TLS configuration in load-balancing. In a load balanced setup, _if_ TLS termination is being done on the actual servers, instead of the load balancer, then you should also check if one of the servers TLS setup is not configured correctly. – hazardous Aug 20 '18 at 05:55
  • Ya, we use nginx. For the backend, we use Laravel. We also run Cloudflare on both front and back. We also checked the memory limit on both platform, and there's still much memory left. Right now, we're still checking the CA certificate – Loris Tujiba Aug 21 '18 at 02:00
  • And also in the header section, whenever we request something. There's cf-railgun, waiting for WAN connection – Loris Tujiba Aug 21 '18 at 04:12
  • I haven't worked with laravel or cf-railgun, I will tag the question with these topics and hopefully you might get a knowledgeable response. In my opinion this should be tls configuration issue. All the best! – hazardous Aug 21 '18 at 16:05
  • 1
    I just created test pages on the app. One will request data from dummy API (https://jsonplaceholder.typicode.com/posts), and the other will request data from our API. Turns out, if we use the dummy one, there's no error. But if we use our API, the ECONNRESET shows up. both are https, so i guess we have a problem in our ssl – Loris Tujiba Aug 23 '18 at 10:30

0 Answers0