EvolutionAPI / evolution-api

Evolution API is an open-source WhatsApp integration API
https://evolution-api.com
Other
1.99k stars 1.13k forks source link

Database Provider Invalid #974

Open robertollmartino opened 1 month ago

robertollmartino commented 1 month ago

Welcome!

What did you do?

I'm trying to install Evolution v2 (ever using v1.8) but tried evertthing but always with the same error: evoltuion database provider invalid (even thoug I tried to install mongo together), what to do?

What did you expect?

To install v2, if anybody could send me a composer ready

What did you observe instead of what you expected?

Error

Screenshots/Videos

No response

Which version of the API are you using?

v 2.1.1

What is your environment?

Docker

Other environment specifications

No response

If applicable, paste the log output

No response

Additional Notes

No response

rnfrafael commented 1 month ago

The Evo v2 works only with PostgreSQL or MySQL, use Redis for cache. Here a compose for this

version: "3.7"

services:
  postgres-teste:
    image: postgres
    environment:
      POSTGRES_PASSWORD: "postgres2024!"

  evolution_v2_teste:
    image: atendai/evolution-api:v2.1.0
    ports:
      - 8081:8080
    environment:
      - SERVER_URL=http://ip:8081
      - DEL_INSTANCE=false
      - PROVIDER_ENABLED=false
      - PROVIDER_HOST=127.0.0.1
      - PROVIDER_PORT=5656
      - PROVIDER_PREFIX=evolution_v2
      - DATABASE_ENABLED=true
      - DATABASE_PROVIDER=postgresql
      - DATABASE_CONNECTION_URI=postgresql://postgres:postgres2024!@postgres-teste:5432/postgres
      - DATABASE_SAVE_DATA_INSTANCE=true
      - DATABASE_SAVE_DATA_NEW_MESSAGE=false
      - DATABASE_SAVE_MESSAGE_UPDATE=false
      - DATABASE_SAVE_DATA_CONTACTS=false
      - DATABASE_SAVE_DATA_CHATS=false
      - DATABASE_SAVE_DATA_LABELS=false
      - DATABASE_SAVE_DATA_HISTORIC=false
      - DATABASE_CONNECTION_CLIENT_NAME=evolution_v2
      - RABBITMQ_ENABLED=false
      - RABBITMQ_URI=amqp://admin:admin@rabbitmq:5672/default
      - RABBITMQ_EXCHANGE_NAME=evolution_v2
      - RABBITMQ_GLOBAL_ENABLED=false
      - RABBITMQ_EVENTS_APPLICATION_STARTUP=false
      - RABBITMQ_EVENTS_INSTANCE_CREATE=false
      - RABBITMQ_EVENTS_INSTANCE_DELETE=false
      - RABBITMQ_EVENTS_QRCODE_UPDATED=false
      - RABBITMQ_EVENTS_MESSAGES_SET=false
      - RABBITMQ_EVENTS_MESSAGES_UPSERT=true
      - RABBITMQ_EVENTS_MESSAGES_EDITED=false
      - RABBITMQ_EVENTS_MESSAGES_UPDATE=false
      - RABBITMQ_EVENTS_MESSAGES_DELETE=false
      - RABBITMQ_EVENTS_SEND_MESSAGE=false
      - RABBITMQ_EVENTS_CONTACTS_SET=false
      - RABBITMQ_EVENTS_CONTACTS_UPSERT=false
      - RABBITMQ_EVENTS_CONTACTS_UPDATE=false
      - RABBITMQ_EVENTS_PRESENCE_UPDATE=false
      - RABBITMQ_EVENTS_CHATS_SET=false
      - RABBITMQ_EVENTS_CHATS_UPSERT=false
      - RABBITMQ_EVENTS_CHATS_UPDATE=false
      - RABBITMQ_EVENTS_CHATS_DELETE=false
      - RABBITMQ_EVENTS_GROUPS_UPSERT=false
      - RABBITMQ_EVENTS_GROUP_UPDATE=false
      - RABBITMQ_EVENTS_GROUP_PARTICIPANTS_UPDATE=false
      - RABBITMQ_EVENTS_CONNECTION_UPDATE=true
      - RABBITMQ_EVENTS_CALL=false
      - RABBITMQ_EVENTS_TYPEBOT_START=false
      - RABBITMQ_EVENTS_TYPEBOT_CHANGE_STATUS=false
      - SQS_ENABLED=false
      - SQS_ACCESS_KEY_ID=
      - SQS_SECRET_ACCESS_KEY=
      - SQS_ACCOUNT_ID=
      - SQS_REGION=
      - WEBSOCKET_ENABLED=false
      - WEBSOCKET_GLOBAL_EVENTS=false
      - WA_BUSINESS_TOKEN_WEBHOOK=evolution
      - WA_BUSINESS_URL=https://graph.facebook.com
      - WA_BUSINESS_VERSION=v20.0
      - WA_BUSINESS_LANGUAGE=pt_BR
      - WEBHOOK_GLOBAL_URL=''
      - WEBHOOK_GLOBAL_ENABLED=false
      - WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false
      - WEBHOOK_EVENTS_APPLICATION_STARTUP=false
      - WEBHOOK_EVENTS_QRCODE_UPDATED=true
      - WEBHOOK_EVENTS_MESSAGES_SET=true
      - WEBHOOK_EVENTS_MESSAGES_UPSERT=true
      - WEBHOOK_EVENTS_MESSAGES_EDITED=true
      - WEBHOOK_EVENTS_MESSAGES_UPDATE=true
      - WEBHOOK_EVENTS_MESSAGES_DELETE=true
      - WEBHOOK_EVENTS_SEND_MESSAGE=true
      - WEBHOOK_EVENTS_CONTACTS_SET=true
      - WEBHOOK_EVENTS_CONTACTS_UPSERT=true
      - WEBHOOK_EVENTS_CONTACTS_UPDATE=true
      - WEBHOOK_EVENTS_PRESENCE_UPDATE=true
      - WEBHOOK_EVENTS_CHATS_SET=true
      - WEBHOOK_EVENTS_CHATS_UPSERT=true
      - WEBHOOK_EVENTS_CHATS_UPDATE=true
      - WEBHOOK_EVENTS_CHATS_DELETE=true
      - WEBHOOK_EVENTS_GROUPS_UPSERT=true
      - WEBHOOK_EVENTS_GROUPS_UPDATE=true
      - WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=true
      - WEBHOOK_EVENTS_CONNECTION_UPDATE=true
      - WEBHOOK_EVENTS_LABELS_EDIT=true
      - WEBHOOK_EVENTS_LABELS_ASSOCIATION=true
      - WEBHOOK_EVENTS_CALL=true
      - WEBHOOK_EVENTS_TYPEBOT_START=false
      - WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS=false
      - WEBHOOK_EVENTS_ERRORS=false
      - WEBHOOK_EVENTS_ERRORS_WEBHOOK=
      - CONFIG_SESSION_PHONE_CLIENT=Whatsapp
      - CONFIG_SESSION_PHONE_NAME=Chrome
      - CONFIG_SESSION_PHONE_VERSION=2.3000.1015901307
      - QRCODE_LIMIT=30
      - OPENAI_ENABLED=false
      - DIFY_ENABLED=false
      - TYPEBOT_ENABLED=true
      - TYPEBOT_API_VERSION=latest
      - CHATWOOT_ENABLED=false
      - CHATWOOT_MESSAGE_READ=true
      - CHATWOOT_MESSAGE_DELETE=true
      - CHATWOOT_IMPORT_DATABASE_CONNECTION_URI=postgresql://postgres:PASSWORD@postgres:5432/chatwoot?sslmode=disable
      - CHATWOOT_IMPORT_PLACEHOLDER_MEDIA_MESSAGE=true
      - CACHE_REDIS_ENABLED=true
      - CACHE_REDIS_URI=redis://redis:6379/1
      - CACHE_REDIS_PREFIX_KEY=evolution_v2_testes
      - CACHE_REDIS_SAVE_INSTANCES=true
      - CACHE_LOCAL_ENABLED=false
      - S3_ENABLED=false
      - S3_ACCESS_KEY=
      - S3_SECRET_KEY=
      - S3_BUCKET=evolution
      - S3_PORT=443
      - S3_ENDPOINT=files.site.com
      - S3_USE_SSL=true
      - AUTHENTICATION_API_KEY=918f5b02-766e-4107-9c96-9451f251cfde      
      - AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=true
      - LANGUAGE=en
