Try ERPNext Buy Support Partners Foundation

Unable to Install ERPNext 12 (Easy Install Script)

Hi,
I have tried installing using the official easy install script on both Ubuntu 16.04 LTS as well as 18.04 LTS servers.
However, it seems that the installation fails at the same place on both the servers, and I am unable to understand exactly whats wrong.

For reference, this is the relevant section before the failure:
TASK [bench : Create a new site] ************************************************************************************
task path: /tmp/.bench/playbooks/roles/bench/tasks/setup_erpnext.yml:17
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c ‘echo ~root && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “echo /var/tmp/ansible-tmp-1573398304.1511483-265186457240093” && echo ansible-tmp-1573398304.1511483-265186457240093="echo /var/tmp/ansible-tmp-1573398304.1511483-265186457240093" ) && sleep 0’
Using module file /usr/local/lib/python3.5/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-243712r8fc8g7/tmpnbjvduzr TO /var/tmp/ansible-tmp-1573398304.1511483-265186457240093/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c ‘setfacl -m u:frappe:r-x /var/tmp/ansible-tmp-1573398304.1511483-265186457240093/ /var/tmp/ansible-tmp-1573398304.1511483-265186457240093/AnsiballZ_command.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘sudo -H -S -n -u frappe /bin/sh -c ‘"’"‘echo BECOME-SUCCESS-izefwqpgprwnwzzpuoatszcanuediydb ; /usr/bin/python3 /var/tmp/ansible-tmp-1573398304.1511483-265186457240093/AnsiballZ_command.py’"’"’ && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘rm -f -r /var/tmp/ansible-tmp-1573398304.1511483-265186457240093/ > /dev/null 2>&1 && sleep 0’

Lastly, this is the error I get:
The full traceback is:
Traceback (most recent call last):
File “/var/tmp/ansible-tmp-1573398304.1511483-265186457240093/AnsiballZ_command.py”, line 114, in
_ansiballz_main()
File “/var/tmp/ansible-tmp-1573398304.1511483-265186457240093/AnsiballZ_command.py”, line 106, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File “/var/tmp/ansible-tmp-1573398304.1511483-265186457240093/AnsiballZ_command.py”, line 49, in invoke_module
imp.load_module(‘main’, mod, module, MOD_DESC)
File “/usr/lib/python3.5/imp.py”, line 234, in load_module
return load_source(name, filename, file)
File “/usr/lib/python3.5/imp.py”, line 170, in load_source
module = _exec(spec, sys.modules[name])
File “”, line 626, in _exec
File “”, line 665, in exec_module
File “”, line 222, in _call_with_frames_removed
File “/tmp/ansible_command_payload_ccjn92b6/main.py”, line 327, in
File “/tmp/ansible_command_payload_ccjn92b6/main.py”, line 253, in main
File “/usr/lib/python3.5/shlex.py”, line 273, in split
return list(lex)
File “/usr/lib/python3.5/shlex.py”, line 263, in next
token = self.get_token()
File “/usr/lib/python3.5/shlex.py”, line 90, in get_token
raw = self.read_token()
File “/usr/lib/python3.5/shlex.py”, line 166, in read_token
raise ValueError(“No closing quotation”)
ValueError: No closing quotation

fatal: [localhost]: FAILED! => {
“changed”: false,
“module_stderr”: “Traceback (most recent call last):\n File “/var/tmp/ansible-tmp-1573398304.1511483-265186457240093/AnsiballZ_command.py”, line 114, in \n _ansiballz_main()\n File “/var/tmp/ansible-tmp-1573398304.1511483-265186457240093/AnsiballZ_command.py”, line 106, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File “/var/tmp/ansible-tmp-1573398304.1511483-265186457240093/AnsiballZ_command.py”, line 49, in invoke_module\n imp.load_module(‘main’, mod, module, MOD_DESC)\n File “/usr/lib/python3.5/imp.py”, line 234, in load_module\n return load_source(name, filename, file)\n File “/usr/lib/python3.5/imp.py”, line 170, in load_source\n module = _exec(spec, sys.modules[name])\n File “”, line 626, in _exec\n File “”, line 665, in exec_module\n File “”, line 222, in _call_with_frames_removed\n File “/tmp/ansible_command_payload_ccjn92b6/main.py”, line 327, in \n File “/tmp/ansible_command_payload_ccjn92b6/main.py”, line 253, in main\n File “/usr/lib/python3.5/shlex.py”, line 273, in split\n return list(lex)\n File “/usr/lib/python3.5/shlex.py”, line 263, in next\n token = self.get_token()\n File “/usr/lib/python3.5/shlex.py”, line 90, in get_token\n raw = self.read_token()\n File “/usr/lib/python3.5/shlex.py”, line 166, in read_token\n raise ValueError(“No closing quotation”)\nValueError: No closing quotation\n”,
“module_stdout”: “”,
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,
“rc”: 1
}

PLAY RECAP **********************************************************************************************************
localhost : ok=83 changed=49 unreachable=0 failed=1 skipped=48 rescued=0 ignored=0

Traceback (most recent call last):
File “install.py”, line 413, in
install_bench(args)
File “install.py”, line 135, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 327, in run_playbook
success = subprocess.check_call(args, cwd=os.path.join(cwd, ‘playbooks’))
File “/usr/lib/python2.7/subprocess.py”, line 541, 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=frappe’]’ returned non-zero exit status 2

