[SOLVED] Connection Failed?

Hi - Iā€™ve been using the webAPI for some time now without issue. I have a new development server that I started up this week and the new server only allows me to call the API once, and then all subsequent attempts return ā€œConnection Failureā€

I am sending a get request to ā€œhttps://deep-index.moralis.io/api/v2/nft/ā€ for a particular address.

Like I mentioned, it works perfect the first time, but if I call the same link again it fails. I am able to call other servers fine so I dont think its an issue on my side. And given it works once wouldnā€™t imagine its a firewall or port issue on my server.

Are you blocking certain IPs after the first request given this is a new server? Any ideas?

@tethrr
I have raised request to the support team internally, you will get a quick response on this.

it looks like you are making a request directly to deep-index url.

it shouldnā€™t return that error for the second request. if you try a request to any other endpoint you get same behaviour? can you give more details about that request? does it work from the old server?

Thanks for the replies so far. Here is more informatoin:

Here is the full request from the new server.

I am using Coldfusion on this server but itā€™s a basic URL request. It worked 1 time and returned a full json response as expected, but ever since it errors and I get ā€œConnection Failureā€

The same exact code works great on my main server. Tethrr.io. It returns the full json response and I can call it as many times in a row as I want and it returns the right information each time.

For additional tests:
On the new server if I call instead

or

Both work fine - so I donā€™t think its a port issue or firewall issue on my new server. Iā€™m wondering if you are blocking my new server from calling deep-index?

As another update - decided to try to sign up for a new API key for the new server - but same outcome - so its not the API key. Wonder if the service somehow flagged the IP for my new server? Still not working though.

still strange.
(Some code is missing in the above reply.)
If you try it once, it works, after that it doesnā€™t work, but if you try later again, it works again only once?

If the code works on a server and not on another server, it shouldnā€™t be related to the API key.

If you try that request directly with CURL, it works fine?

CURL works great, tried it just now and hit refresh a bunch of times, it works as many times as I want, no problem at all.

Tried a few other things morning using the existing http call, tried to connect to the site using IP vs the deep-index.moralis.io link. That didnā€™t make a difference, it still errored.

So then I tried removing the secure link, and just called the http:// and the IP directly and got an interesting response. I got a error: 1003 which via Google is a custom error message from Cloudflare that an IP is not allowed. I believe that is the problemā€¦ Cloudflare allowed the first request through but then blocked the IP for some reason. Every once in awhile it refreshes and allows a single request through but then blocks it again.

So I think whatā€™s happening is Cloudflare is actually blocking my dev server IP from accessing the REST API. Not sure why - Iā€™m only making a handful of calls, Iā€™m not spamming the API. This is a virtual private server so wonder if Cloudflare has an IP range blocked or something? Can anyone help - Moralis is the backbone of this service I am working on and its DOA at the moment as I canā€™t call anything!

CURL works from that dev server or from a different place?

From the dev server - I remoted into it and ran CURL from command line
and it worked fine.

then is has to be related to the software that makes the requests, if it works with CURL from the same server.

Doesnā€™t Curl use a different port though? Iā€™m asking, not a Curl expert.

no, it uses same port, the port is specific to the url that it tries to access

Thanks so much for the help, finally fixed it. It was a problem with the Java version I had and deep-index SSL cert. What a pain!

1 Like