Skip to content
Advertisement

nginx – cURL Error: getaddrinfo() thread failed to start

I’m running a WooCommerce shop and have a Laravel system that retrieves data from our ERP system. This part works just fine. The Laravel system compares differences in products and push out all changes to WooCommerce (product updates and so on).

When I look at the log, many of these API request replies with: "cURL Error: getaddrinfo() thread failed to start". It’s periodic (don’t occur on all update requests)… If I restart the request, it always success the second time.

I’ve tried to Google any related issues, and it seems like it’s a configuration issue on my WooCommerce (I host this myself using Plesk). The DNS is handled by Cloudflare. allow_url_fopen is enabled. I’ve tried static, ondemand and dynamic in pm (PHP-FPM setting) and have recalculated the pm.max_children and increase pm.max_requests.

I’ve tried to renew the SSL certificate.

I’ve tried to look through logs to see if I can find anything being logged, but nothing interesting here.

The WooCommerce server is dedicated with 64 GB mb and 8 core 6700 intel, so it shouldn’t be a performance issue.

The Laravel is running on a Cloudserver, 2 vCPU and 4 GB memory. The requests are done using guzzle.

Anyone with experience in this error, and can guide me in some direction?

Advertisement

Answer

I thought it was the receiver (WooCommerce) that caused this bug, but it seems like the bug was caused by Laravel. My job queue was initially build with a loop where I iterated through all 50.000 products in one job-queue, if I instead split the task into 50.000 single job instances (1 update for each job), it finish without leaving any bugs.

I think the bug was related to ulimit (too many files open at the same time) as @cbr pointed out, because the job is not cleaning up / closing files while the job is running. I used https://github.com/Codexshaper/laravel-woocommerce but have changed to the native https://github.com/woocommerce/wc-api-php package and this might have an impact aswell. It seems like Codexshaper is creating a new WooCommerce Client instance every single time an request is being made, and I think that could cause some problems.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement