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

Error running Frappe on Mac M1 Arm64 #1537

Open
namansingh2623 opened this issue Jan 5, 2025 · 9 comments
Open

Error running Frappe on Mac M1 Arm64 #1537

namansingh2623 opened this issue Jan 5, 2025 · 9 comments
Labels

Comments

@namansingh2623
Copy link

Steps performed:
git clone https://github.com/frappe/frappe_docker
cd frappe_docker

docker buildx bake --no-cache --set "*.platform=linux/arm64"

add platform: linux/arm64 to all services in the pwd.yaml
replace the current specified versions of erpnext image on pwd.yml with :latest
Then run: docker compose -f pwd.yml up -d

This is what my yaml file looks like:

version: "latest"

services:
  backend:
    image: frappe/erpnext:v15.26.1
    deploy:
      restart_policy:
        condition: on-failure
    volumes:
      - sites:/home/frappe/frappe-bench/sites
      - logs:/home/frappe/frappe-bench/logs
    platform: linux/arm64

  configurator:
    image: frappe/erpnext:v15.26.1
    deploy:
      restart_policy:
        condition: none
    entrypoint:
      - bash
      - -c
    command:
      - >
        ls -1 apps > sites/apps.txt;
        bench set-config -g db_host $$DB_HOST;
        bench set-config -gp db_port $$DB_PORT;
        bench set-config -g redis_cache "redis://$$REDIS_CACHE";
        bench set-config -g redis_queue "redis://$$REDIS_QUEUE";
        bench set-config -g redis_socketio "redis://$$REDIS_QUEUE";
        bench set-config -gp socketio_port $$SOCKETIO_PORT;
    environment:
      DB_HOST: db
      DB_PORT: "3306"
      REDIS_CACHE: redis-cache:6379
      REDIS_QUEUE: redis-queue:6379
      SOCKETIO_PORT: "9000"
    volumes:
      - sites:/home/frappe/frappe-bench/sites
      - logs:/home/frappe/frappe-bench/logs
    platform: linux/arm64
  create-site:
    image: frappe/erpnext:v15.26.1
    deploy:
      restart_policy:
        condition: none
    volumes:
      - sites:/home/frappe/frappe-bench/sites
      - logs:/home/frappe/frappe-bench/logs
    entrypoint:
      - bash
      - -c
    command:
      - >
        wait-for-it -t 120 db:3306;
        wait-for-it -t 120 redis-cache:6379;
        wait-for-it -t 120 redis-queue:6379;
        export start=`date +%s`;
        until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \
          [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_cache // empty"` ]] && \
          [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_queue // empty"` ]];
        do
          echo "Waiting for sites/common_site_config.json to be created";
          sleep 5;
          if (( `date +%s`-start > 120 )); then
            echo "could not find sites/common_site_config.json with required keys";
            exit 1
          fi
        done;
        echo "sites/common_site_config.json found";
        bench new-site --no-mariadb-socket --admin-password=admin --db-root-password=admin --install-app erpnext --set-default frontend;
    platform: linux/arm64
  db:
    image: mariadb:10.6
    healthcheck:
      test: mysqladmin ping -h localhost --password=admin
      interval: 1s
      retries: 15
    deploy:
      restart_policy:
        condition: on-failure
    command:
      - --character-set-server=utf8mb4
      - --collation-server=utf8mb4_unicode_ci
      - --skip-character-set-client-handshake
      - --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6
    environment:
      MYSQL_ROOT_PASSWORD: admin
    volumes:
      - db-data:/var/lib/mysql
    platform: linux/arm64
  frontend:
    image: frappe/erpnext:v15.26.1
    depends_on:
      - websocket
    deploy:
      restart_policy:
        condition: on-failure
    command:
      - nginx-entrypoint.sh
    environment:
      BACKEND: backend:8000
      FRAPPE_SITE_NAME_HEADER: frontend
      SOCKETIO: websocket:9000
      UPSTREAM_REAL_IP_ADDRESS: 127.0.0.1
      UPSTREAM_REAL_IP_HEADER: X-Forwarded-For
      UPSTREAM_REAL_IP_RECURSIVE: "off"
      PROXY_READ_TIMEOUT: 120
      CLIENT_MAX_BODY_SIZE: 50m
    volumes:
      - sites:/home/frappe/frappe-bench/sites
      - logs:/home/frappe/frappe-bench/logs
    ports:
      - "8080:8080"
    platform: linux/arm64
  queue-long:
    platform: linux/arm64
    image: frappe/erpnext:v15.26.1
    deploy:
      restart_policy:
        condition: on-failure
    command:
      - bench
      - worker
      - --queue
      - long,default,short
    volumes:
      - sites:/home/frappe/frappe-bench/sites
      - logs:/home/frappe/frappe-bench/logs

  queue-short:
    platform: linux/arm64
    image: frappe/erpnext:v15.26.1
    deploy:
      restart_policy:
        condition: on-failure
    command:
      - bench
      - worker
      - --queue
      - short,default
    volumes:
      - sites:/home/frappe/frappe-bench/sites
      - logs:/home/frappe/frappe-bench/logs

  redis-queue:
    platform: linux/arm64
    image: redis:6.2-alpine
    deploy:
      restart_policy:
        condition: on-failure
    volumes:
      - redis-queue-data:/data

  redis-cache:
    platform: linux/arm64
    image: redis:6.2-alpine
    deploy:
      restart_policy:
        condition: on-failure
    volumes:
      - redis-cache-data:/data

  scheduler:
    platform: linux/arm64
    image: frappe/erpnext:v15.26.1
    deploy:
      restart_policy:
        condition: on-failure
    command:
      - bench
      - schedule
    volumes:
      - sites:/home/frappe/frappe-bench/sites
      - logs:/home/frappe/frappe-bench/logs

  websocket:
    platform: linux/arm64
    image: frappe/erpnext:v15.26.1
    deploy:
      restart_policy:
        condition: on-failure
    command:
      - node
      - /home/frappe/frappe-bench/apps/frappe/socketio.js
    volumes:
      - sites:/home/frappe/frappe-bench/sites
      - logs:/home/frappe/frappe-bench/logs

volumes:
  db-data:
  redis-queue-data:
  redis-cache-data:
  sites:
  logs:

Got the following error:

naman@Namans-MacBook-Pro frappe_docker % docker compose -f pwd.yml up -d
[+] Running 0/11
 ⠿ queue-long Error                                                                                                                                                                                        1.1s
 ⠋ redis-queue Pulling                                                                                                                                                                                     1.1s
 ⠋ queue-short Pulling                                                                                                                                                                                     1.1s
 ⠿ create-site Error                                                                                                                                                                                       1.1s
 ⠿ backend Error                                                                                                                                                                                           1.1s
 ⠿ redis-cache Error                                                                                                                                                                                       1.1s
 ⠿ configurator Error                                                                                                                                                                                      1.1s
 ⠿ scheduler Error                                                                                                                                                                                         1.1s
 ⠿ websocket Error                                                                                                                                                                                         1.1s
 ⠿ frontend Error                                                                                                                                                                                          1.1s
 ⠿ db Error                                                                                                                                                                                                1.1s
no matching manifest for linux/arm64 in the manifest list entries

I tried with
version: "latest"
version: latest

@namansingh2623
Copy link
Author

I created a new repository. Did the git clone again.
Ran the commands.

naman@Namans-MacBook-Pro frappe_docker % docker compose -f pwd.yml up -d                             
[+] Running 15/16
 ⠿ Network frappe_docker_frappe_network     Created                                                                                                                                                              0.1s
 ⠿ Volume "frappe_docker_logs"              Created                                                                                                                                                              0.0s
 ⠿ Volume "frappe_docker_redis-cache-data"  Created                                                                                                                                                              0.0s
 ⠿ Volume "frappe_docker_db-data"           Created                                                                                                                                                              0.0s
 ⠿ Volume "frappe_docker_redis-queue-data"  Created                                                                                                                                                              0.0s
 ⠿ Volume "frappe_docker_sites"             Created                                                                                                                                                              0.0s
 ⠿ Container frappe_docker-redis-queue-1    Created                                                                                                                                                              0.2s
 ⠿ Container frappe_docker-redis-cache-1    Created                                                                                                                                                              0.2s
 ⠿ Container frappe_docker-queue-short-1    Created                                                                                                                                                              0.3s
 ⠿ Container frappe_docker-queue-long-1     Created                                                                                                                                                              0.3s
 ⠿ Container frappe_docker-scheduler-1      Created                                                                                                                                                              0.3s
 ⠿ Container frappe_docker-websocket-1      Created                                                                                                                                                              0.3s
 ⠿ Container frappe_docker-db-1             Created                                                                                                                                                              0.2s
 ⠸ Container frappe_docker-create-site-1    Creating                                                                                                                                                             0.4s
 ⠿ Container frappe_docker-backend-1        Created                                                                                                                                                              0.3s
 ⠸ Container frappe_docker-configurator-1   Creating                                                                                                                                                             0.4s
 ⠿ Container frappe_docker-frontend-1       Created                                                                                                                                                              0.1s
Error response from daemon: invalid restart policy 'none'

@revant
Copy link
Collaborator

revant commented Jan 6, 2025

Hope someone using mac helps you.

@DiegoTc
Copy link

DiegoTc commented Jan 15, 2025

I created a new repository. Did the git clone again. Ran the commands.

naman@Namans-MacBook-Pro frappe_docker % docker compose -f pwd.yml up -d
[+] Running 15/16
⠿ Network frappe_docker_frappe_network Created 0.1s
⠿ Volume "frappe_docker_logs" Created 0.0s
⠿ Volume "frappe_docker_redis-cache-data" Created 0.0s
⠿ Volume "frappe_docker_db-data" Created 0.0s
⠿ Volume "frappe_docker_redis-queue-data" Created 0.0s
⠿ Volume "frappe_docker_sites" Created 0.0s
⠿ Container frappe_docker-redis-queue-1 Created 0.2s
⠿ Container frappe_docker-redis-cache-1 Created 0.2s
⠿ Container frappe_docker-queue-short-1 Created 0.3s
⠿ Container frappe_docker-queue-long-1 Created 0.3s
⠿ Container frappe_docker-scheduler-1 Created 0.3s
⠿ Container frappe_docker-websocket-1 Created 0.3s
⠿ Container frappe_docker-db-1 Created 0.2s
⠸ Container frappe_docker-create-site-1 Creating 0.4s
⠿ Container frappe_docker-backend-1 Created 0.3s
⠸ Container frappe_docker-configurator-1 Creating 0.4s
⠿ Container frappe_docker-frontend-1 Created 0.1s
Error response from daemon: invalid restart policy 'none'

I'm getting the same error, were you able to fix it?

@DiegoTc
Copy link

DiegoTc commented Jan 15, 2025

So I was able to make it run
Setting it this way

    deploy:
      restart_policy:
        condition: "no"

@gischy
Copy link

gischy commented Jan 30, 2025

seems not to be mac related, im getting the same error "Error response from daemon: invalid restart policy 'none'" when running docker compose -f pwd.yml up -d on windows

@ja3ooni
Copy link

ja3ooni commented Feb 10, 2025

here is what i did to fix this issue:

step 1: git clone https://github.com/frappe/frappe_docker
step 2: cd frappe_docker
step 3: docker buildx bake --no-cache --set "*.platform=linux/arm64"
step 4: open pwd.yml and add
- platform: linux/arm64 under image tag
- image version changed to image: frappe/erpnext:latest
Step 5: docker compose -f pwd.yml up -d
Step 6: Open: http://localhost:8080

@namansingh2623
Copy link
Author

I deployed it without the docker on my system for the time being. I was able to deploy it on AWS with same code easily.

@codewithjaspreet
Copy link

codewithjaspreet commented Mar 28, 2025

this is a valid answer @ja3ooni works for me to on M1 Apple silicon

but I have a question can't we install it on same image that comes pre-define in pwd.yaml , it fails there and site won't run and throw internal server error , developing locally on most latest version is recommended ?

@revant

@whinee
Copy link

whinee commented Mar 28, 2025

@codewithjaspreet is it like

internal server error
frontend site not found

or something along those lines? Here is my gist that contains my working docker compose .yaml file, and my observations :333

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

No branches or pull requests

7 participants