you had errors in the last hour?
Getting these 504ās again today. Iām dealing with this in a production environment (happening on dev as well) and itās causing some major issues. Anyone have any solution to this? Itās starting to becoming frustrating dealing with this constantly.
Now it looks like a problem on our side.
Hey, we are seeing these problems as well. We see ā504 Gateway Timeoutā under heavy load when calling GetNFTs. Any pointers?
can you share more information, as an example of a request that gets that error?
you can share it in DM if you donāt want to post it publicly.
Apologies for waking a āsleepingā thread, but Iām having this same issue randomly as well.
Been testing an app in beta. It runs fine for hours at a time (even overnight), but will randomly start getting blocked by CloudFlare. No amount of rebooting or waiting works. I end up having to acquire a different IP (via VPN or otherwise), and everything starts working again.
While I recognize the need to protect endpoints, an issue like this is absolutely not tolerable on a paid plan.
In case that you are using walletconnect then there is a rate limit per IP for the public RPC url that is used. If you try it too many times then you will get that rate limit error.
Iām making use of direct Mongo connections and V1 Web3API
calls. The application is a NodeJS app. I generate a āsingletonā Moralis instance and use it throughout the entire application. It does generate a decent number of calls, and while I might expect one or two calls to get bounced, I definitely donāt expect CloudFlare to get involved. š«
For what url in particular you get errors?
Most recently Web3API.token.getTokenPrice
. But it seems fairly random. We make use of a substantial portion of the Web3API
calls.
But the bigger issue is that the IP gets blocked. Not sure if itās permanent, but long enough that we must change it, and of course manually change the IP for Mongo access.
Can you check the http headers for when you get those errors? How many requests do you make?
You shouldnāt get easily blocked for that request unless you make thousands per second
Iāve already cleared the most recent series of errors and logs. Letting it run again overnight and Iāll check it in the morning.
Not making thousands per second, but some bursts between 50-200 per second. Weāre making various calls regarding Swap
āactorsā. Token prices, holder information, etc. ā for multiple token swaps at a time.
Iām offloading as much as possible to direct contract calls, but we canāt always rely on a contract to be verified or the source to be accessible, so we rely on Moralis in those instances.
Regardless, it would be nice to know what the explicit limitations were in all circumstances so as to code around it (or drop the feature(s)).
You donāt get rate limited for 200 requests per second?
FYI, this is my second time posting this ā from the same test IP. The first reply apparently got blocked due to, well, CF/Moralis blocking traffic. Swapped my IP and now this works.
Yes, I will occasionally get transactions rejected during bursts, but CF doesnāt usually step in and completely block my IP in those situations. But, for some reason, at some point, CF/Moralis decides it doesnāt want to hear from us anymore and simply blocks the IP.
Here is the most recent error output. Not sure if it pertains to the issue, but it happened hours ago while I was asleep:
2022-08-29T06:44:20.375Z - Error: {}
at fetch (/moralis-server/lib/cloud-code/plugins/helpers/apiUtils.js:218:26)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-08-29T06:44:20.368Z - Failed running cloud function getTokenBalances for user undefined with:
Input: {"chain":"bsc","address":"0xD4825ad5B1A863587e7116f3DE1387C1238e4319","to_block":"20858573"}
Error: {"message":"{}","code":141}
2022-08-29T04:57:32.391Z - Error: Invalid function: "getPluginSpecs"
at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:201:13)
at /moralis-server/lib/PromiseRouter.js:85:20
at processTicksAndRejections (node:internal/process/task_queues:96:5)
For what itās worth, Get all logs in your terminal:
Learn about Moralis CLI is a dead link and needs to be fixed.
you are using a Moralis Server to make web3api requests from a backend?
asking because that looks like server log
in that case what IP was blocked, your local IP, server IP?
Itās a node application. Yes, just using the existing Web3API
collection (rather than axios/fetch with endpoints on the backend). Is the EVM
object available in V1? What do you recommend?
There are a few devices (hardware and docker) behind the same VPNāed firewall so theyāre all sharing the same external IP. But only one VM is interacting with Moralis. Itās blocking that shared VPN IP
I recommend to use web3api directly without a Moralis Server, either using moralis v1 sdk with moralisSecret parameter, or REST API, or moralis v2 SDK
But what about the various API-limited calls? Donāt I need server credentials to increase limits?
Is the REST API not ālimitedā?
This is basically what Iām using:
const Moralis = require('moralis-v1/node');
const options = {
serverUrl: dAppServerUrl,
appId: appId,
masterKey: masterKey,
};
await Moralis.start(options);
Iām using that object to then make the majority of calls. Whatās the problem with that specifically?
you should use only moralisSecret for those options if you only use web3api
you donāt need to increase those limits, those limits can not be increased more than the limits that you have for your account, increasing them more will make it hit the account rate limit
These are the relevant calls we make to the Moralis object from the app:
...Web3API.token.getTokenMetadata
...Web3API.token.getTokenPrice
...Web3API.native.getTransaction
...Web3API.account.getTokenBalances
...Web3API.native.getLogsByAddress
...Plugins.oneInch.getSupportedTokens
...Web3API.defi.getPairAddress
...Web3API.defi.getPairReserves
...Cloud.run
You mind providing a specific example of one that youād swap out for a different SDK or call?