Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

151
Visualizações
Firebase Cloud Function finished with status: 'response error'

I have a cloud function that is returning a lot of data (50'000 documents) as objects. When I run it I get the error finished with status: 'response error'.

This only happens when I export all of the data, when a limit (up to 20'000) is applied it works without problem. This lets me think that the response might be too big, but there is no info in the logs about this at all. Also adding try / catch does not work. In the console I only get the above message without any further indication.

I know that functions normally log when timeout is hit or the memory exceeded, so I am wondering what else could be the source of error.

exports.run = functions.runWith({ timeoutSeconds: 540, memory: '8GB' }).https.onRequest(async (req, res) => {
  try {
    const querySnap = await db.collection("myData").get();
    const data = querySnap.docs.map(doc => doc.data());
    return res.status(200).json({
      data: data
    }).end();

  } catch (err) {
    console.log(err);
    return res.status(400).end();
  }
});

EDIT: It is indeed the size of the response that causes this error. You can reproduce this if you simply return data of given size (with Buffer.alloc(bytes)).

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I thins you hit the max HTTP response size which is 10 MB for HTTP functions

Reference : https://cloud.google.com/functions/quotas#resource_limits with the screenshot below take from that ref.

enter image description here

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda