[Solved] What changed in install.py today?!? Worked this morning, Fails now. (v13.1.1 & v13.2.x)

Nope.

Not working. I use the same process but on servers other than GCP. I spin-up Ubuntu 20.04 servers and run the same script and it always fails with:

File “/usr/lib/python3.8/subprocess.py”, line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=erpnxtadmin’]’ returned non-zero exit status 2.

Doing it on GCP wouldn’t make any difference. I am already using Ubuntu servers on at least 3 other service providers and all fail with the same error.

BKM

Try This manual Install :

New user here, I’ve been trying to install ERPNext on my fresh new VPS (2GB ram) and have yet to succeed. I first tried on ubuntu 20, then centOS 7 and 8, now I’m trying with ubuntu 18. Tried manual before, and docker install now. Nothing works

I’ll try the completely manual guide again tomorrow. If it doesn’t work I think I’ll be forced to switch to another software for a while.

Do you know any alternative and up to date guides?

I use hitchhiker, but it has some dated commands.
It is good that when asking assistance on the forum, the community knows the sequence of what you did. In my experience, you get faster and more accurate assistance.

**EDIT - 05/21/2021
This has been updated today to compensate for Ubuntu 20.04 server images that are more stripped down and missing packages. Particularly ‘curl’ and ‘git’ needed to be installed during the process to get everything working. Also there was a missing step of adding some important stuff into the $PATH. ~BKM :sunglasses:

I have not published it yet, but I have worked out a revision of the 22 step guide that has been working for the past 2 days (I added 2 additional steps to get to 24). It was originally put out by @adals back in January while v13 was still in beta. I have modified it for my purposes and had some success. Here it is in it’s raw form. There are none of my normal explanations of each step, etc. that I would normally do. So take it for what it is. Just follow the steps and don;t ask why. You should wind up with a working system on Ubuntu 20.04 (if your VPS has an up-to-date image). Just remember… anywhere you see [USER] use your own server username. If you follow the instructions exactly you end up with a server nearly identical to the one the easy install would make.

  1. choose any cloud you trust

  2. enter to your system via ssh with root user

  3. apt update && apt upgrade -y && shutdown -r now
    
  4. log back in as root and continue (the shutdown command forces the server to restart if not then reboot it manually) then type:
    (Watch carefully that this command completes properly. I have recently encountered a Ubuntu 20.04 image that did not include the curl or git commands and it had to be installed. It is simple enough to do and if it is missing, the command line response will tell you to install it and even gives you the syntax to use. Then you can continue with the command again)

    apt-get install curl git
    curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

  5.  apt install -y nodejs mariadb-server redis-server python3-pip nginx python3-testresources
    
  6.  adduser [USER]
    
  7. usermod  -aG sudo [USER]
    
  8. nano /etc/mysql/my.cnf
    when the editor opens, scroll to the bottom of the file and add these lines:
    [mysqld]
    character-set-client-handshake = FALSE
    character-set-server = utf8mb4
    collation-server = utf8mb4_unicode_ci

    [mysql]
    default-character-set = utf8mb4

  9. service mysql restart

  10. mysql_secure_installation
    press enter for password then answer the questions as follows:
    Set root password? [Y/n] y
    Remove anonymous users? [Y/n] y
    Disallow root login remotely? [Y/n] n
    Remove test database and access to it? [Y/n] y
    Reload privilege tables now? [Y/n] y

  11. mysql -u root -p
    Immediately after the -p type the password you assigned to mariadb in the last step. Remember there is to be NO space between the -p and the first character of the password. Then at the database prompt type the following commands (case sensitive & press enter after each line)

USE mysql;
UPDATE user SET plugin=' ' WHERE user = 'root';
FLUSH PRIVILEGES;
exit
  1. close the terminal (logout of root) and open new one and login with ssh [USER]

  2. sudo npm install -g yarn

  3. node -v && npm -v && python3 -V && pip3 -V && yarn -v

  4. pip3 install frappe-bench
    export PATH=$PATH:/home/[user]/.local/bin

  5. sudo pip3 install frappe-bench

  6. bench init --frappe-branch version-13 frappe-bench

  7. cd frappe-bench

  8. bench new-site site1.local
    (Now that we are up to v13.3.x expect a lot of deprication warnings with this step)

  9. bench get-app --branch version-13 erpnext

  10. bench --site site1.local install-app erpnext

  11. sudo bench setup production [USER]

  12. bench --site site1.local enable-scheduler

  13. Now reboot the server. Once it has rebooted you should be able to open a web browser and type in the ip address of your server to get the ERPNext login screen. Login as administrator and go through the setup wizard before attempting to do any further work on the server. Once that is done you can find plenty of sources on the forum to help you with things like setting the URL (using the bench add-domain command) and setting up the SSL certificates.

Hope this helps… and no I am not taking time to explain everything right now. That may be in a future tutorial.

This does NOT solve the problem of the easy install method failing. That STILL needs to be FIXED!!

~BKM

