Skip to content

[META] QR Code / Pairing issues — tracking umbrella #2437

Description

@jpedrodouradoo-cell

Meta-issue consolidating all open QR Code / pairing-related reports.
Please do not open new QR Code issues — comment here instead.

Known symptoms

  • QR Code never appears, loading forever (/instance/connect returns {"count": 0})
  • QR Code is generated but invalid / expires immediately
  • Connects then drops: stream errored out (code 515) + Pre-key upload timeout (code 408)
  • Android devices cannot read QR while iOS can
  • Pairing code login succeeds but no message events received (401 / device_removed)
  • QR refreshes every 1 minute instead of WhatsApp's native 3 minutes
  • Endpoint /instance/qrcode returns 404 (v2.3.1)
  • Behind Cloudflare / nginx: 504 Gateway Timeout generating QR
  • Behind Coolify / Railway / Docker: QR not generated

Known working workaround (community-sourced, see #2463 for full walkthrough)

Set the following env vars and restart the container:

CACHE_REDIS_ENABLED=false
CACHE_LOCAL_ENABLED=true
DATABASE_SAVE_DATA_CHATS=false
DATABASE_SAVE_DATA_CONTACTS=false
DATABASE_SAVE_DATA_HISTORIC=false
DATABASE_SAVE_DATA_LABELS=false
CONFIG_SESSION_PHONE_VERSION=2.3000.1033773198

Root cause (per community analysis): the server chokes on CPU/RAM when Baileys generates pre-keys at the same time that the Meta history "tsunami" arrives, causing pre-key timeout → stream error 515 → device kick. Redis over Docker network adds latency; disabling history sync and switching to local cache removes the bottleneck.

Scope

This umbrella tracks the infrastructure-level QR/pairing problem. Sub-topics that deserve their own issue:

For maintainers

All duplicate QR Code issues are being closed with state_reason: duplicate pointing here. If you want to respond per-user, use this thread as the single source of truth.


This issue was reorganized from the original report ("Não gera QR Code da Instancia") as part of the 2026-04 issue triage. The original reporter (@jpedrodouradoo-cell) and all community contributors remain credited in the comment history.

Activity

  1. felipesroo commented on Feb 20, 2026

    @felipesroo

    Também estou com o mesmo problema, caiu do nada e não gera QR CODE. Versão: evoapicloud/evolution-api:v2.3.6.
    CONFIG_SESSION_PHONE_VERSION=2.3000.1028457684.

  2. mateustavaresruiz commented on Feb 20, 2026

    @mateustavaresruiz

    Mesmo problema

  3. joseEnfoqNext commented on Feb 20, 2026

    @joseEnfoqNext

    Same problem here

  4. FernandoBolzan commented on Feb 20, 2026

    @FernandoBolzan

    mesmo problema

    Será que tem relação? https://metastatus.com/whatsapp-business-api

  5. AllanVictor12 commented on Feb 20, 2026

    @AllanVictor12

    Mesmo problema

  6. viniciussricci commented on Feb 20, 2026

    @viniciussricci

    Estava tendo esse mesmo problema e no meu caso o meu servidor tentava fazer a comunicação com as rotas do whatsapp usando ipv6 e isso retornava um erro, e quando eu fazia manualmente com ipv4 ele funcionava, sendo assim coloquei no compose uma instrução para forçar o ipv4 sempre no docker compose da evolution e voltou a aparecer o qrCode, isso também resolveu meu problema de aparece 'open' a instancia e não funcionar direito como se tivesse desconectado.

    No compose eu adicionei:

    sysctls:

    • net.ipv6.conf.all.disable_ipv6=1
    • net.ipv6.conf.default.disable_ipv6=1
    • net.ipv6.conf.lo.disable_ipv6=1

    environment:
    # Forçar IPv4 (corrige VPS com IPv6 quebrado)
    - NODE_OPTIONS=--dns-result-order=ipv4first

    .... resto do environment,

    acho que pode ser um teste valido.

  7. cleytoncoro commented on Feb 20, 2026

    @cleytoncoro

    Todos aqui estão na hostinger?
    Pelos meus testes, estou desconfiado que toda a rede da hostinger está bloqueada do lado do facebook, em todas as CDNs.

    Vou subir um servidor na AWS após o almoço, ou talvez tentar uma vpn e confirmar isso. Aí volto aqui para trazer uma atualização.

  8. viniciussricci commented on Feb 20, 2026

    @viniciussricci
    Image

    Sim, a hostinger está com um problema com a meta, tive problema com 3 VPS.

  9. allanmr2 commented on Feb 20, 2026

    @allanmr2

    Mesmo problema aqui

  10. lab8792 commented on Feb 20, 2026

    @lab8792

    Mesmo problema. Tomara quer resolvam logo.

  11. felipesroo commented on Feb 20, 2026

    @felipesroo

    Se alguém tiver uma alternativa e puder compartilhar.

  12. zehdal commented on Feb 20, 2026

    @zehdal

    Não gera QR Code e não envia webhook. Minha VPS é da Hostinger também

  13. zehdal commented on Feb 20, 2026

    @zehdal
    Image Sim, a hostinger está com um problema com a meta, tive problema com 3 VPS.

    Webhook também não está enviando eventos né

  14. zehdal commented on Feb 20, 2026

    @zehdal
    Image Sim, a hostinger está com um problema com a meta, tive problema com 3 VPS.

    Meus Agentes IA pararam todos. Exatamente às 02:55 da manhã

  15. 99 remaining items

  16. marked QRCode não é gerado #2006 as a duplicate of this issue on Apr 22, 2026
  17. marked QR Code not generated #1900 as a duplicate of this issue on Apr 22, 2026
  18. marked QR Code not working #1824 as a duplicate of this issue on Apr 22, 2026
  19. kobie3717 commented on Apr 26, 2026

    @kobie3717

    Adjacent — not a fix for QR/pairing failures themselves, but for the post-pairing "ban after 24-48h" pattern that often follows.

    Shipped baileys-antiban-evolution today: adapter that adds rate-limiting + session-stability monitoring + device-fingerprint randomization to Evolution's BaileysStartupService at runtime.

    https://github.com/kobie3717/baileys-antiban-evolution

    Will help if your pairing succeeds but the account dies inside the first week. Won't help if pairing itself fails — that's protocol-level (Baileys upstream). Posting here in case it's adjacent for some people on the thread.

  20. cloviscoli commented on Sep 10, 2026

    @cloviscoli

    Working Docker recipe: patching Baileys inside the Evolution image to fix device pairing

    The root cause is upstream, not Evolution. WhatsApp changed the companion-registration flow: since ~2026-07-28 the server sends <notification type='companion_reg_refresh'> after the QR scan, which Baileys acks and discards — so pair-success is never emitted and the phone shows "couldn't link device / não foi possível conectar no momento". See Baileys #2737, reproduced independently in whatsmeow, which means it affects every open client, not just Baileys.

    Evolution v2.3.7 pins baileys@7.0.0-rc.9, and no published Baileys release contains the fix (the handler is absent in rc13, rc14 and master). The fix only exists as unmerged PRs.

    I couldn't find any public recipe for replacing Baileys inside the Evolution image, so here is one that works:

    FROM evoapicloud/evolution-api:v2.3.7
    WORKDIR /evolution
    
    # Alpine is minimal: npm needs git to clone the fork; the package's `prepare` runs tsc.
    RUN apk add --no-cache git \
     && npm install --no-audit --no-fund baileys@github:doryani-ai/Baileys#fix/companion-reg-refresh \
     && apk del git
    
    # Optional — only if you use the PAIRING CODE flow (Baileys PR #2602 / issue #2600).
    # WhatsApp sends `link_code_companion_reg` in two shapes; the one without the crypto
    # fields crashes with Boom('Invalid buffer', 400). This guard skips it.
    RUN sed -i "s|const linkCodeCompanionReg = getBinaryNodeChild(node, 'link_code_companion_reg');|&\n                if (!getBinaryNodeChildBuffer(linkCodeCompanionReg, 'primary_identity_pub')) { break; }|" \
          /evolution/node_modules/baileys/lib/Socket/messages-recv.js

    Build it, point your compose at the resulting image, and recreate only the evolution-api service.

    Result: Baileys 7.0.0-rc14, QR pairing works again (state=open, session stable).

    Two things worth knowing

    1. Security bonus. rc14 also clears CVE-2026-48063 (Critical — messages.upsert / history-sync spoofing and app-state corruption), which affects < rc12. Anyone still on v2.3.7 is exposed regardless of the pairing issue.
    2. Already-paired sessions keep working. This only breaks linking a new device, so it's an onboarding blocker rather than a runtime one.

    ⚠️ This depends on an unmerged upstream PR — treat it as tracked maintenance debt, not a permanent fix. The real fix is PR #2765 landing upstream and Evolution bumping Baileys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions