evolution-api icon indicating copy to clipboard operation
evolution-api copied to clipboard

504 Gateway Time-out nginx/1.18.0 na geração do qrcode

Open Guilhermesf27 opened this issue 1 month ago • 1 comments

Welcome!

  • [x] Yes, I have searched for similar issues on GitHub and found none.

What did you do?

Estou tendo um problema na hora de gerar o qrcode, estou com 200 pessoas conectadas, porem para gerar o qr esta dando timeout

app.post('/generate-qr', asyncHandler(async (req, res) => { const { companyId } = req.body; if (!companyId) return res.status(400).json({ success: false, message: 'companyId é obrigatório' });

const delay = (ms) => new Promise(r => setTimeout(r, ms));

try { let status = await checkConnectionStatusWithRetry(companyId); if (!status.exists) { try { await createInstance(companyId); } catch (err) { const messages = err.response?.data?.response?.message || err.response?.data?.message; const isNameInUse = err.response?.status === 403 && Array.isArray(messages) && messages.some(msg => String(msg).includes('already in use')); if (!isNameInUse) throw err; } }

await initiateQrGeneration(companyId);

let qrCode = null;
for (let i = 0; i < 3; i++) {
  try { qrCode = await getQRCode(companyId); break; }
  catch { await delay(2000); }
}

let qrCodeDataURL = null;
try {
  if (typeof qrCode === 'string') {
    qrCodeDataURL = qrCode.startsWith('data:image') ? qrCode : await QRCode.toDataURL(qrCode);
  }
} catch {}

return res.json({ success: true, qr: qrCode, qrCodeDataURL, base64: qrCodeDataURL });

} catch (error) { trackError('generateQR', { companyId, error: error.message }); return res.status(500).json({ success: false, message: 'Erro ao gerar QR', error: error.message }); } }));

What did you expect?

,

What did you observe instead of what you expected?

,

Screenshots/Videos

No response

Which version of the API are you using?

2.3.6

What is your environment?

Windows

Other environment specifications

No response

If applicable, paste the log output

No response

Additional Notes

No response

Guilhermesf27 avatar Nov 27 '25 13:11 Guilhermesf27

image: evoapicloud/evolution-api:v2.3.6

Guilhermesf27 avatar Nov 27 '25 13:11 Guilhermesf27