Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several issues related with M1 #1

Closed
jvallef opened this issue Nov 25, 2021 · 4 comments
Closed

Several issues related with M1 #1

jvallef opened this issue Nov 25, 2021 · 4 comments

Comments

@jvallef
Copy link

jvallef commented Nov 25, 2021

Hi, great tutorial. I'm trying to install your system on Mac M1.

Because you're a docker wizard, maybe you can help me. I tried to find answers online but there are many pieces I have not much control over.

#1
Docker install worked.

#2
docker-compose up --build
Brings first error:
ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries
Fixed adding in docker-composer.yaml
platform: linux/amd64
After
image: mysql:5.7

#3
Running again docker-compose up --build Brings a new error:

...
#15 26.75 The chromium binary is not available for arm64.
#15 26.75 If you are on Ubuntu, you can install with: 
#15 26.75 
#15 26.75  sudo apt install chromium
#15 26.75 
#15 26.75 
#15 26.75  sudo apt install chromium-browser
...

For M1 Chromium already works. Can be installed with homebrew

brew install chromium
which chromium
/opt/homebrew/bin/chromium
chromium

Found several threads add these lines to .zshrc fix the issue of Chromium with M1

export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
export PUPPETEER_EXECUTABLE_PATH=`which chromium`

Restart Terminal or run source ~/.zshrc
Then starts Chromium. It worked.
When back to Terminal noticed some errors, but remember it worked any way. These are errors, don't know if they are relevant

[17454:36099:1125/154359.196792:ERROR:chrome_browser_main_extra_parts_metrics.cc(227)] START: ReportBluetoothAvailability(). If you don't see the END: message, this is crbug.com/1216328.
[17454:36099:1125/154359.198640:ERROR:chrome_browser_main_extra_parts_metrics.cc(230)] END: ReportBluetoothAvailability()
[17454:36099:1125/154359.198675:ERROR:chrome_browser_main_extra_parts_metrics.cc(235)] START: GetDefaultBrowser(). If you don't see the END: message, this is crbug.com/1216328.
[17454:36099:1125/154359.199755:ERROR:chrome_browser_main_extra_parts_metrics.cc(239)] END: GetDefaultBrowser()

The question is what would be the way to add those changes to be handled in the container?

Or if you realise other way to fix it.

Thanks

@bgastaldi
Copy link
Collaborator

bgastaldi commented Nov 25, 2021

Hi,

You can put everything you've done in a new dockerfile. That way, when you run docker-compose it will get the settings defined.

Unfortunately I don't have M1 to test.

Best Regards.

@jvallef
Copy link
Author

jvallef commented Nov 25, 2021

I came to report how is going maybe could be useful for somebody else.

Just for curiosity I added platform:linux/amd64 to every place in docker-compose below each image:xxx and... it works!

Docker took a very long time to build the new system, probably it have to compile some assets, not sure, limited linux knowledge.

Rest of tests worked until the point it retrieve the QR code. When go to http://localcost:8080 after a few seconds ir returns in the browser:

Array
(
    [status] => INITIALIZING
    [session] => mySessionPHP
)

but anything is displayed in terminal or folders or files created in webhook as in your examples.

Last lines in the Terminal log...

