Production installation

I tried to execute as root

python install.py --production --user frappe

I am trying to go from development to production

[root@localhost ~]# python install.py --production --user frappe
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.iweb.ca
 * epel: mirror.nodesdirect.com
 * extras: centos.mirror.iweb.ca
 * updates: centos.mirror.iweb.ca
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.iweb.ca
 * epel: mirror.nodesdirect.com
 * extras: centos.mirror.iweb.ca
 * updates: centos.mirror.iweb.ca
Package epel-release-7-9.noarch already installed and latest version
Package redhat-lsb-core-4.1-27.el7.centos.1.x86_64 already installed and latest version
Package git-1.8.3.1-6.el7_2.1.x86_64 already installed and latest version
Package python-setuptools-0.9.8-4.el7.noarch already installed and latest version
Package python-devel-2.7.5-48.el7.x86_64 already installed and latest version
Package 1:openssl-devel-1.0.1e-60.el7.x86_64 already installed and latest version
Package libffi-devel-3.0.13-18.el7.x86_64 already installed and latest version
Nothing to do
Requirement already up-to-date: setuptools in /usr/lib/python2.7/site-packages
Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages
Requirement already up-to-date: six>=1.6.0 in /usr/lib/python2.7/site-packages (from setuptools)
Requirement already up-to-date: appdirs>=1.4.0 in /usr/lib/python2.7/site-packages (from setuptools)
Requirement already up-to-date: packaging>=16.8 in /usr/lib/python2.7/site-packages (from setuptools)
Requirement already up-to-date: pyparsing in /usr/lib/python2.7/site-packages (from packaging>=16.8->setuptools)
Requirement already satisfied: ansible==2.0.2.0 in /usr/lib/python2.7/site-packages
Requirement already satisfied: paramiko in /usr/lib/python2.7/site-packages (from ansible==2.0.2.0)
Requirement already satisfied: pycrypto>=2.6 in /usr/lib64/python2.7/site-packages (from ansible==2.0.2.0)
Requirement already satisfied: setuptools in /usr/lib/python2.7/site-packages (from ansible==2.0.2.0)
Requirement already satisfied: PyYAML in /usr/lib64/python2.7/site-packages (from ansible==2.0.2.0)
Requirement already satisfied: jinja2 in /usr/lib64/python2.7/site-packages (from ansible==2.0.2.0)
Requirement already satisfied: cryptography>=1.1 in /usr/lib64/python2.7/site-packages (from paramiko->ansible==2.0.2.0)
Requirement already satisfied: pyasn1>=0.1.7 in /usr/lib/python2.7/site-packages (from paramiko->ansible==2.0.2.0)
Requirement already satisfied: six>=1.6.0 in /usr/lib/python2.7/site-packages (from setuptools->ansible==2.0.2.0)
Requirement already satisfied: appdirs>=1.4.0 in /usr/lib/python2.7/site-packages (from setuptools->ansible==2.0.2.0)
Requirement already satisfied: packaging>=16.8 in /usr/lib/python2.7/site-packages (from setuptools->ansible==2.0.2.0)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib64/python2.7/site-packages (from jinja2->ansible==2.0.2.0)
Requirement already satisfied: ipaddress in /usr/lib/python2.7/site-packages (from cryptography>=1.1->paramiko->ansible==2.0.2.0)
Requirement already satisfied: cffi>=1.4.1 in /usr/lib64/python2.7/site-packages (from cryptography>=1.1->paramiko->ansible==2.0.2.0)
Requirement already satisfied: idna>=2.0 in /usr/lib/python2.7/site-packages (from cryptography>=1.1->paramiko->ansible==2.0.2.0)
Requirement already satisfied: enum34 in /usr/lib/python2.7/site-packages (from cryptography>=1.1->paramiko->ansible==2.0.2.0)
Requirement already satisfied: pyparsing in /usr/lib/python2.7/site-packages (from packaging>=16.8->setuptools->ansible==2.0.2.0)
Requirement already satisfied: pycparser in /usr/lib/python2.7/site-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] *****************************************************
skipping: [localhost] => (item=[])

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

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

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

TASK [Add repo] ****************************************************************
skipping: [localhost]

