Maintenance & Troubleshooting
This section provides guidance on common maintenance tasks and how to troubleshoot potential issues with your WhatsApp Agent deployment.
Updating the Application
To update your application to the latest version, follow these steps:
-
Pull the Latest Docker Image:
docker compose pullThis command downloads the newest versions of the
webhookandworkerimages as specified in yourdeploy/compose.ymlfile. -
Recreate the Services:
# Ensure you are in the deploy/ directory
docker compose up -dDocker Compose is smart enough to detect that the image has changed. It will stop the old containers and start new ones using the updated image. Your data in PostgreSQL and Redis will be preserved.
-
Automatic Migrations: The entrypoint script will automatically run any new database migrations required by the updated version, so your database schema will be updated seamlessly.
Common Troubleshooting Steps
Most issues can be diagnosed by checking the application logs.
1. Check the Logs
The first step in troubleshooting is always to look at the logs from the webhook and worker containers.
-
Webhook Service Logs (for API errors, webhook verification issues):
docker compose logs -f webhook -
Worker Service Logs (for CRM or S3 integration errors):
docker compose logs -f worker
Look for any lines containing ERROR or CRITICAL.
2. Webhook Verification Fails
- Symptom: When you try to verify your Callback URL in the Meta Developer Dashboard, it fails.
- Cause: The
WEBHOOK_VERIFY_TOKENin yourdeploy/deploy.envfile does not exactly match the token you entered in the Meta dashboard. - Solution: Double-check that the tokens are identical, with no extra spaces or characters. Restart the
webhookservice if you change the.envfile (docker compose up -d --force-recreate webhook).
3. Flow Data Decryption Fails
- Symptom: The logs show errors related to
Decryption failedorInvalid paddingwhen a user submits a flow. - Cause: The
WHATSAPP_FLOW_PRIVATE_KEY_B64in your.envfile is incorrect or corrupted. - Solution: Ensure you have correctly copied and pasted the base64-encoded private key generated by the
setup_whatsapp_encryption.pyscript.
4. CRM Notifications Fail
- Symptom: The worker logs show
401 Unauthorized,404 Not Found, or other HTTP errors when trying to send data to the CRM. - Cause: This can have several causes:
- Incorrect
CRM_API_URL,CRM_API_KEY, orCRM_API_SECRETin your.envfile. - The
doctypespecified in yourcrm_mappings/*.yamlfile does not exist in your Frappe/ERPNext instance. - A field name in the
field_mapof your mapping file does not exist in the target CRM DocType.
- Incorrect
- Solution: Carefully verify all CRM-related credentials and mapping file configurations against your CRM setup.
5. Network Issues
- Symptom: The logs show
Connection refusedorTimeouterrors when trying to connect to Exotel, your CRM, or S3. - Cause: A firewall or network security group on your server is blocking outbound connections.
- Solution: Ensure your server's firewall rules allow outbound traffic on port 443 (for HTTPS) to the required external services.