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

column "header" does not exist in database table "Webhook"

Open heberome opened this issue 1 year ago • 3 comments

Welcome!

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

What did you do?

I 've installed Evolution-api 2.1.1 trough Docker compose files (redis, mysql, evolution). Evolution connects OK with redis and mysql, then it creates the database evolution and his tables. The log file shows the installation did a migration task with 7 migration steps OK. Everything seems to be good, but when I create my first instance, the log file shows the error: The column evolution.Webhook.headers does not exist in the current database. And finally my evolution installation it is not funcional.

What did you expect?

Evolution api allows me create and test my first instance.

What did you observe instead of what you expected?

Errors in log file. The instance is created but it is not functional.

Screenshots/Videos

Docker containers Image

MySQL database table Webhook Image

Which version of the API are you using?

v2.1.1 image [atendai/evolution-api:v2.1.1]

What is your environment?

Windows

Other environment specifications

Windows 10 Docker Desktop 4.37.1 Intel core i7 8th generation with 20GB RAM

If applicable, paste the log output

Installation Logs

2025-01-28 00:14:58 Deploying migrations for mysql 2025-01-28 00:14:58 Database URL: 2025-01-28 00:14:59 2025-01-28 00:14:59 > [email protected] db:deploy 2025-01-28 00:14:59 > node runWithProvider.js "rm -rf ./prisma/migrations && cp -r ./prisma/DATABASE_PROVIDER-migrations ./prisma/migrations && npx prisma migrate deploy --schema ./prisma/DATABASE_PROVIDER-schema.prisma" 2025-01-28 00:14:59 2025-01-28 00:15:02 Environment variables loaded from .env 2025-01-28 00:15:02 Prisma schema loaded from prisma/mysql-schema.prisma 2025-01-28 00:15:02 Datasource "db": MySQL database "evolution" at "mysql:3306" 2025-01-28 00:15:04 2025-01-28 00:15:04 MySQL database evolution created at mysql:3306 2025-01-28 00:15:04 2025-01-28 00:15:04 7 migrations found in prisma/migrations 2025-01-28 00:15:04 2025-01-28 00:15:10 Applying migration 20240809105427_init 2025-01-28 00:27:48 Applying migration 20240813153900_add_unique_index_for_remoted_jid_and_instance_in_contacts 2025-01-28 00:28:23 Applying migration 20240814173138_add_ignore_jids_chatwoot 2025-01-28 00:28:55 Applying migration 20240814214314_integrations_unification 2025-01-28 00:31:09 Applying migration 20240821203259_add_postgres_migrations 2025-01-28 00:32:57 Applying migration 20240824162012_add_type_on_integration_sessions 2025-01-28 00:33:27 Applying migration 20240825131301_change_to_evolution_bot 2025-01-28 00:34:33 2025-01-28 00:34:33 The following migration(s) have been applied: 2025-01-28 00:34:33 2025-01-28 00:34:33 migrations/ 2025-01-28 00:34:33 └─ 20240809105427_init/ 2025-01-28 00:34:33 └─ migration.sql 2025-01-28 00:34:33 └─ 20240813153900_add_unique_index_for_remoted_jid_and_instance_in_contacts/ 2025-01-28 00:34:33 └─ migration.sql 2025-01-28 00:34:33 └─ 20240814173138_add_ignore_jids_chatwoot/ 2025-01-28 00:34:33 └─ migration.sql 2025-01-28 00:34:33 └─ 20240814214314_integrations_unification/ 2025-01-28 00:34:33 └─ migration.sql 2025-01-28 00:34:33 └─ 20240821203259_add_postgres_migrations/ 2025-01-28 00:34:33 └─ migration.sql 2025-01-28 00:34:33 └─ 20240824162012_add_type_on_integration_sessions/ 2025-01-28 00:34:33 └─ migration.sql 2025-01-28 00:34:33 └─ 20240825131301_change_to_evolution_bot/ 2025-01-28 00:34:33 └─ migration.sql 2025-01-28 00:34:33
2025-01-28 00:34:33 All migrations have been successfully applied. 2025-01-28 00:34:35 npm notice 2025-01-28 00:34:35 npm notice New major version of npm available! 10.8.2 -> 11.0.0 2025-01-28 00:34:35 npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.0.0 2025-01-28 00:34:35 npm notice To update run: npm install -g [email protected] 2025-01-28 00:34:35 npm notice 2025-01-28 00:34:35 Migration succeeded 2025-01-28 00:34:36 2025-01-28 00:34:36 > [email protected] db:generate 2025-01-28 00:34:36 > node runWithProvider.js "npx prisma generate --schema ./prisma/DATABASE_PROVIDER-schema.prisma" 2025-01-28 00:34:36 2025-01-28 00:34:56 Environment variables loaded from .env 2025-01-28 00:34:56 Prisma schema loaded from prisma/mysql-schema.prisma 2025-01-28 00:35:04 2025-01-28 00:35:04 ✔ Generated Prisma Client (v5.19.1) to ./node_modules/@prisma/client in 5.08s 2025-01-28 00:35:04 2025-01-28 00:35:04 Start by importing your Prisma Client (See: http://pris.ly/d/importing-client) 2025-01-28 00:35:04 2025-01-28 00:35:04 Tip: Need your database queries to be 1000x faster? Accelerate offers you that and more: https://pris.ly/tip-2-accelerate 2025-01-28 00:35:04 2025-01-28 00:35:05 Prisma generate succeeded 2025-01-28 00:35:05 2025-01-28 00:35:05 > [email protected] start:prod 2025-01-28 00:35:05 > node dist/main 2025-01-28 00:35:05 2025-01-28 00:35:40 [Evolution API] v2.1.1 243 - Tue Jan 28 2025 00:35:40 VERBOSE [Prisma] [string] connecting 2025-01-28 00:35:44 [Evolution API] v2.1.1 243 - Tue Jan 28 2025 00:35:44 VERBOSE [CacheEngine] [string] RedisCache initialized for groups 2025-01-28 00:35:44 [Evolution API] v2.1.1 243 - Tue Jan 28 2025 00:35:44 VERBOSE [CacheService] [string] cacheservice created using cache engine: Vt 2025-01-28 00:35:49 [Evolution API] v2.1.1 243 - Tue Jan 28 2025 00:35:49 VERBOSE [CacheEngine] [string] RedisCache initialized for instance 2025-01-28 00:35:49 [Evolution API] v2.1.1 243 - Tue Jan 28 2025 00:35:49 VERBOSE [CacheService] [string] cacheservice created using cache engine: Vt 2025-01-28 00:35:49 [Evolution API] v2.1.1 243 - Tue Jan 28 2025 00:35:49 VERBOSE [CacheEngine] [string] RedisCache initialized for baileys 2025-01-28 00:35:49 [Evolution API] v2.1.1 243 - Tue Jan 28 2025 00:35:49 VERBOSE [CacheService] [string] cacheservice created using cache engine: Vt 2025-01-28 00:35:49 [Evolution API] v2.1.1 243 - Tue Jan 28 2025 00:35:49 INFO [WA MODULE] [string] Module - ON 2025-01-28 00:35:59 [Evolution API] v2.1.1 243 - Tue Jan 28 2025 00:35:59 ERROR [Redis] [string] redis disconnected 2025-01-28 00:35:59 [Evolution API] v2.1.1 243 - Tue Jan 28 2025 00:35:59 VERBOSE [Redis] [string] redis connecting 2025-01-28 00:35:59 [Evolution API] v2.1.1 243 - Tue Jan 28 2025 00:35:59 INFO [PrismaRepository] [string] Repository:Prisma - ON 2025-01-28 00:35:59 [Evolution API] v2.1.1 243 - Tue Jan 28 2025 00:35:59 LOG [SERVER] [string] HTTP - ON: 8080 2025-01-28 00:35:59 [Evolution API] v2.1.1 243 - Tue Jan 28 2025 00:35:59 VERBOSE [Redis] [string] redis ready

Creation of First Instance Log

2025-01-28 10:11:24 [Evolution API] v2.1.1 243 - Tue Jan 28 2025 10:11:24 ERROR [unhandledRejection] [object]
2025-01-28 10:11:24 { 2025-01-28 10:11:24 origin: Promise { 2025-01-28 10:11:24 PrismaClientKnownRequestError: 2025-01-28 10:11:24 Invalid this.prismaRepository.integrationSession.findFirst() invocation in 2025-01-28 10:11:24 /evolution/dist/main.js:236:75574

2025-01-28 10:11:24 234, 235, 236 .... lot of javascript code here

2025-01-28 10:11:24 The column evolution.Webhook.headers does not exist in the current database. 2025-01-28 10:11:24 at Ln.handleRequestError (/evolution/node_modules/@prisma/client/runtime/library.js:121:7753) 2025-01-28 10:11:24 at Ln.handleAndLogRequestError (/evolution/node_modules/@prisma/client/runtime/library.js:121:7061) 2025-01-28 10:11:24 at Ln.request (/evolution/node_modules/@prisma/client/runtime/library.js:121:6745) 2025-01-28 10:11:24 at async l (/evolution/node_modules/@prisma/client/runtime/library.js:130:9633) 2025-01-28 10:11:24 at async Us.get (/evolution/dist/main.js:236:75545) 2025-01-28 10:11:24 at async Us.emit (/evolution/dist/main.js:236:81677) 2025-01-28 10:11:24 at async Ws.emit (/evolution/dist/main.js:236:84929) 2025-01-28 10:11:24 at async Ts.sendDataWebhook (/evolution/dist/main.js:143:11995) { 2025-01-28 10:11:24 code: 'P2022', 2025-01-28 10:11:24 clientVersion: '5.19.1', 2025-01-28 10:11:24 meta: [Object] 2025-01-28 10:11:24 } 2025-01-28 10:11:24 }, 2025-01-28 10:11:24 stderr: 2, 2025-01-28 10:11:24 error: PrismaClientKnownRequestError: 2025-01-28 10:11:24 Invalid this.prismaRepository.integrationSession.findFirst() invocation in 2025-01-28 10:11:24 /evolution/dist/main.js:236:75574

Additional Notes

No response

heberome avatar Jan 28 '25 17:01 heberome

Eu estou recebendo esse erro redis disconnected porem ja configurei o redis mas acredito que o redis é usado por outra network dentro do docker

marcus2vinicius avatar Feb 04 '25 13:02 marcus2vinicius

Cara o mesmo aqui, eu acho que tem a ver com as migrations, precisar criar uma nova pra adicionar as novas colunas no mysql, na verdade tem mais algumas atualizações para criar as migrations, como a tabela Pusher.

https://github.com/EvolutionAPI/evolution-api/commit/65c6ecff883e05178ecefd9539a57777cd006c08#diff-acd8b1e2e8743ba121eecb8ff0afbecf7600832c888661349bd5baaaaca33238 @DavidsonGomes @fmedeiros95

leandrofreirex avatar Feb 11 '25 19:02 leandrofreirex

olhando um pouco mais a fundo, acho que é um problema especifico da 2.1.1, acho que na documentação está desatualizada https://doc.evolution-api.com/v2/pt/install/docker o docker-compose está desatualizado:

Image

@heberome tenta alterar para o mais recente

leandrofreirex avatar Feb 11 '25 20:02 leandrofreirex