Installation Failure - Ubuntu 16.04

The below error repeats for Ubuntu 16.04 and 18.04

PLAY RECAP *********************************************************************
localhost                  : ok=6    changed=3    unreachable=0    failed=1    skipped=4    rescued=0    ignored=0   

Traceback (most recent call last):
  File "install.py", line 413, in <module>
    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=desk']' returned non-zero exit status 2

Fresh VPS with no packages installed to cause conflicts,

apt-get update && sudo apt-get upgrade -y
apt-get install build-essential python-minimal python-setuptools

adduser frappe
usermod -aG sudo frappe

wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
sudo python install.py --production --user frappe

Please advice.

Where is the rest of the error message? Is it same as this ERROR! The requested handler ‘restart network manager’ was not found in either the main handlers list nor in the listening handlers list?

Please advice on where to get handler messages,
I tried to copy the complete terminal activity but characters are limited here.

Is there any log files somewhere to get more details about the error?

Below is what caused fatal error and exit,

TASK [locale : Check current locale] *******************************************
task path: /tmp/.bench/playbooks/roles/locale/tasks/main.yml:2
<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 /root/.ansible/tmp/ansible-tmp-1571784429.734707-85251930905280 `" && echo ansible-tmp-1571784429.734707-85251930905280="` echo /root/.ansible/tmp/ansible-tmp-1571784429.734707-85251930905280 `" ) && 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-3263wwgqemkv/tmpe7_liigf TO /root/.ansible/tmp/ansible-tmp-1571784429.734707-85251930905280/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1571784429.734707-85251930905280/ /root/.ansible/tmp/ansible-tmp-1571784429.734707-85251930905280/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1571784429.734707-85251930905280/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1571784429.734707-85251930905280/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": true,
    "cmd": "localectl",
    "delta": "0:00:00.004393",
    "end": "2019-10-22 22:47:10.093120",
    "invocation": {
        "module_args": {
            "_raw_params": "localectl",
            "_uses_shell": true,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "warn": true
        }
    },
    "msg": "non-zero return code",
    "rc": 1,
    "start": "2019-10-22 22:47:10.088727",
    "stderr": "Failed to create bus connection: No such file or directory",
    "stderr_lines": [
        "Failed to create bus connection: No such file or directory"
    ],
    "stdout": "",
    "stdout_lines": []
}

This does not look like the same error message. Did you try manual install? Guide: Manual Install ERPNext on Ubuntu 16.xx & Debian v8 & 9 - #58 by Jermaine_Gray

1 Like

tried manual install several times before, but always fails cause it’s not clear which commands to be executed as ‘frappe’ user, even update/upgrade later causes annoying errors.

However, manual install should be summarized with easy install as automated tasks.

I never do manual install because there are too many gotchas (like nginx configuration, etc).
Easy install is the way to go.

Don’t use Ubuntu 16 because it uses Python 3.5. ERPNext requires at least Python 3.6 for background reports like Stock Balance. Use Ubuntu 18.

The sequence is this:

   apt-get update && sudo apt-get upgrade -y
   apt-get install python-minimal 

   wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
   sudo python install.py --develop --user frappe

   usermod -aG sudo frappe
   passwd frappe             comment: give frappe user a password
   su - frappe

At this point frappe-bench will be installed in /home/frappe. The last command su - frappe places you on /home/frappe directory as frappe user.

Please note that user frappe must not exist before installation. You have to remove user frappe it it exists as well as the home directory /home/frappe. The existence of user frappe prior to install.py is what causes errors.

Also note that frappe has become a common user name and could be a security concern. It is recommended to use other names, for example, --user myownfrappe. So, the user name myownfrappe will be created, and frappe as well as erpnext will be installed in /home/myownfrappe. So, you will use usermod -aG sudo myownfrappe and su - myownfrappe.

You start erpnext with

   cd frappe-bench
   bench start

[At this point, you may note some redis issues. I fix the redis issues at this point - but this is another topic.]

This starts erpnext on develop mode. You make the erpnext site using

    http://localhost:8000

You may replace localhost with the ip address or site address. If the webpage complains that it was not able to complete installation, just repeat localhost:8000 again and again until the erpnext desk appears.

You can setup production mode using

     sudo bench setup production frappe

frappe in this command is the user name that you used in the install.py command. If you used myownfrappe user name, the command is sudo bench setup production myownfrappe.

This will setup the production mode. At this point you are already on production mode and you don’t need the bench start command to start the server. It will start every time you boot up your server.

To switch back to develop mode

 sudo service nginx stop
 sudo service supervisor stop
 bench setup procfile
 bench start

To get back to production mode, stop bench start by ctrl-c, and use the command

 bench restart

This will start up the production mode services like redis and nginx again.

Also note that the server will always be in production mode at start-up. (I like this better because it is easier to stop the services nginx and redis before bench start than having to rebuild the conf files for these services again to get to production mode.)

Note: developer_mode setting / bench set-config developer_mode 1 has nothing to do with production or develop mode of the server. This setting is related to programming frappe apps. You can still be on developer_mode 1 setting or developer_mode 0 setting whether the server is on production or develop mode.

As I can see, Ubuntu 18.04 minimal comes with both Python 2.7 and 3.6

while the default version inquiry results in only 2.7

$ python -V
Python 2.7.15+

Please advise on how to switch or to instruct easy install script to use version 3.6

install.py uses python 2.7.

Easy install also installs the other python modules needed.

But frappe and erpnext will always use python 3 which is installed in the env. You can also see that it is even in a compiled mode. So you don’t need to worry about that. Python 2.7 is only needed during installation.

I have not used the minimal version of Ubuntu. I suspect that this may cause you some trouble because some Linux programs needed by frappe might not be installed.

I recommend Ubuntu 18 server

I have tried before the minimal server with many versions with no issues as I’m using VPS,
below was the generated error while running easy install script check out here on Ubuntu 18.04
and the same error repeated while using Ubuntu 16.04 too.

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

This happens when you already have user frappe in the system.

This is why the sequence of my instructions never include adduser.

install.py prefers to create the user.

I always skip create ‘frappe’ user, as script will check out if ‘frappe’ user doesn’t exist it will create it

I just used the auto install on 18.4 with the following instruction and it work:

Update package information from the repository.

  • sudo apt update
  • sudo apt upgrade

Install ERP

image

Conclusion

When you are install Ubuntu 18.4 minimal do not select Basic Server component or any other Modules. You can select to install the Open SSH server or Keep it very simple and install only what you need to connect to the VM.

This mean the network manager error in my other post:

does not relate to minimal not have network manager. This may be related to the fact that my VM at that time have Ubuntu Desktop (GUI) install. I will do more testing.

Something i would like to see in the installer:

  • Ability install by version - Maybe this is there am not sure, but i love version 10 and i would relay want to install version 10 but am not very sure how yet.
  • Ability to set database server during install - In my case i have MariaDB setup in Galera Cluster with HAProxy for load balance. I have to install on a VM with database then change database to connect to my cluster.

If you are still having issues installing let me give you one of my VM to try. For the record am not trying to sell you anything…I just want you to see the install work.

well, glad to see that easy install script finally works.

yeah, In past I have using the same VM approach you did but currently I want to install it using cloud VPS which is offering minimal install with SSH connection with no other optional packages.

you can edit the above line to ‘version-10’ before you run the script.

Thank you i will try that.

I think can be done by modifying setting files after install by considering your proxy with manual work to backup database and inject it into your target server but not sure about that, never play with SQL server for erpnext before.