Skip to content

WhatsApp session disconnects after some time on Railway (Redis enabled) #2318

@karlitobraga

Description

@karlitobraga

Welcome!

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

What did you do?

I'm running Evolution API on Railway and facing a session persistence issue.

The QR Code is generated correctly, the WhatsApp device connects successfully, and the instance shows as connected in the Evolution panel.
However, after some time (or after a Railway service restart), the WhatsApp session disconnects automatically, requiring a new QR Code scan.

This happens even though Redis and PostgreSQL are configured.

What did you expect?

AUTHENTICATION_API_KEY="dlkasmdsauteytrlpclxpclxpxnsjahdg"
AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES="true"
CACHE_LOCAL_ENABLED="false"
CACHE_REDIS_ENABLED="true"
CACHE_REDIS_PREFIX_KEY="evolution"
CACHE_REDIS_SAVE_INSTANCES="false"
CACHE_REDIS_URI="${{Redis.REDIS_URL}}"
CONFIG_SESSION_PHONE_CLIENT="Evolution"
CONFIG_SESSION_PHONE_NAME="Chrome"
DATABASE_CONNECTION_CLIENT_NAME="${{Postgres.PGUSER}}"
DATABASE_CONNECTION_URI="${{Postgres.DATABASE_URL}}"
DATABASE_ENABLED="true"
DATABASE_PROVIDER="postgresql"
DATABASE_SAVE_DATA_CHATS="true"
DATABASE_SAVE_DATA_CONTACTS="true"
DATABASE_SAVE_DATA_HISTORIC="true"
DATABASE_SAVE_DATA_INSTANCE="true"
DATABASE_SAVE_DATA_LABELS="true"
DATABASE_SAVE_DATA_NEW_MESSAGE="true"
DATABASE_SAVE_MESSAGE_UPDATE="true"
DEL_INSTANCE="false"
DIFY_ENABLED="true"
EVOAI_ENABLED="true"
LANGUAGE="pt-BR"
N8N_ENABLED="true"
OPENAI_ENABLED="true"
PROVIDER_ENABLED="false"
PROVIDER_HOST="127.0.0.1"
PROVIDER_PORT="5656"
PROVIDER_PREFIX="evolution"
QRCODE_LIMIT="1902"
SERVER_URL="https://${{RAILWAY_PUBLIC_DOMAIN}}"
TELEMETRY="false"
TYPEBOT_API_VERSION="latest"
TYPEBOT_ENABLED="true"
WA_BUSINESS_LANGUAGE="pt_BR"
WA_BUSINESS_TOKEN_WEBHOOK="evolution"
WA_BUSINESS_URL="https://graph.facebook.com"
WA_BUSINESS_VERSION="v21.0"
WEBHOOK_REQUEST_TIMEOUT_MS="60000"
WEBHOOK_RETRY_INITIAL_DELAY_SECONDS="5"
WEBHOOK_RETRY_JITTER_FACTOR="0.2"
WEBHOOK_RETRY_MAX_ATTEMPTS="10"
WEBHOOK_RETRY_MAX_DELAY_SECONDS="300"
WEBHOOK_RETRY_NON_RETRYABLE_STATUS_CODES="400,401,403,404,422"
WEBHOOK_RETRY_USE_EXPONENTIAL_BACKOFF="true"
WEBSOCKET_ENABLED="true"
WEBSOCKET_GLOBAL_EVENTS="true"
CONFIG_SESSION_PHONE_VERSION="2.3000.1031008584"

What did you observe instead of what you expected?

AUTHENTICATION_API_KEY="dlkasmdsauteytrlpclxpclxpxnsjahdg"
AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES="true"
CACHE_LOCAL_ENABLED="false"
CACHE_REDIS_ENABLED="true"
CACHE_REDIS_PREFIX_KEY="evolution"
CACHE_REDIS_SAVE_INSTANCES="false"
CACHE_REDIS_URI="${{Redis.REDIS_URL}}"
CONFIG_SESSION_PHONE_CLIENT="Evolution"
CONFIG_SESSION_PHONE_NAME="Chrome"
DATABASE_CONNECTION_CLIENT_NAME="${{Postgres.PGUSER}}"
DATABASE_CONNECTION_URI="${{Postgres.DATABASE_URL}}"
DATABASE_ENABLED="true"
DATABASE_PROVIDER="postgresql"
DATABASE_SAVE_DATA_CHATS="true"
DATABASE_SAVE_DATA_CONTACTS="true"
DATABASE_SAVE_DATA_HISTORIC="true"
DATABASE_SAVE_DATA_INSTANCE="true"
DATABASE_SAVE_DATA_LABELS="true"
DATABASE_SAVE_DATA_NEW_MESSAGE="true"
DATABASE_SAVE_MESSAGE_UPDATE="true"
DEL_INSTANCE="false"
DIFY_ENABLED="true"
EVOAI_ENABLED="true"
LANGUAGE="pt-BR"
N8N_ENABLED="true"
OPENAI_ENABLED="true"
PROVIDER_ENABLED="false"
PROVIDER_HOST="127.0.0.1"
PROVIDER_PORT="5656"
PROVIDER_PREFIX="evolution"
QRCODE_LIMIT="1902"
SERVER_URL="https://${{RAILWAY_PUBLIC_DOMAIN}}"
TELEMETRY="false"
TYPEBOT_API_VERSION="latest"
TYPEBOT_ENABLED="true"
WA_BUSINESS_LANGUAGE="pt_BR"
WA_BUSINESS_TOKEN_WEBHOOK="evolution"
WA_BUSINESS_URL="https://graph.facebook.com"
WA_BUSINESS_VERSION="v21.0"
WEBHOOK_REQUEST_TIMEOUT_MS="60000"
WEBHOOK_RETRY_INITIAL_DELAY_SECONDS="5"
WEBHOOK_RETRY_JITTER_FACTOR="0.2"
WEBHOOK_RETRY_MAX_ATTEMPTS="10"
WEBHOOK_RETRY_MAX_DELAY_SECONDS="300"
WEBHOOK_RETRY_NON_RETRYABLE_STATUS_CODES="400,401,403,404,422"
WEBHOOK_RETRY_USE_EXPONENTIAL_BACKOFF="true"
WEBSOCKET_ENABLED="true"
WEBSOCKET_GLOBAL_EVENTS="true"
CONFIG_SESSION_PHONE_VERSION="2.3000.1031008584"

Screenshots/Videos

No response

Which version of the API are you using?

2.2.3

What is your environment?

Windows

Other environment specifications

No response

If applicable, paste the log output

No response

Additional Notes

No response

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