0

We have been using the same script and configuration from many months and it was working fine. Suddenly the curl started failing a few hours back with the error that could not reoslve host. I tested the host with postman and it works. Also I changed the host to google.com but getting the same error.

Didn't change any machine or server configuration overnight.

Any pointers .. it is a production stop for us.

here is error log from curl

array(26) {
  ["url"]=>
  string(37) "https://google.com/callback/abcd"
  ["content_type"]=>
  NULL
  ["http_code"]=>
  int(0)
  ["header_size"]=>
  int(0)
  ["request_size"]=>
  int(0)
  ["filetime"]=>
  int(-1)
  ["ssl_verify_result"]=>
  int(0)
  ["redirect_count"]=>
  int(0)
  ["total_time"]=>
  float(0.000121)
  ["namelookup_time"]=>
  float(0)
  ["connect_time"]=>
  float(0)
  ["pretransfer_time"]=>
  float(0)
  ["size_upload"]=>
  float(0)
  ["size_download"]=>
  float(0)
  ["speed_download"]=>
  float(0)
  ["speed_upload"]=>
  float(0)
  ["download_content_length"]=>
  float(-1)
  ["upload_content_length"]=>
  float(-1)
  ["starttransfer_time"]=>
  float(0)
  ["redirect_time"]=>
  float(0)
  ["redirect_url"]=>
  string(0) ""
  ["primary_ip"]=>
  string(0) ""
  ["certinfo"]=>
  array(0) {
  }
  ["primary_port"]=>
  int(0)
  ["local_ip"]=>
  string(0) ""
  ["local_port"]=>
  int(0)
}

string(34) "Could not resolve host: google.com"

I have tried restarting apache2 as well as my PHP-FHM. Nothing helped.

dgarg
  • 318
  • 1
  • 3
  • 13
  • This is not curl issue, this is your server's DNS configuration. This might help you https://stackoverflow.com/questions/24967855/curl-6-could-not-resolve-host-google-com-name-or-service-not-known – Mohsen Nazari Jul 17 '21 at 08:42

1 Answers1

0

I could fix the problem after restarting my VM. what happened was my VM ran out of disk. This caused many processes to stop. When the disk was finally made available, most processes were back except one kprocess. Restarting the virtual machine did the job. I dont know how to fix it without restarting the machine.

dgarg
  • 318
  • 1
  • 3
  • 13