[ok] Easy Install Script - AMD based Compute VMs with 1/8 OCPU and 1 GB memory - amd64 CPU - Docker

https://discuss.frappe.io/t/easiest-simple-way-to-install-erpnext-13/77641/9

____xx …140 UK
AMD based Compute VMs with 1/8 OCPU and 1 GB memory
Base system Ubuntu 22.04.1

sudo docker --version && docker compose version
Docker version 20.10.22, build 3a2c30b
Docker Compose version v2.14.1

start

sudo python3 easy-install.py --prod
file "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 664, in connect
    raise exc
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'db' ([Errno -3] Temporary failure in name resolution)")
 Bench Site creation failed
 Command '['/usr/bin/docker', 'compose', '-p', 'frappe', 'exec', 'backend', 'bench', 'new-site', 'site1.local', '--db-root-password', '5cfab9fbb', '--admin-password', '7448b2278329', '--install-app', 'erpnext', '--set-default']' returned non-zero exit status 1. 

The same problem

How can i solved the problem, where is my mistake?

Docker information:

images

sudo docker images
REPOSITORY               TAG          IMAGE ID       CREATED         SIZE
frappe/frappe-socketio   v14.21.0     1d80eba2681f   11 hours ago    184MB
frappe/erpnext-nginx     v14.11.1     c02dbdc41406   11 hours ago    341MB
frappe/erpnext-worker    v14.11.1     6f1f4540a8fa   11 hours ago    1.21GB
redis                    6.2-alpine   fde943dfa6d2   2 weeks ago     27.1MB
mariadb                  10.6         9abe0aec0e5e   3 weeks ago     404MB
traefik                  2.5          865923368a9f   11 months ago   101MB

volume

sudo docker volume ls
DRIVER    VOLUME NAME
local     frappe_assets
local     frappe_cert-data
local     frappe_db-data
local     frappe_redis-data
local     frappe_sites

docker ps

sudo docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

easy-install.log