wppconnect-nginx         | 172.20.0.1 - - [25/Nov/2021:16:31:04 +0000] "GET /js/dist/gis_data_editor.js?v=5.1.1 HTTP/1.1" 200 3594 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63" "-"
wppconnect-phpmyadmin    | 172.20.0.6 - - [25/Nov/2021:16:31:04 +0000] "GET /js/dist/gis_data_editor.js?v=5.1.1 HTTP/1.1" 200 3946 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63"
wppconnect-nginx         | 172.20.0.1 - - [25/Nov/2021:16:31:04 +0000] "GET /js/dist/table/change.js?v=5.1.1 HTTP/1.1" 200 8043 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63" "-wppconnect-nginx         | 172.20.0.5 - - [25/Nov/2021:16:53:17 +0000] "POST /api/mySessionPHP/start-session HTTP/1.1" 200 50 "-" "-" "-"
wppconnect-nginx         | 172.20.0.1 - - [25/Nov/2021:16:53:17 +0000] "GET / HTTP/1.1" 200 91 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63" "-"
wppconnect-php-client    | 172.20.0.6 -  25/Nov/2021:16:53:17 +0000 "GET /index.php" 200
wppconnect-nginx         | 172.20.0.1 - - [25/Nov/2021:16:55:14 +0000] "POST /index.php?route=/ HTTP/1.1" 200 1598 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63" "-"
wppconnect-phpmyadmin    | 172.20.0.6 - - [25/Nov/2021:16:55:14 +0000] "POST /index.php?route=/ HTTP/1.1" 200 2205 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63"
wppconnect-nginx         | 172.20.0.5 - - [25/Nov/2021:16:59:49 +0000] "POST /api/mySessionPHP/start-session HTTP/1.1" 200 50 "-" "-" "-"
wppconnect-nginx         | 172.20.0.1 - - [25/Nov/2021:16:59:49 +0000] "GET / HTTP/1.1" 200 91 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63" "-"
wppconnect-php-client    | 172.20.0.6 -  25/Nov/2021:16:59:48 +0000 "GET /index.php" 200
wppconnect-nginx         | 172.20.0.5 - - [25/Nov/2021:16:59:51 +0000] "POST /api/mySessionPHP/start-session HTTP/1.1" 200 50 "-" "-" "-"
wppconnect-php-client    | 172.20.0.6 -  25/Nov/2021:16:59:51 +0000 "GET /index.php" 200
wppconnect-nginx         | 172.20.0.1 - - [25/Nov/2021:16:59:51 +0000] "GET / HTTP/1.1" 200 91 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63" "-"
wppconnect-nginx         | 172.20.0.5 - - [25/Nov/2021:17:00:21 +0000] "POST /api/mySessionPHP/start-session HTTP/1.1" 200 50 "-" "-" "-"
wppconnect-php-client    | 172.20.0.6 -  25/Nov/2021:17:00:20 +0000 "GET /index.php" 200
wppconnect-nginx         | 172.20.0.1 - - [25/Nov/2021:17:00:21 +0000] "GET / HTTP/1.1" 200 91 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63" "-"
wppconnect-php-client    | 172.20.0.6 -  25/Nov/2021:17:00:49 +0000 "GET /index.php" 200
wppconnect-nginx         | 172.20.0.1 - - [25/Nov/2021:17:00:49 +0000] "GET / HTTP/1.1" 200 14 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63" "-"
wppconnect-nginx         | 172.20.0.5 - - [25/Nov/2021:17:01:27 +0000] "POST /api/mySessionPHP/start-session HTTP/1.1" 200 50 "-" "-" "-"
wppconnect-php-client    | 172.20.0.6 -  25/Nov/2021:17:01:26 +0000 "GET /index.php" 200
wppconnect-nginx         | 172.20.0.1 - - [25/Nov/2021:17:01:27 +0000] "GET / HTTP/1.1" 200 15 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63" "-"
wppconnect-nginx         | 172.20.0.5 - - [25/Nov/2021:17:06:56 +0000] "POST /api/mySessionPHP/start-session HTTP/1.1" 200 50 "-" "-" "-"
wppconnect-php-client    | 172.20.0.6 -  25/Nov/2021:17:06:55 +0000 "GET /index.php" 200
wppconnect-nginx         | 172.20.0.1 - - [25/Nov/2021:17:06:56 +0000] "GET / HTTP/1.1" 200 91 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63" "-"
wppconnect-nginx         | 172.20.0.5 - - [25/Nov/2021:17:07:12 +0000] "POST /api/mySessionPHP/start-session HTTP/1.1" 200 50 "-" "-" "-"
wppconnect-nginx         | 172.20.0.1 - - [25/Nov/2021:17:07:12 +0000] "GET / HTTP/1.1" 200 91 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63" "-"
wppconnect-php-client    | 172.20.0.6 -  25/Nov/2021:17:07:12 +0000 "GET /index.php" 200

Any idea about what I could check?

Thanks

@jvallef
Copy link
Author

jvallef commented Nov 25, 2021

This it's what worked for now in docker-compose.yaml, still testing.

If there is more convenient way to do it, please share.

version: '3'

services: 

  wppconnect-mysql:
    image: mysql:5.7
    platform: linux/amd64
    container_name: wppconnect-mysql
    command: --innodb-use-native-aio=0
    restart: always
    tty: true
    volumes: 
      - ./wppconnect-mysql/sql/db_table.sql:/docker-entrypoint-initdb.d/db_table.sql
      - ./wppconnect-mysql/db:/var/lib/mysql
    environment: 
      - MYSQL_DATABASE=wpp_db
      - MYSQL_ROOT_PASSWORD=root
    ports:
      - 3306:3306
    networks: 
      - wpp-network

  wppconnect-phpmyadmin:
    image: phpmyadmin/phpmyadmin:latest
    platform: linux/amd64
    container_name: wppconnect-phpmyadmin
    restart: always
    environment:
      PMA_HOST: wppconnect-mysql
      PMA_DB: wpp_db
      PMA_USER: root
      PMA_PASSWORD: root
      PMA_ARBITRARY: 1
    depends_on:
      - wppconnect-mysql
    networks: 
      - wpp-network

  wppconnect-server:
    build: 
      context: ./wppconnect-server
      dockerfile: Dockerfile
    image: wppconnect-server
    platform: linux/amd64
    restart: always
    container_name: wppconnect-server
    hostname: wppconnect-server
    entrypoint: dockerize -wait tcp://wppconnect-mysql:3306 -timeout 20s docker-entrypoint.sh yarn dev
    networks: 
      - wpp-network
    tty: true
    depends_on:
      - wppconnect-mysql
  
  wppconnect-php-client:
    build: 
      context: ./wppconnect-php-client
      dockerfile: Dockerfile
    image: wppconnect-php-client
    platform: linux/amd64
    container_name: wppconnect-php-client
    hostname: wppconnect-php-client
    volumes: 
      - ./wppconnect-php-client/app/html:/var/www/html
    networks: 
      - wpp-network
    tty: true
    depends_on:
      - wppconnect-server
       
  wppconnect-nginx:
    build: 
      context: ./wppconnect-nginx
      dockerfile: Dockerfile
    container_name: wppconnect-nginx
    entrypoint: nginx -g "daemon off;"
    ports:
      - "8080:8080" #php-client
      - "8081:8081" #wppconnect-server
      - "8082:8082" #phpmyadmin
    networks: 
      - wpp-network
    depends_on:
      - wppconnect-php-client

