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

[BUG] Error ao associar labels em webhooks - Etiquetas

Open zxtheuxz opened this issue 1 year ago • 2 comments

Bem-vido!

  • [x] Sim, pesquisei problemas semelhantes no GitHub e não encontrei nenhum.

O que você fez?

Estou enfrentando um erro ao tentar associar labels através dos webhooks. O sistema está gerando uma exceção do Prisma relacionada a uma constraint de banco de dados ausente. Versão

Evolution API: v2.2.3

Log de Erro Copy[Evolution API] [SUPORTE] v2.2.3 170 - Sat Mar 08 2025 10:23:45 INFO [ChannelStartupService] [string] labels association - [email protected] (add-label_jid): 1 [Evolution API] v2.2.3 170 - Sat Mar 08 2025 10:23:45 ERROR [unhandledRejection] [object]
{ origin: Promise { PrismaClientKnownRequestError: Invalid prisma.$executeRawUnsafe() invocation:

Raw query failed. Code: `42P10`. Message: `ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification`
    at Bn.handleRequestError (/evolution/node_modules/@prisma/client/runtime/library.js:121:7362)
    at Bn.handleAndLogRequestError (/evolution/node_modules/@prisma/client/runtime/library.js:121:6686)
    at Bn.request (/evolution/node_modules/@prisma/client/runtime/library.js:121:6393)
    at async l (/evolution/node_modules/@prisma/client/runtime/library.js:130:9645)
    at async Rs.addLabel (/evolution/dist/main.js:253:3945)
    at async labels.association (/evolution/dist/main.js:230:31695) {
  code: 'P2010',
  clientVersion: '6.3.0',
  meta: [Object]
}

}, stderr: 2 } [Evolution API] v2.2.3 170 - Sat Mar 08 2025 10:23:45 ERROR [unhandledRejection] [object]
PrismaClientKnownRequestError: Invalid prisma.$executeRawUnsafe() invocation: Raw query failed. Code: 42P10. Message: ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification at Bn.handleRequestError (/evolution/node_modules/@prisma/client/runtime/library.js:121:7362) at Bn.handleAndLogRequestError (/evolution/node_modules/@prisma/client/runtime/library.js:121:6686) at Bn.request (/evolution/node_modules/@prisma/client/runtime/library.js:121:6393) at async l (/evolution/node_modules/@prisma/client/runtime/library.js:130:9645) at async Rs.addLabel (/evolution/dist/main.js:253:3945) at async labels.association (/evolution/dist/main.js:230:31695) { code: 'P2010', clientVersion: '6.3.0', meta: { code: '42P10', message: 'ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification' } }

Obs: Ja verifiquei no postgres do EVO e esta tudo correto !! Esse ERROR somente na v. 2.2.3

O que você esperava?

O sistema deveria associar o label ao número de telefone sem gerar erro e confirmar a associação com sucesso. A operação de adicionar labels deveria funcionar normalmente sem apresentar erros de constraint do banco de dados.

O que vc observou ao invés do que esperava?

Ao invés do funcionamento normal, observei que o sistema falha ao tentar associar labels, gerando um erro do Prisma relacionado à falta de uma constraint única ou de exclusão no banco de dados. Especificamente, ocorre um erro PrismaClientKnownRequestError com código P2010 e mensagem ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification (código PostgreSQL: 42P10), o que impede completamente a funcionalidade de associação de labels de funcionar.

Capturas de Tela/Vídeos

Image

Qual versão da API você está usando?

Evolution API: v2.2.3

Qual é o seu ambiente?

Windows

Outras expecificações do ambiente

No response

Se aplicável, cole a saída do log

No response

Notas Adicionais

No response

zxtheuxz avatar Mar 08 '25 13:03 zxtheuxz

Foi corrigido neste PR, que está aguardando merge https://github.com/EvolutionAPI/evolution-api/pull/1277

rafwell avatar Mar 14 '25 14:03 rafwell

Agora esta nesse PR aqui: https://github.com/EvolutionAPI/evolution-api/pull/1311

pedroSoaresll avatar Mar 17 '25 14:03 pedroSoaresll