/home/ubuntu/easy-install.log                                                              
2022-12-31 18:42:28,349 - INFO - Running Production Setup
2022-12-31 18:42:28,828 - INFO - Downloaded frappe_docker zip file from GitHub
2022-12-31 18:42:28,854 - INFO - Unzipped and Renamed frappe_docker
2022-12-31 18:42:28,854 - INFO - Removed the downloaded zip file
2022-12-31 18:47:35,860 - INFO - Docker Compose file generated at ~/frappe-compose.yml
2022-12-31 18:53:04,895 - ERROR - Bench site creation failed
Traceback (most recent call last):
  File "/home/ubuntu/easy-install.py", line 194, in setup_prod
    subprocess.run(
  File "/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/docker', 'compose', '-p', 'frappe', 'exec', 'backend', 'bench', 'new-site', 'site1.local', '--db-root-pas>







try adding swap

https://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/

Did you have a better solution?

How did you have create the swap space?

Did you have a tutorial link for this installation?

create swap space

sudo dd if=/dev/zero of=/mnt/4GiB.swap bs=1024 count=4194304

sudo chmod 600 /mnt/4GiB.swap

sudo mkswap /mnt/4GiB.swap

sudo swapon /mnt/4GiB.swap

echo '/mnt/4GiB.swap swap swap defaults 0 0' | sudo tee -a /etc/fstab

cat /proc/swaps 
Filename                                Type            Size            Used            Priority
/mnt/4GiB.swap                          file            4194300         308             -2

free -m
                     total        used        free      shared  buff/cache   available
Mem:             964         341          63           1         559         460
Swap:           4095          20        4075


than

wget https://raw.githubusercontent.com/frappe/bench/develop/easy-install.py
sudo python3 easy-install.py --prod --mail jannis@gmailxx.com
```**strong text**

output terminal

sudo python3 easy-install.py --prod --email jannis@gmaixx.com
 
Setting Up Production Instance                                                                           
 
                                                                                                        
 
 
Please refer to .example.env file in the frappe_docker folder to know which keys to set                  
 
                                                                                                        
 
                                                                                                        
 
 
A .env file is generated with basic configs. Please edit it to fit to your needs                         
 
                                                                                                        
 
[+] Running 16/17
⠿ Network frappe_default            Created                                                             
0.4s
⠿ Volume "frappe_sites"             Created                                                             
0.0s  
⠿ Volume "frappe_assets"            Created                                                             
0.0s  
⠿ Volume "frappe_cert-data"         Created                                                             
0.0s  
⠿ Volume "frappe_redis-data"        Created                                                             
0.1s  
⠿ Volume "frappe_db-data"           Created                                                             
0.0s  
⠿ Container frappe-db-1             Healthy                                                             
13.5s  
⠿ Container frappe-redis-1          Started                                                             
4.4s  
⠿ Container frappe-proxy-1          Started                                                             
4.1s  
⠿ Container frappe-configurator-1   Starting                                                            
13.6s  
⠿ Container frappe-websocket-1      Created                                                             
0.0s  
⠿ Container frappe-queue-default-1  Created                                                             
0.0s  
⠿ Container frappe-backend-1        Created                                                             
0.0s  
⠿ Container frappe-scheduler-1      Created                                                             
0.0s  
⠿ Container frappe-frontend-1       Created                                                             
0.0s  
⠿ Container frappe-queue-short-1    Created                                                             
0.0s  
⠿ Container frappe-queue-long-1     Created                                                             
0.0s  
Error response from daemon: network c45be9001821ffc82173444a4d79fd528b70a300a07a0d3c4595c8f0efff0ce1 not
found                      
 Docker Compose failed, please check the container logs
Command '['/usr/bin/docker', 'compose', '-p', 'frappe', '-f', '/root/frappe-compose.yml', 'up', '-d']' r
eturned non-zero exit status 1.

log file

at easy-install.log
2023-01-01 18:18:47,669 - INFO - Running Production Setup
2023-01-01 18:18:48,163 - INFO - Downloaded frappe_docker zip file from GitHub
2023-01-01 18:18:48,187 - INFO - Unzipped and Renamed frappe_docker
2023-01-01 18:18:48,187 - INFO - Removed the downloaded zip file
2023-01-01 18:19:03,747 - ERROR - Prod docker-compose failed
Traceback (most recent call last):
  File "/home/ubuntu/easy-install.py", line 171, in setup_prod
    subprocess.run(
  File "/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/docker', 'compose', '-p', 'frappe', '-f', '/root/frappe-compose.yml', 'up', '-d']' returned non-zero exit status 1.

docker ps

sudo docker ps
CONTAINER ID   IMAGE              COMMAND                  CREATED          STATUS                    PORTS                                                                      NAMES
f516f6fe35e6   traefik:2.5        "/entrypoint.sh --pr…"   14 minutes ago   Up 14 minutes             0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   frappe-proxy-1
7f701d9a9a8f   mariadb:10.6       "docker-entrypoint.s…"   14 minutes ago   Up 14 minutes (healthy)   3306/tcp                                                                   frappe-db-1
8464d7704e40   redis:6.2-alpine   "docker-entrypoint.s…"   14 minutes ago   Up 14 minutes             6379/tcp                                      

check docker compose

sudo docker --version && docker compose version
Docker version 20.10.22, build 3a2c30b
Docker Compose version v2.14.1

docker images

 sudo docker image ls
REPOSITORY               TAG          IMAGE ID       CREATED         SIZE
frappe/frappe-socketio   v14.21.0     1d80eba2681f   35 hours ago    184MB
frappe/erpnext-nginx     v14.11.1     c02dbdc41406   35 hours ago    341MB
frappe/erpnext-worker    v14.11.1     6f1f4540a8fa   35 hours ago    1.21GB
redis                    6.2-alpine   fde943dfa6d2   2 weeks ago     27.1MB
mariadb                  10.6         9abe0aec0e5e   3 weeks ago     404MB
traefik                  2.5          865923368a9f   11 months ago   101MB

docker volume

sudo docker volume ls  
DRIVER    VOLUME NAME
local     frappe_assets
local     frappe_cert-data
local     frappe_db-data
local     frappe_redis-data
local     frappe_sites

Why the script use traefik 2.5 and not traefik 2.6 ?

And now, what can i do?

hello, did you installe docker using snap ?
if you type the following in your terminal and docker did not work then maybe that is the problem

/usr/bin/docker

Hello, my snap package:

sudo snap list
Name                Version        Rev    Tracking         Publisher   Notes
core18              20221212       2667   latest/stable    canonical✓  base
core20              20221212       1778   latest/stable    canonical✓  base
lxd                 4.0.9-a29c6f1  24061  4.0/stable/…     canonical✓  -
oracle-cloud-agent  1.28.0-11366   48     latest/stable/…  oci.osi     classic
snapd               2.57.6         17883  latest/stable    canonical✓  snap

I don’t use a snap package for docker.

sudo /usr/bin/docker

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Options:
      --config string      Location of client config files (default "/root/.docker")
  -c, --context string     Name of the context to use to connect to the daemon (overrides
                           DOCKER_HOST env var and default context set with "docker context use")
  -D, --debug              Enable debug mode
  -H, --host list          Daemon socket(s) to connect to
  -l, --log-level string   Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default
                           "info")
      --tls                Use TLS; implied by --tlsverify
      --tlscacert string   Trust certs signed only by this CA (default "/root/.docker/ca.pem")
      --tlscert string     Path to TLS certificate file (default "/root/.docker/cert.pem")
      --tlskey string      Path to TLS key file (default "/root/.docker/key.pem")
      --tlsverify          Use TLS and verify the remote
  -v, --version            Print version information and quit

Management Commands:
  app*        Docker App (Docker Inc., v0.9.1-beta3)
  builder     Manage builds
  buildx*     Docker Buildx (Docker Inc., v0.9.1-docker)
  compose*    Docker Compose (Docker Inc., v2.14.1)
  config      Manage Docker configs
  container   Manage containers
  context     Manage contexts
  image       Manage images
  manifest    Manage Docker image manifests and manifest lists
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  scan*       Docker Scan (Docker Inc., v0.23.0)
  secret      Manage Docker secrets
  service     Manage services
  stack       Manage Docker stacks
  swarm       Manage Swarm
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

Commands:
  attach      Attach local standard input, output, and error streams to a running container
  build       Build an image from a Dockerfile
  commit      Create a new image from a container's changes
  cp          Copy files/folders between a container and the local filesystem
  create      Create a new container
  diff        Inspect changes to files or directories on a container's filesystem
  events      Get real time events from the server
  exec        Run a command in a running container
  export      Export a container's filesystem as a tar archive
  history     Show the history of an image
  images      List images
  import      Import the contents from a tarball to create a filesystem image
  info        Display system-wide information
  inspect     Return low-level information on Docker objects
  kill        Kill one or more running containers
  load        Load an image from a tar archive or STDIN
  login       Log in to a Docker registry
  logout      Log out from a Docker registry
  logs        Fetch the logs of a container
  pause       Pause all processes within one or more containers
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rename      Rename a container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  run         Run a command in a new container
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  search      Search the Docker Hub for images
  start       Start one or more stopped containers
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop one or more running containers
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  top         Display the running processes of a container
  unpause     Unpause all processes within one or more containers
  update      Update configuration of one or more containers
  version     Show the Docker version information
  wait        Block until one or more containers stop, then print their exit codes

Run 'docker COMMAND --help' for more information on a command.

To get more help with docker, check out our guides at https://docs.docker.com/go/guides/
ubuntu@instance-20220313-0659:~$ sudo snap list
Name                Version        Rev    Tracking         Publisher   Notes
core18              20221212       2667   latest/stable    canonical✓  base
core20              20221212       1778   latest/stable    canonical✓  base
lxd                 4.0.9-a29c6f1  24061  4.0/stable/…     canonical✓  -
oracle-cloud-agent  1.28.0-11366   48     latest/stable/…  oci.osi     classic
snapd               2.57.6         17883  latest/stable    canonical✓  snapd
ubuntu@instance-20220313-0659:~$ sudo /usr/bin/docker

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Options:
      --config string      Location of client config files (default "/root/.docker")
  -c, --context string     Name of the context to use to connect to the daemon (overrides
                           DOCKER_HOST env var and default context set with "docker context use")
  -D, --debug              Enable debug mode
  -H, --host list          Daemon socket(s) to connect to
  -l, --log-level string   Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default
                           "info")
      --tls                Use TLS; implied by --tlsverify
      --tlscacert string   Trust certs signed only by this CA (default "/root/.docker/ca.pem")
      --tlscert string     Path to TLS certificate file (default "/root/.docker/cert.pem")
      --tlskey string      Path to TLS key file (default "/root/.docker/key.pem")
      --tlsverify          Use TLS and verify the remote
  -v, --version            Print version information and quit

Management Commands:
  app*        Docker App (Docker Inc., v0.9.1-beta3)
  builder     Manage builds
  buildx*     Docker Buildx (Docker Inc., v0.9.1-docker)
  compose*    Docker Compose (Docker Inc., v2.14.1)
  config      Manage Docker configs
  container   Manage containers
  context     Manage contexts
  image       Manage images
  manifest    Manage Docker image manifests and manifest lists
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  scan*       Docker Scan (Docker Inc., v0.23.0)
  secret      Manage Docker secrets
  service     Manage services
  stack       Manage Docker stacks
  swarm       Manage Swarm
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

Commands:
  attach      Attach local standard input, output, and error streams to a running container
  build       Build an image from a Dockerfile
  commit      Create a new image from a container's changes
  cp          Copy files/folders between a container and the local filesystem
  create      Create a new container
  diff        Inspect changes to files or directories on a container's filesystem
  events      Get real time events from the server
  exec        Run a command in a running container
  export      Export a container's filesystem as a tar archive
  history     Show the history of an image
  images      List images
  import      Import the contents from a tarball to create a filesystem image
  info        Display system-wide information
  inspect     Return low-level information on Docker objects
  kill        Kill one or more running containers
  load        Load an image from a tar archive or STDIN
  login       Log in to a Docker registry
  logout      Log out from a Docker registry
  logs        Fetch the logs of a container
  pause       Pause all processes within one or more containers
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rename      Rename a container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  run         Run a command in a new container
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  search      Search the Docker Hub for images
  start       Start one or more stopped containers
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop one or more running containers
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  top         Display the running processes of a container
  unpause     Unpause all processes within one or more containers
  update      Update configuration of one or more containers
  version     Show the Docker version information
  wait        Block until one or more containers stop, then print their exit codes

Run 'docker COMMAND --help' for more information on a command.

To get more help with docker, check out our guides at https://docs.docker.com/go/guides/

Docker check

sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Already exists 
Digest: sha256:c77be1d3a47d0caf71a82dd893ee61ce01f32fc758031a6ec4cf1389248bb833
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/


I get from Docker:
Hello from Docker!
This message shows that your installation appears to be working correctly.

And now?

better

I don’t have any idea for a solution. :frowning:

maybe you get more info for debugging if you run the failed step manually

/usr/bin/docker compose -p frappe -f /root/frappe-compose.yml up

# or with sudo

sudo /usr/bin/docker compose -p frappe -f /root/frappe-compose.yml up

anyway i think it is good idea to setup docker to run without sudo, it is also easy to work with and less typing and maybe this is the issue source

sudo su

/usr/bin/docker compose -p frappe -f /root/frappe-compose.yml up
[+] Running 11/0
 ⠿ Container frappe-proxy-1          Running                                                        0.0s
 ⠿ Container frappe-db-1             Running                                                        0.0s
 ⠿ Container frappe-redis-1          Running                                                        0.0s
 ⠿ Container frappe-configurator-1   Created                                                        0.0s
 ⠿ Container frappe-backend-1        Created                                                        0.0s
 ⠿ Container frappe-websocket-1      Created                                                        0.0s
 ⠿ Container frappe-frontend-1       Created                                                        0.0s
 ⠿ Container frappe-queue-default-1  Created                                                        0.0s
 ⠿ Container frappe-queue-long-1     Created                                                        0.0s
 ⠿ Container frappe-queue-short-1    Created                                                        0.0s
 ⠿ Container frappe-scheduler-1      Created                                                        0.0s
Attaching to frappe-backend-1, frappe-configurator-1, frappe-db-1, frappe-frontend-1, frappe-proxy-1, frappe-queue-default-1, frappe-queue-long-1, frappe-queue-short-1, frappe-redis-1, frappe-scheduler-1, frappe-websocket-1
Error response from daemon: network c45be9001821ffc82173444a4d79fd528b70a300a07a0d3c4595c8f0efff0ce1 not found

network

sudo docker network list
NETWORK ID     NAME             DRIVER    SCOPE
998aa9ab0396   bridge           bridge    local
dbdd4238c672   frappe_default   bridge    local
fa4e56986381   host             host      local
49afe16f8f8a   none             null      local
20e7ccd86457   proxy            bridge    local

Any idea?

No person?

The “Easy Install Script” doesn’t work at this time??

Error response from daemon: network c45be9001821ffc82173444a4d79fd528b70a300a07a0d3c4595c8f0efff0ce1 not found

Seems like a docker network issue. What I would suggest is to follow

Network errors are kinda non-common but it depends from system to system.

Also this VM seems quite underpowered for ERPNext. Go with roughly 4gig ram, 2 vCPU to have decent performance.

@ankush

Did you have solution for my problem?
Did you can update your easy-install.py srcipt?

The decent performance isn’t no problem in my case.

Greets

jannis

one day later:

Hello, where can i find the requirements in 2023 to use the easy-install.py with success?

2016:

2018:

Now The Easy Install Script is working with success. :slight_smile:

sudo docker network list

NETWORK ID     NAME             DRIVER    SCOPE
7757ed82f008   bridge           bridge    local
957c664d3eea   frappe_default   bridge    local
fa4e56984881   host             host      local
49afe16f8328   none             null      local

SYSTEM

cat /proc/cpuinfo  | grep 'name'| uniq
model name      : AMD EPYC 7551 32-Core Processor

cat /proc/cpuinfo  | grep process| wc -l
2


lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy

RAM and SWAP-File

free -m
               total        used        free      shared  buff/cache   available
Mem:             964         533          82           0         348         256
Swap:           4095         797        3298


sudo docker --version && docker compose version
Docker version 20.10.22, build 3a2c30b
Docker Compose version v2.14.1

sudo docker ps
CONTAINER ID   IMAGE                             COMMAND                  CREATED        STATUS                  PORTS                                                                      NAMES
ad4dabec09df   frappe/erpnext-nginx:v14.12.0     "/docker-entrypoint.…"   10 hours ago   Up 10 hours             8080/tcp                                                                   frappe-frontend-1
8bcdxx07202c   frappe/frappe-socketio:v14.21.1   "docker-entrypoint.s…"   10 hours ago   Up 10 hours                                                                                        frappe-websocket-1
4c7c2xx4b4ee   frappe/erpnext-worker:v14.12.0    "bench worker --queu…"   10 hours ago   Up 10 hours                                                                                        frappe-queue-default-1
75cxx12ec9ab   frappe/erpnext-worker:v14.12.0    "/home/frappe/frappe…"   10 hours ago   Up 10 hours                                                                                        frappe-backend-1
7e597xx1db52   frappe/erpnext-worker:v14.12.0    "bench worker --queu…"   10 hours ago   Up 10 hours                                                                                        frappe-queue-long-1
f58f8fxxdd7c4   frappe/erpnext-worker:v14.12.0    "bench schedule"         10 hours ago   Up 10 hours                                                                                        frappe-scheduler-1
94xxa8dbac76   frappe/erpnext-worker:v14.12.0    "bench worker --queu…"   10 hours ago   Up 10 hours                                                                                        frappe-queue-short-1
bb3b50xxb55f   mariadb:10.6                      "docker-entrypoint.s…"   10 hours ago   Up 10 hours (healthy)   3306/tcp                                                                   frappe-db-1
05d9axxxce79   traefik:2.5                       "/entrypoint.sh --pr…"   10 hours ago   Up 10 hours             0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   frappe-proxy-1
956f0xxx45a7   redis:6.2-alpine                  "docker-entrypoint.s…"   10 hours ago   Up 10 hours             6379/tcp                                                                   frappe-redis-1

sudo docker volume ls
DRIVER    VOLUME NAME
local     frappe_assets
local     frappe_cert-data
local     frappe_db-data
local     frappe_redis-data
local     frappe_sites

Why the script didn’t use traefik:2.6 ?

Solved

erpn13

Thank’s

jannis

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.