brauliodiasribeiro commented 3 weeks ago

I have the same problem. I was running version 1.8 with postgres, when I changed to 2.1.2 it did not find postgres

image The name of my postgres installation is "Postgres" with a uppercase letter and my database is "evolutionapi"

image

robertollmartino commented 3 weeks ago

I have the same problem. I was running version 1.8 with postgres, when I changed to 2.1.2 it did not find postgres

image The name of my postgres installation is "Postgres" with a uppercase letter and my database is "evolutionapi"

image

Thanks so much Bráulio! I'll try it

brauliodiasribeiro commented 3 weeks ago

I have the same problem. I was running version 1.8 with postgres, when I changed to 2.1.2 it did not find postgres image The name of my postgres installation is "Postgres" with a uppercase letter and my database is "evolutionapi" image

Thanks so much Bráulio! I'll try it

Roberto, I wrote this post because i am with the same problem. Doesn't work.

bryanwac commented 3 weeks ago

For others with the same problem:

Stop using: atendai/evolution-api:latest Start using: atendai/evolution-api:v1.8.2

So your docker wont pull the latest version every update, and will keep it on LTS version

Ps: This will make ur api stop throwing the error Database provider invalid too, cz this version do not expect a DATABASE_PROVIDERon docker env

bryanwac commented 3 weeks ago

