Error with Production Install Ubuntu 14.04 LTS

Hi Team, All,

I get this error when trying to install with the Easy Setup on an AWS Ubuntu 14.04 LTS server.
Python version is 2.7.6. Has anyone experienced or solved same?

TASK [Get nodejs 6.x bash script] **********************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to validate the SSL certificate for deb.nodesource.com:443. Make sure your managed systems have a valid CA certificate installed.  If the website serving the url uses SNI you need python >= 2.7.9 on your managed machine.  You can use validate_certs=False if you do not need to confirm the server\\s identity but this is unsafe and not recommended Paths checked for this platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs, /usr/share/ca-certificates/cacert.org, /etc/ansible"}

NO MORE HOSTS LEFT *************************************************************
	to retry, use: --limit @production/install.retry

PLAY RECAP *********************************************************************
localhost                  : ok=6    changed=2    unreachable=0    failed=1   

Traceback (most recent call last):
  File "install.py", line 342, in <module>
    install_bench(args)
  File "install.py", line 111, in install_bench
    run_playbook('production/install.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 292, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'))
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'production/install.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2

Regards,
cksgb

Try to search the error.

https://www.google.com.au/#q=subprocess.CalledProcessError:+Command+'['ansible-playbook'%2C+'-c'%2C+'local'%2C+'production%2Finstall

Thanks @iadr3805,

Searching google it seems that the error is a python version issue. Apparently python 2.7.9 is required to successfully do the install. However, the only solution seems to be to roll my own python 2.7.9 on my server. I am reluctant to do this and was wondering if anyone found an alternative approach.

Regards,
cksgb

Install is recommended on a fresh system, If it’s not fresh then dependencies could become a problem with different versions.
Could try to have a dedicated VM just for ERPNEXT.

Also post the full log, the lines above TASK [Get nodejs 6.x bash script] **********************************************

@iadr3805 it’s a fresh system. The log above the point of failure isn’t useful in solving this issue.

Regards,
cksgb

If it’s a fresh system then the script should install the correct python version.

Hi @anand, apologies for the direct mention, but where can I set validate_certs=False so as to be able to proceed with the production install on Ubuntu 14.04 LTS.

The problem is at TASK [Get nodejs 6.x bash script]. It seems that python 2.6.7 is unable to download resources if the website serving the url uses SNI. The two options are to upgrade to >= 2.6.9 or to set “validate_cert=False”. I’d like to follow the validate_cert option. Please where can it be done?

Regards,
cksgb

@Chude_Osiegbu

This is a problem in installation method, a fix is supposed to be released with updated installations instructions in ansible by this week.

Hi @shreyasp, Thanks for the feedback. Will be looking out for the fix. In the meantime would you recommend that I modified the following section in the bench/ubuntu.yml from

  - name: Get nodejs 6.x bash script
    get_url:
      url: 'https://deb.nodesource.com/setup_6.x'
      dest: '/tmp/setup_6.x'
      mode: 0644
    become: yes
    become_user: root

to

  - name: Get nodejs 6.x bash script
    get_url:
      url: 'https://deb.nodesource.com/setup_6.x'
      **validate_certs: no**
      dest: '/tmp/setup_6.x'
      mode: 0644
    become: yes
    become_user: root

Of course without the asterisks.

CC @bomsy

Regards,
cksgb

@Chude_Osiegbu

Already tried doing that, but didn’t resolve the issue :cry: Instead you might try replacing the steps as follows

- name: Add apt key for node repo
	apt_key:
		url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
		state: present
	become: yes
	become_user: root

- name: Add repo
	apt_repository:
		repo: "deb [arch=amd64,i386] https://deb.nodesource.com/node_6.x {{ ansible_distribution_release }} main"
		state: present
	register: node_repo
	become: yes
	become_user: root

- name: Install nodejs 6.x
	apt:
		name: nodejs
		state: present
		update_cache: yes
		force: yes
	become: yes
	become_user: root