networks: 
  wpp-network:
    name: wpp-network
    driver: bridge 

@jvallef
Copy link
Author

jvallef commented Nov 25, 2021

Hi,

found the issue, but got no solution. If anybody could help to trace error and fix it...

The problem it's with the browser, the reason... no idea.

I installed again to try with linux/arm64, didn't worked, and back to linux/amd64.

After new installation, when try to get QR, listing from Terminal...

wppconnect-nginx         | 172.20.0.5 - - [25/Nov/2021:17:44:08 +0000] "POST /api/mySessionPHP/My53cr3tKY/generate-token HTTP/1.1" 201 199 "-" "-" "-"
wppconnect-php-client    | 172.20.0.6 -  25/Nov/2021:17:44:08 +0000 "GET /index.php" 200
wppconnect-nginx         | 172.20.0.1 - - [25/Nov/2021:17:44:08 +0000] "GET / HTTP/1.1" 200 250 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63" "-"
wppconnect-server        | info:     
wppconnect-server        |   _       ______  ____  ______                            __ 
wppconnect-server        |   | |     / / __ \/ __ \/ ____/___  ____  ____  ___  _____/ /_
wppconnect-server        |   | | /| / / /_/ / /_/ / /   / __ \/ __ \/ __ \/ _ \/ ___/ __/
wppconnect-server        |   | |/ |/ / ____/ ____/ /___/ /_/ / / / / / / /  __/ /__/ /_  
wppconnect-server        |   |__/|__/_/   /_/    \____/\____/_/ /_/_/ /_/\___/\___/\__/
wppconnect-server        | info:     Checking for updates
wppconnect-server        | info:     You're up to date
wppconnect-server        | info:     [mySessionPHP:browser] Initializing browser...
wppconnect-server        | error:    [mySessionPHP:browser] Error no open browser
wppconnect-server        | error:    [mySessionPHP:browser] Protocol error (Target.setDiscoverTargets): Target closed.
wppconnect-server        | error: 2021-11-25T17:45:35.250Z Protocol error (Target.setDiscoverTargets): Target closed. - Error: Protocol error (Target.setDiscoverTargets): Target closed.
wppconnect-server        |     at /home/node/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:71:63
wppconnect-server        |     at new Promise (<anonymous>)
wppconnect-server        |     at Connection.send (/home/node/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:70:16)
wppconnect-server        |     at Function.create (/home/node/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Browser.js:118:26)
wppconnect-server        |     at ChromeLauncher.launch (/home/node/app/node_modules/puppeteer/lib/cjs/puppeteer/node/Launcher.js:109:56)
wppconnect-server        |     at processTicksAndRejections (internal/process/task_queues.js:95:5)
wppconnect-server        |     at async PuppeteerExtra.launch (/home/node/app/node_modules/puppeteer-extra/dist/index.cjs.js:129:25)
wppconnect-nginx         | 172.20.0.5 - - [25/Nov/2021:17:45:59 +0000] "POST /api/mySessionPHP/start-session HTTP/1.1" 499 0 "-" "-" "-"
wppconnect-php-client    | 172.20.0.6 -  25/Nov/2021:17:45:29 +0000 "GET /index.php" 200
wppconnect-nginx         | 172.20.0.1 - - [25/Nov/2021:17:45:59 +0000] "GET / HTTP/1.1" 200 89 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63" "-"
wppconnect-nginx         | 172.20.0.5 - - [25/Nov/2021:17:46:44 +0000] "POST /api/mySessionPHP/start-session HTTP/1.1" 200 50 "-" "-" "-"
wppconnect-nginx         | 172.20.0.1 - - [25/Nov/2021:17:46:44 +0000] "GET / HTTP/1.1" 200 91 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 OPR/80.0.4170.63" "-"
wppconnect-php-client    | 172.20.0.6 -  25/Nov/2021:17:46:43 +0000 "GET /index.php" 200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants