Error when installing erpnext on fresh ubuntu 16.04

Hello all,

I tried to install erpnext follow the document.

I get this error when using this script: sudo python install.py --production

error message:

fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "failed to create temporary content file: timed out"}```

**detail:**
> tw@ubuntu:~$ sudo python install.py --production
> Err:1 h t t p s://deb.nodesource.com/node_6.x xenial InRelease                                                                
>   Could not resolve host: deb.nodesource.com
> Hit:2 h t t p://hk.archive.ubuntu.com/ubuntu xenial InRelease                                                                                                 
> Hit:3 h t t p://hk.archive.ubuntu.com/ubuntu xenial-updates InRelease                                                                                         
> Hit:4 h t t p://hk.archive.ubuntu.com/ubuntu xenial-backports InRelease                                                                                       
> Hit:5 h t t p://nyc2.mirrors.digitalocean.com/mariadb/repo/10.1/ubuntu xenial InRelease                                                                       
> Get:6 h t t p://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
> Fetched 102 kB in 1min 53s (902 B/s)                         
> Reading package lists... Done
> W: Failed to fetch h t t p s://deb.nodesource.com/node_6.x/dists/xenial/InRelease  Could not resolve host: deb.nodesource.com
> W: Some index files failed to download. They have been ignored, or old ones used instead.
> Reading package lists... Done
> Building dependency tree       
> Reading state information... Done
> build-essential is already the newest version (12.1ubuntu2).
> git is already the newest version (1:2.7.4-0ubuntu1).
> libffi-dev is already the newest version (3.2.1-4).
> python-dev is already the newest version (2.7.11-1).
> python-setuptools is already the newest version (20.7.0-1).
> libssl-dev is already the newest version (1.0.2g-1ubuntu4.6).
> 0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
> The directory '/home/tw/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
> The directory '/home/tw/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
> Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/dist-packages
> Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages
> Requirement already up-to-date: appdirs>=1.4.0 in /usr/local/lib/python2.7/dist-packages (from setuptools)
> Requirement already up-to-date: packaging>=16.8 in /usr/local/lib/python2.7/dist-packages (from setuptools)
> Requirement already up-to-date: six>=1.6.0 in /usr/local/lib/python2.7/dist-packages (from setuptools)
> Requirement already up-to-date: pyparsing in /usr/local/lib/python2.7/dist-packages (from packaging>=16.8->setuptools)
> The directory '/home/tw/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
> The directory '/home/tw/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
> Requirement already satisfied: ansible==2.0.2.0 in /usr/local/lib/python2.7/dist-packages
> Requirement already satisfied: paramiko in /usr/local/lib/python2.7/dist-packages (from ansible==2.0.2.0)
> Requirement already satisfied: jinja2 in /usr/local/lib/python2.7/dist-packages (from ansible==2.0.2.0)
> Requirement already satisfied: PyYAML in /usr/local/lib/python2.7/dist-packages (from ansible==2.0.2.0)
> Requirement already satisfied: setuptools in /usr/local/lib/python2.7/dist-packages (from ansible==2.0.2.0)
> Requirement already satisfied: pycrypto>=2.6 in /usr/local/lib/python2.7/dist-packages (from ansible==2.0.2.0)
> Requirement already satisfied: pyasn1>=0.1.7 in /usr/local/lib/python2.7/dist-packages (from paramiko->ansible==2.0.2.0)
> Requirement already satisfied: cryptography>=1.1 in /usr/local/lib/python2.7/dist-packages (from paramiko->ansible==2.0.2.0)
> Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python2.7/dist-packages (from jinja2->ansible==2.0.2.0)
> Requirement already satisfied: appdirs>=1.4.0 in /usr/local/lib/python2.7/dist-packages (from setuptools->ansible==2.0.2.0)
> Requirement already satisfied: packaging>=16.8 in /usr/local/lib/python2.7/dist-packages (from setuptools->ansible==2.0.2.0)
> Requirement already satisfied: six>=1.6.0 in /usr/local/lib/python2.7/dist-packages (from setuptools->ansible==2.0.2.0)
> Requirement already satisfied: idna>=2.0 in /usr/local/lib/python2.7/dist-packages (from cryptography>=1.1->paramiko->ansible==2.0.2.0)
> Requirement already satisfied: enum34 in /usr/local/lib/python2.7/dist-packages (from cryptography>=1.1->paramiko->ansible==2.0.2.0)
> Requirement already satisfied: ipaddress in /usr/local/lib/python2.7/dist-packages (from cryptography>=1.1->paramiko->ansible==2.0.2.0)
> Requirement already satisfied: cffi>=1.4.1 in /usr/local/lib/python2.7/dist-packages (from cryptography>=1.1->paramiko->ansible==2.0.2.0)
> Requirement already satisfied: pyparsing in /usr/local/lib/python2.7/dist-packages (from packaging>=16.8->setuptools->ansible==2.0.2.0)
> Requirement already satisfied: pycparser in /usr/local/lib/python2.7/dist-packages (from cffi>=1.4.1->cryptography>=1.1->paramiko->ansible==2.0.2.0)
>  [WARNING]: Host file not found: /etc/ansible/hosts

>  [WARNING]: provided hosts list is empty, only localhost is available


> PLAY [localhost] ***************************************************************

> TASK [setup] *******************************************************************
> ok: [localhost]

> TASK [Create user] *************************************************************
> ok: [localhost]

> TASK [Set home folder perms] ***************************************************
> ok: [localhost]

> TASK [Set home folder perms] ***************************************************
> skipping: [localhost]

> TASK [Set /tmp/.bench folder perms] ********************************************
> changed: [localhost]
>  [WARNING]: Consider using file module with owner rather than running chown


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

> Please enter mysql root password: 
> Re-enter mysql root password: 
> Please enter the default Administrator user password: 
> Re-enter Administrator password: 
> Passwords saved at ~/passwords.txt
>  [WARNING]: Host file not found: /etc/ansible/hosts

>  [WARNING]: provided hosts list is empty, only localhost is available


> PLAY [localhost] ***************************************************************

> TASK [setup] *******************************************************************
> ok: [localhost]

> PLAY [localhost] ***************************************************************

> TASK [setup] *******************************************************************
> ok: [localhost]

> PLAY [localhost] ***************************************************************

> TASK [setup] *******************************************************************
> ok: [localhost]

> TASK [install prequisites] *****************************************************
> skipping: [localhost] => (item=cmake) 
> skipping: [localhost] => (item=redis) 
> skipping: [localhost] => (item=mariadb) 
> skipping: [localhost] => (item=nodejs) 

> TASK [cask installs] ***********************************************************
> skipping: [localhost] => (item=wkhtmltopdf) 

> TASK [include] *****************************************************************
> skipping: [localhost]

> TASK [include] *****************************************************************
> skipping: [localhost]

> TASK [include] *****************************************************************
> skipping: [localhost]

> PLAY [localhost] ***************************************************************

> TASK [setup] *******************************************************************
> ok: [localhost]

> TASK [install prequisites] *****************************************************
> ok: [localhost] => (item=[u'build-essential', u'redis-server', u'software-properties-common', u'libxrender1', u'libxext6', u'xfonts-75dpi', u'xfonts-base', u'libjpeg8-dev', u'zlib1g-dev', u'libfreetype6-dev', u'liblcms2-dev', u'libwebp-dev', u'python-tk', u'apt-transport-https', u'libsasl2-dev', u'libldap2-dev'])

> TASK [install pillow prerequisites for Ubuntu < 14.04] *************************
> skipping: [localhost] => (item=[]) 

> TASK [install pillow prerequisites for Ubuntu >= 14.04] ************************
> ok: [localhost] => (item=[u'libtiff5-dev', u'tcl8.6-dev', u'tk8.6-dev'])

> TASK [Add apt key for node repo] ***********************************************
> ok: [localhost]

> TASK [Add repo] ****************************************************************
> ok: [localhost]

> TASK [Install nodejs 6.x] ******************************************************
> ok: [localhost]

> TASK [include] *****************************************************************
> included: /tmp/.bench/playbooks/develop/includes/mariadb_ubuntu.yml for localhost

> TASK [Add apt key for mariadb for Ubuntu < 16.04] ******************************
> skipping: [localhost]

> TASK [Add apt key for mariadb for Ubuntu >= 16.04] *****************************
> ok: [localhost]

> TASK [Add apt repository] ******************************************************
> ok: [localhost]

> TASK [Unattended package installation] *****************************************
> changed: [localhost]

> TASK [apt-get install] *********************************************************
> ok: [localhost] => (item=[u'mariadb-server', u'mariadb-client', u'mariadb-common', u'libmariadbclient-dev'])

> TASK [include] *****************************************************************
> included: /tmp/.bench/playbooks/develop/includes/wkhtmltopdf.yml for localhost

> TASK [download wkthmltox linux] ************************************************
> fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "failed to create temporary content file: timed out"}
> 	to retry, use: --limit @production/install.retry

> PLAY RECAP *********************************************************************
> localhost                  : ok=15   changed=1    unreachable=0    failed=1   

> Traceback (most recent call last):
>   File "install.py", line 351, 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 301, 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', 'production/install.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2

Retry again

sudo python install.py --production

If it fails, try installing wkhtmltopdf manually, for ref follow this link

@tw666 some dependencies was not able to get downloaded due to connection time out as your internet or ubuntu respiratory seems be broken. Retry as recommended in previous post, if problem persist, then try to explore Ubuntu forum for why errors like Err:1 h t t p s://deb.nodesource.com/node_6.x xenial InRelease are cropping up on your machine.

I had the same problem…It seems the installer is not finding the wkhtmltox file to download.

I just replaced the 2nd line in the ansible playbook found here (in your installation server):

/tmp/.bench/playbooks/develop/includes

with this line (the correct path to a found installer):

get_url: url=http://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz dest=/tmp/wkhtmltox.tar.xz dest=/tmp/wkhtmltox.tar.xz

It seemed to work…If I found any issue, I’ll post it here.

1 Like

Thanks, we are fixing this.

I am too getting same error please help on fixing it.

TASK [download wkthmltox linux] ************************************************
fatal:
[localhost]: FAILED! => {“changed”: false, “failed”: true, “msg”:
“failed to create temporary content file: timed out”}
to retry, use: --limit @production/install.retry
PLAY RECAP *********************************************************************
localhost : ok=15 changed=1 unreachable=0 failed=1
Traceback (most recent call last):
File “install.py”, line 351, in
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 301, 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’, ‘production/install.yml’,
‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=frappe’]’
returned non-zero exit status 2

Hey Janardan…did you try my solution?

Thank you i tried that solution as well.
I just replace the 2nd line link with yours given on file.
And it works for me.

Thanks a lot.
Will be seeking for more help as of i am new for frappe and erpnext.

Great…glad to help :slight_smile:

when i start bench its getting stop automatically .
It shows following details.
please need help to initiate bench.

swift@ubuntu:~/frappe-bench$ bench start
14:14:58 system | redis_socketio.1 started (pid=41998)
14:14:58 system | watch.1 started (pid=42006)
14:14:58 system | worker_long.1 started (pid=42004)
14:14:58 system | redis_queue.1 started (pid=42003)
14:14:58 system | web.1 started (pid=42011)
14:14:58 system | schedule.1 started (pid=42018)
14:14:58 system | worker_default.1 started (pid=42020)
14:14:58 system | socketio.1 started (pid=42010)
14:14:58 system | worker_short.1 started (pid=42022)
14:14:58 redis_socketio.1 | 42005:M 25 May 14:14:58.605 * Increased maximum number of open files to 10032 (it was originally set to 1024).
14:14:58 redis_socketio.1 | 42005:M 25 May 14:14:58.605 # Creating Server TCP listening socket 127.0.0.1:12000: bind: Address already in use
14:14:58 system | redis_socketio.1 stopped (rc=1)
14:14:58 redis_queue.1 | 42012:M 25 May 14:14:58.606 * Increased maximum number of open files to 10032 (it was originally set to 1024).
14:14:58 redis_queue.1 | 42012:M 25 May 14:14:58.606 # Creating Server TCP listening socket 127.0.0.1:11000: bind: Address already in use
14:14:58 system | redis_queue.1 stopped (rc=1)
14:14:58 system | redis_cache.1 started (pid=42031)
14:14:58 system | sending SIGTERM to worker_long.1 (pid 42004)
14:14:58 system | sending SIGTERM to watch.1 (pid 42006)
14:14:58 system | sending SIGTERM to web.1 (pid 42011)
14:14:58 system | sending SIGTERM to schedule.1 (pid 42018)
14:14:58 system | sending SIGTERM to worker_default.1 (pid 42020)
14:14:58 system | sending SIGTERM to socketio.1 (pid 42010)
14:14:58 system | sending SIGTERM to redis_cache.1 (pid 42031)
14:14:58 system | sending SIGTERM to worker_short.1 (pid 42022)
14:14:58 system | worker_long.1 stopped (rc=-15)
14:14:58 system | schedule.1 stopped (rc=-15)
14:14:58 system | watch.1 stopped (rc=-15)
14:14:58 system | socketio.1 stopped (rc=-15)
14:14:58 system | web.1 stopped (rc=-15)
14:14:58 system | worker_default.1 stopped (rc=-15)
14:14:58 system | worker_short.1 stopped (rc=-15)
14:14:58 redis_cache.1 | 42032:M 25 May 14:14:58.612 * Increased maximum number of open files to 10032 (it was originally set to 1024).
14:14:58 redis_cache.1 | 42032:M 25 May 14:14:58.612 # Creating Server TCP listening socket 127.0.0.1:13000: bind: Address already in use
14:14:58 system | redis_cache.1 stopped (rc=1)

Heyy …are you able to solver this error?