Random 504 timeouts on public gateway


I’m recently randomly getting 504 errors on files through the IPFS gateway.

Example : https://ipfs.infura.io/ipfs/QmVVZ4Kng7Eg8YZ9TiwAPYoiM9qZcX2HWsH38HJako7URr

The response is randomly or OK, or a timeout.

Any ideas ?

Sorry for the issues you are experiencing, when was the last time you saw these errors? Can you provide an example of the code you’re using to send the request and the full error response?

Hi Mike, thanks for your answer. I had the problems when I posted, now it seems I don’t get timeouts any more!

The code is basic:

const response = await fetch('https://ipfs.infura.io/ipfs/QmVVZ4Kng7Eg8YZ9TiwAPYoiM9qZcX2HWsH38HJako7URr')

Thanks that’s great to hear, we made some changes yesterday that will hopefully help alleviate this. Please let us know if it appears again.

In fact, sorry to say that it happens again, example: https://ipfs.infura.io/ipfs/QmTPMo6g3Z8zMgpYqD8hjShSfUX3XALvpPfv4wGyeUZssb

Edit: 20 minutes later, it’s fine again

Hi, now since 15 minutes we’re also getting 502 “Bad gateway” errors…

To upload the files, I’m using:

  1. Mainly ipfs-mini for JSON:

    const ipfs = new Ipfs({
    host: ‘ipfsDOTinfuraDOTio’,
    port: 5001,
    protocol: ‘https’

    const hash = ipfs.addJSON(json)

With the DOT replaced of course (can’t post my message with the dots)

  1. This custom code for base64 images:

    async function upload(_data) {
    let formData = new FormData()
    formData.append(‘data’, _data)
    const result = await fetch(
    api + ‘/add’, {
    method: ‘POST’,
    body: formData
    const json = await result.json()
    if (json) {
    return json.Hash
    } else {
    return false

Hi, I have same issue. When trying to cat files from IPFS, I am getting 504 gateway timeout. I cannot consistently reproduce it. Sometimes it happens sometimes it don’t. However, I can successfully cat files after 3-6 retries.

Hi Nikita,

Can you share some of the hashes for files you are getting a 504 on? Are these files you pinned elsewhere or on our pinning service.