question

Jonathan Ryan Grice avatar image
Jonathan Ryan Grice asked ·

Server can not connect with Clover Rest API

I've been working on a project and now my server gives me the error:
Could not resolve host: api.clover.com

Is this an issue with Clover, routing on the internet, or has my server IP been blacklisted?
REST API
5 comments
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Can you provide the http response code that comes with the error? Any additional details about the error would be helpful as well. That way we can see if it is indeed a 429 Too Many Requests response code, which would indicate rate limiting.

0 Likes 0 · ·

in PHP Curl returns the curl_error($ch) as simply "Could not resolve host: api.clover.com"

no other information is received from cURL.

I don't receive any response from Clover.

0 Likes 0 · ·

Can you try using curl_getinfo:

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

to get the http response code?

0 Likes 0 · ·
Show more comments

I can still send a GET call from my location and receive the requested information. Just not from my remote host.

The same thing happened a few days ago and it resolved itself within a few hours. I figure it'll again resolve itself, but it's getting frustrating.

0 Likes 0 · ·
Raymond Lee avatar image
Raymond Lee answered ·
Looking more into your issue, and since it is intermittent, it sounds like it might be related to this issue brought up on stack overflow. I would check to see if you still get "Could not resolve host" after forcing curl to use IPv4.
3 comments Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I just tried that "fix" from stack overflow.

After further investigation, I'm getting a code 6 returned, not just 404.

I have implemented a custom logger that will log the url queued and then the curl error. And for some reason, it's becoming very intermittent. Not just once in a few hours. You can view the live log here

0 Likes 0 · ·

Understood. Seems to be a DNS issue on your server, I would try adding Google's DNS server as the second fix, since you've already disabled IPv6, see here.

0 Likes 0 · ·

I don't have root access on this particular server since it's a shared server. Thanks, will look for other workaround. Cheers.

0 Likes 0 · ·
Jonathan Ryan Grice avatar image
Jonathan Ryan Grice answered ·
This issue has crept back up.
Could not resolve host: api.clover.com

I shouldn't be reaching an API Rate Limit and penalized for doing so.
I can't think of what the issue is.
Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jonathan Ryan Grice avatar image
Jonathan Ryan Grice answered ·
The issue resolved itself.
Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community