Posts tagged with docker

I've installed WhatsApp business client on my linux docker containers, I have managed to hit the /v1/health route perfectly and have also changed the default password through an endpoint.

But, I'm getting an error when I try to access POST request /v1/contacts . The error is:

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

However, my wacore container is indeed running:

Docker Container Image

P.S: Some questions already posted here with similar titles don't solve my issue.

I want to implement "WhatsApp Business API Client" in my web application. I want to send document from my web application to customer using "WhatsApp Business API Client". I have flow the instruction from bellow link

https://developers.facebook.com/docs/whatsapp/on-premises/get-started 

I have created both Facebook and WhatsApp business account. I have also created app in Facebook and verify my business through Facebook. After that I have started to install "WhatsApp Business API Client" using docker. I have flow bellow link to install docker

https://developers.facebook.com/docs/whatsapp/on-premises/get-started/installation/dev-single-instance#step-6--login-and-authenticate 
  1. I have created "biz" using command from terminal

  2. set WhatsApp API version "2.31.5" 3 Run "docker-compose up -d" from terminal. But when I run the above command then face some error in terminal Error are given bellow

    C:\xampp\htdocs\whatapp>docker-compose up -d

    Traceback (most recent call last): File "docker\api\client.py", line 214, in _retrieve_server_version

    File "docker\api\daemon.py", line 181, in version

    File "docker\utils\decorators.py", line 46, in inner

    File "docker\api\client.py", line 237, in _get

    File "requests\sessions.py", line 543, in get

    File "requests\sessions.py", line 530, in request

    File "requests\sessions.py", line 643, in send

    File "requests\adapters.py", line 439, in send

    File "urllib3\connectionpool.py", line 670, in urlopen

    File "urllib3\connectionpool.py", line 392, in _make_request

    File "http\client.py", line 1255, in request

    File "http\client.py", line 1301, in _send_request

    File "http\client.py", line 1250, in endheaders

    File "http\client.py", line 1010, in _send_output

    File "http\client.py", line 950, in send

    File "docker\transport\npipeconn.py", line 32, in connect

    File "docker\transport\npipesocket.py", line 23, in wrapped

    File "docker\transport\npipesocket.py", line 72, in connect

    File "docker\transport\npipesocket.py", line 52, in connect

    pywintypes.error: (2, 'CreateFile', 'The system cannot find the file specified.')

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "docker-compose", line 3, in

    File "compose\cli\main.py", line 81, in main

    File "compose\cli\main.py", line 200, in perform_command

    File "compose\cli\command.py", line 60, in project_from_options

    File "compose\cli\command.py", line 152, in get_project

    File "compose\cli\docker_client.py", line 41, in get_client

    File "compose\cli\docker_client.py", line 170, in docker_client

    File "docker\api\client.py", line 197, in init

    File "docker\api\client.py", line 221, in _retrieve_server_version

    docker.errors.DockerException: Error while fetching server API version: (2, 'CreateFile', 'The system cannot find the file specified.')

    [6012] Failed to execute script docker-compose

Please help me how solve the issue. Thank You

I use Whatsapp Business API and started 3 docker images to do it. But I don't know url to make requests. I tried 0.0.0.0:9090, 127.0.0.1:9090, localhost:9090 but nothing works. How can I know right url?

Under docker containers I add attach image. And as stackoverflow restricts me to post question I need add some text "water".

Here is a file with settings docker-compose.yml version: '3'

