Posts tagged with docker

I am new in whatsapp business API integration and i successfully installed Docker and postman collection.

Referring below link : https://developers.facebook.com/docs/whatsapp/installation/dev-single-instance

Now in postman collection they mentioned regarding {{ URL }}

Collection Link : https://developers.facebook.com/docs/whatsapp/guides/postman

The first thing you should replace is the URL which represents the webapp endpoint. You'll see that all of the requests will reference this variable via {{URL}} so it's important you get this right.

How can i get this Valid URL ?

I tried hard but unable to find it.

Help me if anybody know this.

Thanks in advance.

When i am trying to send message via CURL i am getting error

{"meta":{"version":"v2.25.2","api_status":"stable"},"errors":[{"code":1014,"title":"Internal error","details":"Connection refused. Please check if wacore is running: wacore:6250"}] 

i killed containers multiple time but still getting same error, while waweb is working as usual i am able to import certificate and get tokens.

Below is the log of wacore container

I1028 19:34:39.252485    21 main.cpp:36] ---- FieldStats initialization ---- req_id=Main I1028 19:34:39.252826    21 fieldstats.cpp:170] FIELDSTATS: initialized with existing wam file: stream_id = 0, record_count = 144, event_count = 23, size = 1255, create_ts = 1572286537, rotated_size = 0, buffer_sequence_number = 1, dropped_event_count = 0, dropped_event_size = 0 req_id=Main I1028 19:34:39.257371    21 util.cpp:2979] Calling Get Orchestration req_id=Main I1028 19:34:39.257485    21 util.cpp:2998] Calling Get TemplateVersion req_id=Main I1028 19:34:39.258282    22 apiendpointmanager.cpp:167] Endpoint "healthcheck" is listening on address "0.0.0.0" port 6253 req_id=Main I1028 19:34:39.259002    23 apiendpointmanager.cpp:167] Endpoint "control" is listening on address "0.0.0.0" port 6252 req_id=Main I1028 19:34:39.259256    21 main.cpp:41] ---- ConfigStore initialization ---- req_id=Main I1028 19:34:39.259436    21 dbsettings.cpp:103] Changed default database engine from "SQLITE" to "MYSQL" req_id=Main I1028 19:34:39.260638    21 datastore.cpp:677] "create_configStore_139693946207872" connectOption: "MYSQL_OPT_RECONNECT=1;MYSQL_OPT_CONNECT_TIMEOUT=15;MYSQL_OPT_READ_TIMEOUT=30;MYSQL_OPT_WRITE_TIMEOUT=30" req_id=Main I1028 19:34:39.296638    21 datastore.cpp:94] Created database "configStore" req_id=Main I1028 19:34:39.298108    21 datastore.cpp:677] "configStore" connectOption: "MYSQL_OPT_RECONNECT=1;MYSQL_OPT_CONNECT_TIMEOUT=15;MYSQL_OPT_READ_TIMEOUT=30;MYSQL_OPT_WRITE_TIMEOUT=30" req_id=Main I1028 19:34:39.298339    21 datastore.cpp:148] Initiated DB connection "configStore"  of engine type "MYSQL" req_id=Main I1028 19:34:39.344069    21 datastore.cpp:354] Set sql_mode to "NO_AUTO_CREATE_USER,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE" req_id=Main I1028 19:34:39.345626    21 configstore.cpp:546] Creating cluster info req_id=Main I1028 19:34:39.345705    21 configstore.cpp:1064] App settings does not exist req_id=Main I1028 19:34:39.345715    21 configstore.cpp:857] Creating cluster_info table req_id=Main I1028 19:34:39.350646    21 configstore.cpp:870] cluster_info table created req_id=Main I1028 19:34:39.353032    21 configstore.cpp:1064] App settings does not exist req_id=Main I1028 19:34:39.363816    21 configstore.cpp:202] ConfigStore is initialized successfully req_id=Main I1028 19:34:39.364192    21 mainutil.cpp:473] trying to open log file  "/usr/local/waent/logs/wa-service-4be3d54f-crash.log" req_id=Main I1028 19:34:39.364240    21 main.cpp:324] "---- WhatsApp Service 2.25.2 wa-service Startup ----" req_id=Main I1028 19:34:39.364251    21 main.cpp:327] WhatsApp Account at startup: "" req_id=Main I1028 19:34:39.365712    21 crashloguploader.cpp:46] Crash log uploader upload req_id=Main I1028 19:34:39.365871    21 crashloguploader.cpp:59] uploader sees total files to upload  0 req_id=Main I1028 19:34:39.366093    21 util.cpp:3503] "invalid" should only contain numbers req_id=Main I1028 19:34:39.366130    21 util.cpp:3503] "invalid" should only contain numbers req_id=Main I1028 19:34:39.366142    21 util.cpp:431] Expire jitter adds 388 hours to the expire window req_id=Main W1028 19:34:39.366174    21 util.cpp:461] Missing login credentials: no username req_id=Main E1028 19:34:39.366215    21 chatapp.cpp:191] Aborting normal startup due to missing login credentials req_id=Main I1028 19:34:39.366266    21 chatservice.cpp:479] Unable to initialize the chat application req_id=Main I1028 19:34:39.366282    21 chatapp.cpp:1041] Setting chat state to: ChatState::Type(Disconnected) req_id=Main I1028 19:34:39.366291    21 cryptoprovider.cpp:48] Shutting down crypto provider req_id=Main W1028 19:34:39.366297    21 chatservice.cpp:208] Chat service could not initialize, send SIGHUP to retry req_id=Main I1028 19:34:39.366340    21 main.cpp:340] Chat service started, entering event loop req_id=Main 