TASK [Install nodejs 6.x] ******************************************************
skipping: [localhost]

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

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

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

TASK [debug] *******************************************************************
skipping: [localhost]

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

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

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

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

TASK [development tools package] ***********************************************
ok: [localhost]

TASK [install prequisites] *****************************************************
skipping: [localhost] => (item=[u'redis', u'libselinux-python', u'mysql-devel', u'mysql-libs', u'libXrender', u'libXext', u'xorg-x11-fonts-75dpi', u'xorg-x11-fonts-Type1', u'libjpeg-devel', u'zlib-devel', u'libzip-devel', u'freetype-devel', u'lcms2-devel', u'libwebp-devel', u'libtiff-devel', u'tcl-devel', u'tk-devel', u'openldap-devel'])

TASK [Import Node source RPM key] **********************************************
ok: [localhost]

TASK [Add Node Repo] ***********************************************************
ok: [localhost]

TASK [Install nodejs] **********************************************************
ok: [localhost]

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

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

TASK [Install MariaDB] *********************************************************
skipping: [localhost] => (item=[u'MariaDB-server', u'MariaDB-client'])

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

TASK [download wkthmltox linux] ************************************************
ok: [localhost]

TASK [Creates directory] *******************************************************
ok: [localhost]

TASK [unarchive wkhtmltopdf] ***************************************************
changed: [localhost]

TASK [copy to /usr/local/bin] **************************************************
ok: [localhost]

TASK [make wkhtmltopdf executable] *********************************************
ok: [localhost]

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

TASK [Install MySQLdb in global env] *******************************************
ok: [localhost]

TASK [Add configuration] *******************************************************
changed: [localhost]

TASK [restart mysql linux] *****************************************************
changed: [localhost]

TASK [Set root Password] *******************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["mysqladmin", "-u", "root", "password", "frappe"], "delta": "0:00:00.024974", "end": "2017-02-05 20:42:55.602215", "failed": true, "rc": 1, "start": "2017-02-05 20:42:55.577241", "stderr": "\u0007mysqladmin: connect to server at 'localhost' failed\nerror: 'Access denied for user 'root'@'localhost' (using password: NO)'", "stdout": "", "stdout_lines": [], "warnings": []}
...ignoring

TASK [add launchagents folder mac] *********************************************
skipping: [localhost]

TASK [add mysql to mac startup] ************************************************
skipping: [localhost]

TASK [stop mysql mac] **********************************************************
skipping: [localhost]

TASK [start mysql mac] *********************************************************
skipping: [localhost]

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

TASK [Check if /tmp/.bench exists] *********************************************
ok: [localhost]

TASK [Check if bench_repo_path exists] *****************************************
ok: [localhost]

TASK [move /tmp/.bench if it exists] *******************************************
skipping: [localhost]

TASK [install bench] ***********************************************************
changed: [localhost]

TASK [Check whether bench exists] **********************************************
ok: [localhost]

TASK [init bench] **************************************************************
skipping: [localhost]

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

TASK [install frappe app] ******************************************************
ok: [localhost]

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

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

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

TASK [Add dotdeb apt repository key for Debian < 8] ****************************
skipping: [localhost]

TASK [Add dotdeb apt repository for redis-server for Debian < 8] ***************
skipping: [localhost]

TASK [install prequisites] *****************************************************
skipping: [localhost] => (item=[])

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

TASK [install pillow prerequisites for Debian >= 8] ****************************
skipping: [localhost] => (item=[])

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

TASK [Add repo] ****************************************************************
skipping: [localhost]

TASK [Install nodejs 6.x] ******************************************************
skipping: [localhost]

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

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

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

TASK [debug] *******************************************************************
skipping: [localhost]

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

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

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

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

TASK [Add nginx apt repository key for Debian < 8] *****************************
skipping: [localhost]

TASK [Add nginx apt repository for Debian < 8] *********************************
skipping: [localhost]

TASK [Install production pre-requisites] ***************************************
skipping: [localhost] => (item=[])

TASK [Install production pre-requisites] ***************************************
skipping: [localhost] => (item=[u'nginx', u'screen', u'vim', u'htop', u'git', u'postfix', u'MySQL-python'])

