webscraperio / api-client-php

cloud.webscraper.io API client
MIT License
10 stars 13 forks source link

Message: cURL error 6: Could not resolve host: api.webscraper.io #2

Closed theofficejackpot closed 4 years ago

theofficejackpot commented 4 years ago

About every hour I'll get a message like this from my php batch program and it stops it dead in its tracks.

I read a stack overflow post that said:

Error : CURL Error: 35 - OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to httpapi.com:443 (IP: 162.x.x.x & 204.x.x.x)

Incase of WHMCS:

You can contact your host to whitelist the IP address at their end to use their API.

Uncaught WebScraper\ApiClient\WebScraperApiException: Unexpected status code 0. Message: cURL error 6: Could not resolve host: api.webscraper.io (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in /home/div/public_html/vendor/webscraperio/api-client-php/src/ApiClient/HttpClient.php:97
Stack trace:
#0 /home/div/public_html/vendor/webscraperio/api-client-php/src/ApiClient/Client.php(148): WebScraper\ApiClient\HttpClient->requestRaw('GET', 'scraping-job/17...', Array)
#1 /home/div/public_html/cloudscrape-jobdetails.php(357): WebScraper\ApiClient\Client->downloadScrapingJobJSON(1742555, '/tmp/scrapingjo...')
#2 /home/div/public_html/cloudscrape-jobdetails.php(326): downloadScrapeJob(1742555, Object(mysqli))
#3 /home/div/public_html/cloudscrape-jobdetails.php(43): processJobs(Object(mysqli))
#4 {main}
  thrown in /home/div/public_html/vendor/webscraperio/api-client-php/src/ApiClient/HttpClient.php on line 97
martinsbalodis commented 4 years ago

The error Could not resolve host: api.webscraper.io means that there was a problem between client server and Web Scraper's DNS server. Web Scraper's DNS configuration is hosted in AWS cloud which has high availability configuration and is online almost always with some exception. You can check whether there is a disruption in AWS route 53 service availability here https://status.aws.amazon.com/ . If there aren't any DNS service disruptions then most likely the problem is on client side.