volumes:   whatsappMedia:     driver: local   mysqlData:     driver: local services:    db:      image: mysql:5.7.35      restart: always      environment:         MYSQL_ROOT_PASSWORD: testpass         MYSQL_USER: testuser         MYSQL_PASSWORD: testpass      expose:         - "33060"     ports:     - "33060:3306" volumes:  - mysqlData:/var/lib/mysql network_mode: bridge cap_drop:   - MKNOD wacore:  image: docker.whatsapp.biz/coreapp:v${WA_API_VERSION:-2.35.5?Run docker-compose with env var WA_API_VERSION (ex. WA_API_VERSION=2.37.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 cap_drop:   - MKNOD waweb: image: docker.whatsapp.biz/web:v${WA_API_VERSION:-2.35.4?Run docker-compose with env var WA_API_VERSION (ex. WA_API_VERSION=2.37.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 cap_drop:   - MKNOD 

I had cloned these file as per facebook instructions

And then Step 1: Create a biz Directory for the Setup Scripts

mkdir ~/biz; cd ~/biz; 

Step 2: Get the WhatsApp Business API Client Configuration Files

   db.env docker-compose.yml multiconnect-compose.yml 

Step 3: Set the WA_API_VERSION Environment Variable

export WA_API_VERSION=2.31.5 

Step 4: Start the WhatsApp Business API Client

docker-compose up -d 

The resulting output should look like the following:

Recreating whatsbusinessapi_db_1 ... done Creating whatsbusinessapi_wacore_1 ... done Creating whatsbusinessapi_waweb_1  ... done 

Step 5: Verify Containers Are Running

docker-compose ps 

output :

          Name                         Command               State                     Ports                    --------------------------------------------------------------------------------------------------------------- whatsbusinessapi_db_1       docker-entrypoint.sh -p 54 ...   Up      5000/tcp, 5432/tcp, 0.0.0.0:5000->6000/tcp whatsbusinessapi_wacore_1   /opt/whatsapp/bin/wait_on_ ...   Up      6250/tcp, 6251/tcp, 6252/tcp, 6253/tcp     whatsbusinessapi_waweb_1    /opt/whatsapp/bin/wait_on_ ...   Up      0.0.0.0:9090->443/tcp 

By default, the Webapp container will be running on port 9090 (https://localhost:9090) as per facebook but when i tried https://localhost:9090

So anyone have idea please.

After proceed with the installation of WhatsApp Business API (developer single instance) in docker on windows 10 Enterprise, I´m facing the following msg error when using https://192.168.43.200:8080/v1/health by postman Error msg: { "meta": { "version": "v2.33.3", "api_status": "stable" }, "errors": [ { "code": 1014, "title": "Internal error", "details": "php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution. Please check if wacore is running: wacore:6252" } ] }

Looking in log files it´s seems that the core is listening in one port that is different from expected by web

---> Web log [2021-02-24 12:46:38.560338] app.INFO: [064af96616514f6f8b41fc530047db4b] Matched route "{route}". {"route":"GET_v1_health","route_parameters":{"_controller":"WhatsApp\Controller\HealthController::getHealth","_route":"GET_v1_health"},"request_uri":"https://192.168.43.200:8080/v1/health","method":"GET"} []

[2021-02-24 12:46:38.587929] app.INFO: [064af96616514f6f8b41fc530047db4b] Guard authentication successful! {"token":"[object] (Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken: PostAuthenticationGuardToken(user="admin", authenticated=true, roles="ROLE_ADMIN"))","authenticator":"WhatsApp\Security\TokenAuthenticator"} []

[2021-02-24 12:47:14.646964] app.INFO: [064af96616514f6f8b41fc530047db4b] Response: {"meta":{"version":"v2.33.3","api_status":"stable"},"errors":[{"code":1014,"title":"Internal error","details":"php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution. Please check if wacore is running: wacore:6252"}]} []

[2021-02-24 12:47:14.650236] app.INFO: [064af96616514f6f8b41fc530047db4b] Request GET_/v1/health returns 500 in 36269.15 ms [] []

=================================================================================== Core log D 2021-02-24 12:10:39.282 UTC 28 apiendpointmanager.cpp:190] Endpoint "healthcheck" is listening on address "0.0.0.0" port 6253 req_id=Main D 2021-02-24 12:10:39.282 UTC 29 apiendpointmanager.cpp:190] Endpoint "control" is listening on address "0.0.0.0" port 6252 req_id=Main

===================================================================================

$ docker network ls NETWORK ID NAME DRIVER SCOPE 9d811d5d3283 Default Switch ics local 27dc22b69113 nat nat local 4e2733cd792d none null local

$ docker container ls -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 8d7000856b95 docker.whatsapp.biz/web:v2.33.3 "/opt/whatsapp/bin/w…" 17 hours ago Exited (4294967295) 6 minutes ago postgres_waweb_1 909781cdb775 docker.whatsapp.biz/coreapp:v2.33.3 "/opt/whatsapp/bin/w…" 17 hours ago Up 5 minutes 6250-6253/tcp postgres_wacore_1 7d68b7a61cad postgres:10.6 "docker-entrypoint.s…" 17 hours ago Up 6 minutes 5432/tcp, 33060/tcp, 0.0.0.0:33060->3306/tcp postgres_db_1 219b1e393f21 nginx "/docker-entrypoint.…" 42 hours ago Exited (4294967295) 41 hours ago nostalgic_jennings

Regards,