The error: Database provider invalid is because u are not setting DATABASE_PROVIDER with the database name u want to use, like DATABASE_PROVIDER=postgresql

brauliodiasribeiro commented 3 weeks ago

For others with the same problem:

Stop using: atendai/evolution-api:latest Start using: atendai/evolution-api:v1.8.2

So your docker wont pull the latest version every update, and will keep it on LTS version

Ps: This will make ur api stop throwing the error Database provider invalid too, cz this version do not expect a DATABASE_PROVIDERon docker env

I'm already using v1.8.2, but I'd like to use v2.2

brauliodiasribeiro commented 3 weeks ago

The error: Database provider invalid is because u are not setting DATABASE_PROVIDER with the database name u want to use, like DATABASE_PROVIDER=postgresql

Yes, I added the variable to my .env but it didn't work.

image

brauliodiasribeiro commented 3 weeks ago

The error: Database provider invalid is because u are not setting DATABASE_PROVIDER with the database name u want to use, like DATABASE_PROVIDER=postgresql

I also tried typing my database in the variable and it still gives me the same error.

image

bryanwac commented 3 weeks ago

The error: Database provider invalid is because u are not setting DATABASE_PROVIDER with the database name u want to use, like DATABASE_PROVIDER=postgresql

I also tried typing my database in the variable and it still gives me the same error.

image

u gotta set DATABASE_PROVIDER as postgresql (not the name of ur database, use the name of the bd like mysql/postgresql, etc)

The base problem is: If ur evo api auto updated to a newer version, u prob gonna have to change a lot of variables, cause some change from version to version, like: Database provider is not required for version 1.8.2 but it is for 2.0+

bryanwac commented 3 weeks ago

The error: Database provider invalid is because u are not setting DATABASE_PROVIDER with the database name u want to use, like DATABASE_PROVIDER=postgresql

Yes, I added the variable to my .env but it didn't work.

image

The database name is postgresql, not postgre I supose

bryanwac commented 3 weeks ago

For others with the same problem: Stop using: atendai/evolution-api:latest Start using: atendai/evolution-api:v1.8.2 So your docker wont pull the latest version every update, and will keep it on LTS version Ps: This will make ur api stop throwing the error Database provider invalid too, cz this version do not expect a DATABASE_PROVIDERon docker env

I'm already using v1.8.2, but I'd like to use v2.2

so u gotta change some stuff in ur .env, I kinda dont know the correct variables for v2+ But I know that if u set ur database provider as postgresql it should work

bryanwac commented 3 weeks ago

Check if ur docker img is really set to 1.8,2 or to latest: This is what my docker image is set on my easypanel: image

And using this docker image, my .env is setted like this for the DATABASE conf on .env:

image

brauliodiasribeiro commented 3 weeks ago

I didn't update, I installed version 2 directly. I typed "postgresql" and it didn't work. I ended up giving up. lol

k3rnelkill commented 9 hours ago

Aqui obtive o mesmo problemas com 2.2.0 e latest, resolvido fazendo downgrade para 1.8.2.