17 Likes

@Joseph_Marie_Alba1 @bkm Thank you, I will try what bkm suggested and I’ll post an update/results.

Update: thanks, following your whole updated guide worked, Ubuntu 20.10 ! It already had curl installed. Only correction on your guide is on step 10 the command should be

mysql_secure_installation

instead of run mysql_secure_installation.

I’ll try to configure it on my domain now, and I’ll update if successful.

2 Likes

Ahh… you are correct. (fixed it in the post above so others do not trip over it)

When I copied it from my document on my desktop PC I forgot to eliminate the word run which was both a note to myself and is was actually part of the original notes from @adals when it was first created back in January. I knew what it meant but I didn’t structure it for a layman to understand. That was my fault. But it was just my raw dump. :nerd_face:

Glad you got it to work for yourself.

~BKM

2 Likes

What kind of user should be created here. What is its function?

same question about “site1.local”. How is this value used afterwards or how do I have to adjust it?

This would be a linux user (other than the ROOT user).

The “site1.local” site is the site name that is created when you use the “Easy Install” method from the frappe/bench github repo. It is used here to make the manual method of installing the system look and feel just like the resulting installation if the Easy Install script were used.

The easy install script creates the “site1.local” site during the install process and then there are ways to change that name built into the system.


At this point I think you need to do a lot more reading in the forum to understand how the install process works. Here is an article I wrote several years ago that describes the entire process. It was written for version 10 of ERPNext but the concepts are still the same even if the steps may not work the same any longer. Please read this for a better understanding of how it all ties together.

BKM

ok, installed with the user “erpadmin” and “erp01.mydomain.local” (this is the FQH of the VM) and can look at the system.

Yes, I will read the article. I have also already read something in the forum.

It’s a bit confusing because there are different methods to install.

But now it’s up and running and I can test :slight_smile:

Please I can’t get pass this stage. I kept getting this error

image

What can I do to continue the installation?

Yup! I ran into that myself this morning on a new VPS service provider. It turns out this provider has a very stripped down version of the Ubuntu 20.04 image in their catalog and when I spin it up it is missing two important packages: git and curl

First of all answer Y to rollback the changes, then to get past this particular error you need to run:

apt-get install git

After this is done the “bench init --frappe-branch version-13 frappe-bench” command will work properly. I will update the posting above later today to show this. I want to get some more testing done over the next few hours before I commit it to the list though.

Do not let my delay in updating the steps get in the way of you using the fix I described here. It will solve your problem.

BKM

**EDIT - Updated the procedure above to reflect this change as well as a few others to improve the reliability of a successful install. - BKM :sunglasses:

BTW…

For those still tracking this thread:

Easy Install method is still not working 23 days after originally reporting the problem.

BKM

Hi @bkm!

I’m not a developer. Saying that, I’m using Contabo since a couple of years and actually using easy install method. It’s having these warnings [Release Note] ERPNext and Frappe Version 13.3.0 - #9 by krnkris but is working on new installs.

VPS with 4 vCPU Cores, 8 GB RAM and 200 GB SSD, using Ubuntu v20.04

apt-get update

apt-get upgrade

adduser frappe

usermod -aG sudo frappe

su - frappe

export LC_ALL=C.UTF-8

sudo apt-get install python3-minimal git build-essential python3-setuptools python3-pip libffi-dev libssl-dev wkhtmltopdf

wget https://raw.githubusercontent.com/frappe/bench/develop/install.py

sudo apt install python3-testresources

sudo python3 install.py --production --user frappe --frappe-branch version-13 --erpnext-branch version-13

cd /home/frappe/frappe-bench/

bench update

exit

To Multitenant:

Rename folder site1.local at /home/frappe/frappe-bench/sites to whatever domain name will be used

Replace site1.local at currentsite.txt

Replace site1.local at nginx.conf at cd /home/frappe/frappe-bench/config

Add hostname at /etc/hostname

Add hostname at /etc/hosts

Add hostname at cd /home/frappe/frappe-bench/sites/[site name]/site_config.json
Should look like this:
{
          "db_name": "[site name]",
          "db_password": "*********",
          "host_name": "[domain name]"
}

sudo apt-get install certbot

sudo systemctl stop nginx

sudo certbot --standalone --agree-tos --domain [domain name] -n -m [your email] certonly

sudo systemctl start nginx

If missing, add the following to cd /home/frappe/frappe-bench/sites/[site name]/site_config.json
{
          "ssl_certificate": "/etc/letsencrypt/live/[domain name]/fullchain.pem",
          "ssl_certificate_key": "/etc/letsencrypt/live/[domain name]/privkey.pem"
}

cd /home/frappe/frappe-bench

bench setup nginx

sudo service nginx reload

sudo service nginx restart
3 Likes

@Francisco_Buendia

What OS are you using on Contabo?

BKM

Sorry, I missed to mention:

Ubuntu v20.04 on a VPS with 4 vCPU Cores, 8 GB RAM and 200 GB SSD

Thank you.