TASK [Install supervisor using yum for Centos 7] *******************************
ok: [localhost]

TASK [Rename default nginx.conf to nginx.conf.old] *****************************
changed: [localhost]

TASK [Copy the nginx_config template] ******************************************
changed: [localhost]

TASK [Reload the nginx service] ************************************************
changed: [localhost]

TASK [Set InnoDB buffer pool] **************************************************
changed: [localhost]

TASK [Set InnoDB buffer pool] **************************************************
skipping: [localhost]

TASK [Enable nginx, mysql, and redis] ******************************************
ok: [localhost] => (item=nginx)
ok: [localhost] => (item=mysql)

TASK [Enable redis.service on centos] ******************************************
ok: [localhost]

TASK [Enable redis-server.service on ubuntu] ***********************************
skipping: [localhost]

TASK [Check whether default supervisor.conf exists] ****************************
ok: [localhost]

TASK [Check whether default supervisor.conf exists] ****************************
skipping: [localhost]

TASK [insert/update inputrc for history] ***************************************
ok: [localhost]

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

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

TASK [Check whether a site exists] *********************************************
ok: [localhost]

TASK [Create new site] *********************************************************
skipping: [localhost]

TASK [Check ERPNext App exists] ************************************************
ok: [localhost]

TASK [Get-app erpnext app] *****************************************************
skipping: [localhost]

TASK [Install erpnext app] *****************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "--site", "site1.local", "install-app", "erpnext"], "delta": "0:00:08.899181", "end": "2017-02-05 20:43:46.695663", "failed": true, "rc": 1, "start": "2017-02-05 20:43:37.796482", "stderr": "Traceback (most recent call last):\n  File \"/usr/lib64/python2.7/runpy.py\", line 162, in _run_module_as_main\n    \"__main__\", fname, loader, pkg_name)\n  File \"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code\n    exec code in run_globals\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 79, in <module>\n    main()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 16, in main\n    click.Group(commands=commands)(prog_name='bench')\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py\", line 722, in __call__\n    return self.main(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py\", line 697, in main\n    rv = self.invoke(ctx)\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py\", line 1066, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py\", line 1066, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py\", line 895, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py\", line 535, in invoke\n    return callback(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py\", line 17, in new_func\n    return f(get_current_context(), *args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py\", line 24, in _func\n    ret = f(frappe._dict(ctx.obj), *args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py\", line 152, in install_app\n    _install_app(app, verbose=context.verbose)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 100, in install_app\n    frappe.clear_cache()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\", line 480, in clear_cache\n    for fn in get_hooks(\"clear_cache\"):\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\", line 796, in get_hooks\n    hooks = _dict(cache().get_value(\"app_hooks\", load_app_hooks))\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py\", line 70, in get_value\n    val = generator()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\", line 774, in load_app_hooks\n    for app in [app_name] if app_name else get_installed_apps(sort=True):\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\", line 738, in get_installed_apps\n    installed = json.loads(db.get_global(\"installed_apps\") or \"[]\")\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/database.py\", line 691, in get_global\n    return self.get_default(key, user)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/database.py\", line 703, in get_default\n    d = self.get_defaults(key, parent)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/database.py\", line 709, in get_defaults\n    defaults = frappe.defaults.get_defaults(parent)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/defaults.py\", line 72, in get_defaults\n    globald = get_defaults_for()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/defaults.py\", line 180, in get_defaults_for\n    where parent = %s order by creation\"\"\", (parent,), as_dict=1)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/database.py\", line 106, in sql\n    self.connect()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/database.py\", line 52, in connect\n    use_unicode=True, charset='utf8')\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/__init__.py\", line 81, in Connect\n    return Connection(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/connections.py\", line 193, in __init__\n    super(Connection, self).__init__(*args, **kwargs2)\n_mysql_exceptions.OperationalError: (1045, \"Access denied for user '1bd3e0294da19198'@'localhost' (using password: YES)\")", "stdout": "", "stdout_lines": [], "warnings": []}

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

PLAY RECAP *********************************************************************
localhost                  : ok=46   changed=8    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/lib64/python2.7/subprocess.py", line 542, 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
1 Like

Have you got solution for this?