Laravel's "php artisan horizon" when active, causes all external API calls using curl to fail

113 views Asked by At

I have deployed a laravel 8 project on cpanel, installed and configured laravel horizon package to handle jobs and queues in the project. once configured, we need to configure the PHP artisan horizon to always be active and running, and this is done using supervisor. Apart from the laravel horizon package that is installed, laravel horizon uses redis and pcntl extension to handle queues.

The issue is, when the PHP artisan horizon command is not running, all http client calls to external sites or APIs work fine but when the command is running, I get the following error:

 [2023-08-02 13:12:21] local.ERROR: cURL error 6: getaddrinfo() thread failed to start (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://artx.sochitel.com/api.php {"userId":15692,"exception":"[object] (Illuminate\\Http\\Client\\ConnectionException(code: 0): cURL error 6: getaddrinfo() thread failed to start (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://artx.sochitel.com/api.php at /home/www/xaf.secured.rechargeandgetpaid.cm/vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php:711)
[stacktrace]
#0 /home/www/xaf.secured.rechargeandgetpaid.cm/vendor/laravel/framework/src/Illuminate/Support/helpers.php(234): Illuminate\\Http\\Client\\PendingRequest->Illuminate\\Http\\Client\\{closure}()
#1 /home/www/xaf.secured.rechargeandgetpaid.cm/vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php(713): retry()
#2 /home/www/xaf.secured.rechargeandgetpaid.cm/vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php(596): Illuminate\\Http\\Client\\PendingRequest->send()
 ...

Please what can I do to keep the command php artisan horizon running without affecting the curl requests to external sites when necessary?

The laravel horizon configurations don't pose a problem; when I deactivated the command php artisan horizon, the http calls to external sites using curl works just fine but when I run the command and it is active, it gives me the error:

***cURL error 6: getaddrinfo() thread failed to start (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://artx.sochitel.com/api.php\*\*

0

There are 0 answers