@shreyasp

Not sure if it’s the same problem, i’m installing --develop on a clean VM running Ubuntu 16.04, getting error on:

TASK [init bench] **************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "init", "/home/frappe/frappe-bench", "--frappe-branch", "develop"], "delta": "0:00:40.854356", "end": "2016-09-09 11:43:38.528055", "failed": true, "rc": 1, "start": "2016-09-09 11:42:57.673699", "stderr": "INFO:bench.app:getting app frappe\nCloning into 'frappe'...\nINFO:bench.app:installing frappe\nCommand \"/home/frappe/frappe-bench/env/bin/python -u -c \"import setuptools, tokenize;__file__='/tmp/pip-build-v5DoZc/python-ldap/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))\" install --record /tmp/pip-N8xLNo-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/frappe/frappe-bench/env/include/site/python2.7/python-ldap\" failed with error code 1 in /tmp/pip-build-v5DoZc/python-ldap/\nTraceback (most recent call last):\n  File \"/usr/local/bin/bench\", line 11, in <module>\n    load_entry_point('bench', 'console_scripts', 'bench')()\n  File \"/home/frappe/.bench/bench/cli.py\", line 40, in cli\n    bench_command()\n  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 716, in __call__\n    return self.main(*args, **kwargs)\n  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 696, in main\n    rv = self.invoke(ctx)\n  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 1060, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 889, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n  File \"/usr/local/lib/python2.7/dist-packages/click/core.py\", line 534, in invoke\n    return callback(*args, **kwargs)\n  File \"/home/frappe/.bench/bench/commands/make.py\", line 19, in init\n    verbose=verbose, clone_from=clone_from)\n  File \"/home/frappe/.bench/bench/utils.py\", line 56, in init\n    get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)\n  File \"/home/frappe/.bench/bench/app.py\", line 73, in get_app\n    install_app(app=app_name, bench_path=bench_path, verbose=verbose)\n  File \"/home/frappe/.bench/bench/app.py\", line 103, in install_app\n    find_links=find_links))\n  File \"/home/frappe/.bench/bench/utils.py\", line 127, in exec_cmd\n    raise CommandFailedError(cmd)\nbench.utils.CommandFailedError: /home/frappe/frappe-bench/env/bin/pip install -q  -e /home/frappe/frappe-bench/apps/frappe", "stdout": "Already using interpreter /usr/bin/python\ninstalling frappe", "stdout_lines": ["Already using interpreter /usr/bin/python", "installing frappe"], "warnings": []}
       	to retry, use: --limit @develop/install.retry

PLAY RECAP *********************************************************************
localhost                  : ok=25   changed=4    unreachable=0    failed=1

Traceback (most recent call last):
  File "install.py", line 342, in <module>
    install_bench(args)
  File "install.py", line 108, in install_bench
    run_playbook('develop/install.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 292, 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', 'develop/install.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2

It’s kind of strange, yesterday i successfully installed production version without any problem.

What’s wrong?

Thx

[Edit] I can confirm it’s working properly using --production

Hi @shreyasp

I tried the correction you suggested. Same error.

Did it succeed at your end?

Regards,
cksgb

I got around it by doing the following on Ubuntu 14.04 LTS:

- name: Get nodejs 6.x bash script
  curl -o "/tmp/setup_6.x" -Q "chmod 664 setup_6.x"  "https://deb.nodesource.com/setup_6.x"
  become: yes
  become_user: root

@Chude_Osiegbu @iadr3805

Frappe team released a fix for the failure in case of node installation. Please try updating your bench-repo folder on master branch.

Node JS fix commit

1 Like

Great. So a bench update will do the trick?

@Chude_Osiegbu

No, you will have to re-run the install script to set up the complete production or development environment. In case you have done a manual installation of the node on your server. Then, you won’t need to re-run the script.

Ok, thanks. I did a manual install.