[RESOLVED] Unable to upload files to IPFS using Moralis API due to rate limiting

Hello hello.

I’ve been using Moralis’ uploadFolder API to upload nft images & metadata for some time now & they’ve been able to upload most of the time without any hiccups.

Today, I hit this error & have been unable to upload anything to IPFS since :

{
  code: 141,
  error: 'This Moralis Server is rate-limited because of the plan restrictions. See the details about the current rate and throttle limits: {"x-rate-limit-limit":"25","x-rate-limit-remaining-ttl":"5","x-rate-limit-used":"30","x-rate-limit-remaining-ip-ttl":"5","x-rate-limit-ip-used":"30"}'
}

How it was called :

// NOTE: 'json_file_path' & 'json_file_content' are just example variables here, actual data was uploaded.
const ipfsArr = [{ path: json_file_path, content: json_file_content }];

const options = { abi: ipfsArr };
const data = await Moralis.Web3API.storage.uploadFolder(options);

console.log(data);

I am currently on the free server, I know free servers are rate limited to 1 request per second only for uploadFolder but I have waited for more than 1 second before trying again & it is still returning the same error.
It’s been like this the whole day no matter how long I waited, can anyone tell me what can I do to resolve this for free servers?

You can call it 5 times per second with a free plan if the compute unit cost is 5. It doesn’t work even once after you wait?

@cryptokid yes, it hasn’t been working since the first time I got the error today.

can you make a break 10 seconds and try again? you will continuously get that error if you never stop from making requests

When I had the error earlier today, I thought I should give it some time too. I stopped messing with it, went out for lunch, came back, tried again, still the same.

Again, I just came back from dinner & still getting the same error but the throttle limits are now like this:

{
  "x-rate-limit-limit":"25",
  "x-rate-limit-remaining-ttl":"1",
  "x-rate-limit-used":"30",
  "x-rate-limit-remaining-ip-ttl":"1",
  "x-rate-limit-ip-used":"30"
}

I am trying to upload just 1 JSON metadata file & calling it once only.

I tried now to use upload folder with your API key, it worked without issues

I found my mistake, I forgot to initialize Moralis before I call uploadFolder.

I was using the uploadFolder the axios way previously before switching to the Moralis.Web3API way after hitting that error using axios. Thank you for your help. :slightly_smiling_face:

1 Like