It will be great help if someone can guide me the exact problem to resolve.

Following is the configuration which i used. BTW.

wacore: image: docker.whatsapp.biz/coreapp:v${WA_API_VERSION:?Run docker-compose with env var WA_API_VERSION (ex. WA_API_VERSION=2.23.4 docker-compose )} command: ["/opt/whatsapp/bin/wait_on_mysql.sh", "/opt/whatsapp/bin/launch_within_docker.sh"] volumes: - whatsappMedia:/usr/local/wamedia env_file: - db.env environment: # This is the version of the docker templates being used to run WhatsApp Business API WA_RUNNING_ENV_VERSION: v2.2.3 ORCHESTRATION: DOCKER-COMPOSE network_mode: bridge

I am trying to use whatsapp business api. But the problem is when I run docker-compose up I get the error Mysql not yet started. Though the wadebug tool shows everything correct. I am not able to hit any api eg GET https://localhost:9090/v1/settings/application I am getting connection refused in this request.enter image description here

I have also one more doubt.Am I hitting the right api or is there any different. In their documentation it is written your app hostname. Docker-compose ps shows 0.0.0.0:9000->443. So is it right?

Here is my docker-compose file:

   version: '3' volumes:   whatsappMedia:     driver: local   mysqlData:     driver: local services:   db:     image: mysql:5.7.22     restart: always     environment:       MYSQL_ROOT_PASSWORD: hello123       MYSQL_USER: root       MYSQL_PASSWORD: hello123     expose:         - "33060"     ports:         - "33060:3306"     volumes:      - mysqlData:/var/lib/mysql     network_mode: bridge   wacore:     image: docker.whatsapp.biz/coreapp:v${WA_API_VERSION:?Run docker-compose with env var WA_API_VERSION (ex. WA_API_VERSION=2.25.1 docker-compose <command> <options>)}     command: ["/opt/whatsapp/bin/wait_on_mysql.sh", "/opt/whatsapp/bin/launch_within_docker.sh"]     volumes:      - whatsappMedia:/usr/local/wamedia     env_file:       - db.env     environment:       # This is the version of the docker templates being used to run WhatsApp Business API       WA_RUNNING_ENV_VERSION: v2.2.3       ORCHESTRATION: DOCKER-COMPOSE     depends_on:       - "db"     network_mode: bridge     links:       - db   waweb:     image: docker.whatsapp.biz/web:v${WA_API_VERSION:?Run docker-compose with env var WA_API_VERSION (ex. WA_API_VERSION=2.25.1 docker-compose <command> <options>)}     command: ["/opt/whatsapp/bin/wait_on_mysql.sh", "/opt/whatsapp/bin/launch_within_docker.sh"]     ports:      - "9090:443"     volumes:      - whatsappMedia:/usr/local/wamedia     env_file:       - db.env     environment:       WACORE_HOSTNAME: wacore       # This is the version of the docker templates being used to run WhatsApp Business API       WA_RUNNING_ENV_VERSION: v2.2.3       ORCHESTRATION: DOCKER-COMPOSE     depends_on:       - "db"       - "wacore"     links:       - db       - wacore     network_mode: bridge 

While trying Developer setup: Single Instance from WhatsApp Business Api with following documentation at https://developers.facebook.com/docs/whatsapp/installation/dev-single-instance#setup

Getting the following error while trying Initial Setup#Step 7

Their was an error in connecting https://localhost:9090/v1/health 

Using postman collection as suggested in Step 6. Seems to be docker issue, but not sure.

Any idea?

I am trying to set up for Whatsapp business API.
Referring to the Link for setup.

I am working on windows 10 OS. -- Just for Info.

In the section initial setup, on command docker-compose up -d I get the error.

Missing mandatory value for "image" option in service "wacore": Run docker-compose with env var WA_API_VERSION (ex. WA_API_VERSION=2.21.4 docker-compose )

Thank You.