There’s been a number of issues logged with exactly the same error. Have you taken the time to search and try the solutions offerred?

Pardon my ignorance, but as stated in the OP, from the above wall of text, I’m not exactly sure what the error(s) is(are)…
If you could help me out with that, it would be very kind of you.

It’s a matter of searching. Let me give you an example of what I mean. If you look at the image I posted. the top 3 posts in date order point to exactly the same issue. They offer help in understanding what the issue might be in your case, as no two cases may be exactly the same.

I understand the “wall of text” can be quite overwhelming and perhaps meaningless to the newcomer. If I can give you a tip I always use- work from the bottom of the text upwards.

In your case, the error is

subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=frappe’]’ returned non-zero exit status 2

That is because the installation is trying to run the command with error

ansible-playbook -c local site.yml -vvvv -e @/tmp/extra_vars.json –become –become-user=frappe

Run the command on the command line by itself, without the quotes and commas to see what it is telling you.

Hi,
I see that you were asking if I read through other posts in general.
Indeed, I did, but could not find what I was looking for.
It is true that not all errors/cases may be the same though.
I appreciate your help and feedback.
From what I could understand from your response regarding the error, it may be because of the --user flag, which I will remove and try to re-run the installation.

Well, turns out I was wrong. Back to square one.
Will try to read and analyze your reply once more.
Guess I didn’t read/interpret it correctly

Hi,
Relevant part before the error after following what you said:
ansible-playbook 2.8.5
config file = None
configured module search path = [’/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/local/lib/python3.5/dist-packages/ansible
executable location = /usr/local/bin/ansible-playbook
python version = 3.5.2 (default, Oct 8 2019, 13:06:37) [GCC 5.4.0 20160609]
No config file found; using defaults

I now get the new error:
ERROR! the playbook: site.yml could not be found

Getting closer :wink:

Make sure you are in the correct directory.

This is where I see the site.yml on my system

  $ ls -l
    drwxr-xr-x 11 erpnext erpnext 4096 Oct 12 07:38 bench-repo
    drwxr-xr-x  7 erpnext erpnext 4096 Oct 12 07:41 frappe-bench
  $ find . -name "site.yml" -print
    ./bench-repo/playbooks/site.yml

configured module search path = [’/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
implies that the ownership is by user=root, so probably a permissions error

Unfortunately I do not have a directory “bench-repo”
I would think it gets created after the point where I am facing failure

Running the commands as root - so shouldn’t be an issue

I am not sure which installation instructions your are following.

If you ignore the server requirements installation, installing the bench repository should be the first step in installing erpnext

$ sudo pip install -e bench-repo
$ bench init --frappe-branch version-12 --python /usr/bin/python2.7 frappe-bench
$ cd frappe-bench

I would suggest restarting your installation. There are a number of resources. I have linked to one that has a lot of useful info to assist you. I have not personally used that guide, but it is a handy reference.

Hi,
I was following the official Easy Install Guide/Script at:

If you want the list of commands I followed to reach the error:
apt-get update && apt-get upgrade -y
apt-get install python-minimal build-essential python-setuptools -y
adduser frappe
usermod -aG sudo frappe
cd /home/frappe
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
sudo python install.py --production --user frappe

As for the guide you referred to, I tried following that as well, but in vain

How did you prepare your system? What are you locale settings? On which OS under which parameters are you installing? There are many parameters. Did you disable IPv6? Do you have a firewall? Did you enable sudo for frappe user?

I haven’t done anything in particular to prepare it

Default settings on a DigitalOcean/Vultr server

Tried both Ubuntu 18.04 and 16.04. Not sure what you mean by parameters.

Not specifically, no.

Nope

Yes, using usermod -aG sudo frappe

What is the machine config ram disk space etc.? Did you apt update and apt upgrade before installing? Did you install the prerequisite packages before running easy install? I think you need some pro help out there.

1 vCore CPU VPS, 1GB RAM, 25 GB SSD - the basic cheap VPS

Yes, using
apt-get update && apt-get upgrade -y
apt-get install python-minimal build-essential python-setuptools -y

I do, good sir

You cannot install on a 1GB ram machine to my knowledge. What are your locale settings?

Get your hands on a virtual machine environment and start with 4gb ram. 2gb is a limit. you need to hack into the install process.

As per my knowledge, ERPNext requires >=1GB of RAM

How do I check that?

Currently doing that haha. The Easy Install Script isn’t getting me anywhere so I’m headed for a full blown manual install

Due to some stupid rule that a new user can’t post more than 6 replies in a day, I can’t add an additional response. However, I’m going to put down my next response as an edit to this one for the benefit of all:

I was able to get an instance up and running manually, with a lot of research, modifications and troubleshooting.
The two resources which helped me the most are:
https://discuss.erpnext.com/t/how-to-install-erpnext-from-a-z/54744
and
https://murgatroyd.za.net/?p=764

I did have to improvise and modify a lot of things, so I will be making a detailed guide for those who feel trapped, like I did,

I will also leave this thread open anyway, since the Easy Install Script still won’t work.

I have a manual install sequence that has worked 100% for me. The link is here

1 Like