Install Failure Ubuntu 16.04

Install Failure
Same machine were running erpnext

fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: [“bench”, “–site”, “site1.local”, “install-app”, “erpnext”], “delta”: “0:00:00.962098”, “end”: “2017-12-09 06:44:43.887732”, “failed”: true, “rc”: 1, “start”: “2017-12-09 06:44:42.925634”, “stderr”: “Traceback (most recent call last):\n File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main\n "main", fname, loader, pkg_name)\n File "/usr/lib/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 94, in \n main()\n File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main\n click.Group(commands=commands)(prog_name=‘bench’)\n File "/home/frappe/frappe-bench/env/local/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/local/lib/python2.7/site-packages/click/core.py", line 697, in main\n rv = self.invoke(ctx)\n File "/home/frappe/frappe-bench/env/local/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/local/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/local/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/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke\n return callback(*args, **kwargs)\n File "/home/frappe/frappe-bench/env/local/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 160, in install_app\n _install_app(app, verbose=context.verbose)\n File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 109, in install_app\n frappe.clear_cache()\n File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 512, in clear_cache\n for fn in get_hooks("clear_cache"):\n File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 828, 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 72, in get_value\n val = generator()\n File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 806, 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 770, 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 707, in get_global\n return self.get_default(key, user)\n File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 719, in get_default\n d = self.get_defaults(key, parent)\n File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 725, in get_defaults\n defaults = frappe.defaults.get_defaults(parent)\n File "/home/frappe/frappe-bench/apps/frappe/frappe/defaults.py", line 57, in get_defaults\n globald = get_defaults_for()\n File "/home/frappe/frappe-bench/apps/frappe/frappe/defaults.py", line 177, 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 121, in sql\n self.connect()\n File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 67, in connect\n use_unicode=True, charset=‘utf8mb4’)\n File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py", line 86, in Connect\n return Connection(*args, **kwargs)\n File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 204, in init\n super(Connection, self).init(*args, **kwargs2)\n_mysql_exceptions.OperationalError: (1045, "Access denied for user ‘1bd3e0294da19198’@‘localhost’ (using password: YES)")”, “stderr_lines”: [“Traceback (most recent call last):”, " File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main", " "main", fname, loader, pkg_name)“, " File "/usr/lib/python2.7/runpy.py", line 72, in _run_code”, " exec code in run_globals", " File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in “, " main()”, " File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main", " click.Group(commands=commands)(prog_name=‘bench’)“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 722, in call”, " return self.main(*args, **kwargs)“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 697, in main”, " rv = self.invoke(ctx)“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke”, " return _process_result(sub_ctx.command.invoke(sub_ctx))“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke”, " return _process_result(sub_ctx.command.invoke(sub_ctx))“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke”, " return ctx.invoke(self.callback, **ctx.params)“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke”, " return callback(*args, **kwargs)“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func”, " return f(get_current_context(), *args, **kwargs)“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py", line 24, in _func”, " ret = f(frappe._dict(ctx.obj), *args, **kwargs)“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 160, in install_app”, " _install_app(app, verbose=context.verbose)“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 109, in install_app”, " frappe.clear_cache()“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 512, in clear_cache”, " for fn in get_hooks("clear_cache"):“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 828, in get_hooks”, " hooks = _dict(cache().get_value("app_hooks", load_app_hooks))“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 72, in get_value”, " val = generator()“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 806, in load_app_hooks”, " for app in [app_name] if app_name else get_installed_apps(sort=True):“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 770, in get_installed_apps”, " installed = json.loads(db.get_global("installed_apps") or "")“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 707, in get_global”, " return self.get_default(key, user)“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 719, in get_default”, " d = self.get_defaults(key, parent)“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 725, in get_defaults”, " defaults = frappe.defaults.get_defaults(parent)“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/defaults.py", line 57, in get_defaults”, " globald = get_defaults_for()“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/defaults.py", line 177, in get_defaults_for”, " where parent = %s order by creation""", (parent,), as_dict=1)“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 121, in sql”, " self.connect()“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 67, in connect”, " use_unicode=True, charset=‘utf8mb4’)“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py", line 86, in Connect”, " return Connection(*args, **kwargs)“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 204, in init”, " super(Connection, self).init(*args, **kwargs2)", “_mysql_exceptions.OperationalError: (1045, "Access denied for user ‘1bd3e0294da19198’@‘localhost’ (using password: YES)")”], “stdout”: “”, “stdout_lines”: }

MariaDB server is up and running, but database were not created.
Please advise

can you access mysqld/mariadb via command line using the same parameters, and try creating a test DB?

yep, done normally with no issues

The same for the database/user proposed by eprnext installer.

Possibly your site_config.json lists multiple sites that are confused
[bench update] _mysql_exceptions.OperationalError - #5 by ashish-greycube

Below is the content of site_config.json just database name/password as production setup were aborted.

On other note, this is supposed to be somehow fresh install (i.e. just single site yet) after renaming old stack and removing old database/user/permission as well as nginx and supervisor conf files

Hi All,
I encounter a similar issue installing on UBUNTU AWS. Please advise what could possibly go wrong.

TASK [Create new site] ************************************************************************************************

fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: [“bench”, “new-site”, “site1.local”, “–admin-password”, “$htorm31”, “–mariadb-root-password”, “$htorm31”], “delta”: “0:00:01.353099”, “end”: “2017-12-09 19:18:46.259463”, “failed”: true, “rc”: 1, “start”: “2017-12-09 19:18:44.906364”, “stderr”: “Traceback (most recent call last):\n File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main\n "main", fname, loader, pkg_name)\n File "/usr/lib/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 94, in \n main()\n File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main\n click.Group(commands=commands)(prog_name=‘bench’)\n File "/home/frappe/frappe-bench/env/local/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/local/lib/python2.7/site-packages/click/core.py", line 697, in main\n rv = self.invoke(ctx)\n File "/home/frappe/frappe-bench/env/local/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/local/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/local/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/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke\n return callback(*args, **kwargs)\n File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 29, in new_site\n verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)\n File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 60, in _new_site\n admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)\n File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 36, in install_db\n create_database_and_user(force, verbose)\n File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 60, in create_database_and_user\n if force or (db_name not in dbman.get_database_list()):\n File "/home/frappe/frappe-bench/apps/frappe/frappe/model/db_schema.py", line 545, in get_database_list\n return [d[0] for d in self.db.sql("SHOW DATABASES")]\n File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 121, in sql\n self.connect()\n File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 67, in connect\n use_unicode=True, charset=‘utf8mb4’)\n File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py", line 86, in Connect\n return Connection(*args, **kwargs)\n File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 204, in init\n super(Connection, self).init(*args, **kwargs2)\n_mysql_exceptions.OperationalError: (1045, "Access denied for user ‘root’@‘localhost’ (using password: YES)")”, “stderr_lines”: [“Traceback (most recent call last):”, " File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main", " "main", fname, loader, pkg_name)“, " File "/usr/lib/python2.7/runpy.py", line 72, in _run_code”, " exec code in run_globals", " File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in “, " main()”, " File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main", " click.Group(commands=commands)(prog_name=‘bench’)“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 722, in call”, " return self.main(*args, **kwargs)“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 697, in main”, " rv = self.invoke(ctx)“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke”, " return _process_result(sub_ctx.command.invoke(sub_ctx))“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke”, " return _process_result(sub_ctx.command.invoke(sub_ctx))“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke”, " return ctx.invoke(self.callback, **ctx.params)“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke”, " return callback(*args, **kwargs)“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 29, in new_site”, " verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 60, in _new_site”, " admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 36, in install_db”, " create_database_and_user(force, verbose)“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 60, in create_database_and_user”, " if force or (db_name not in dbman.get_database_list()):“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/model/db_schema.py", line 545, in get_database_list”, " return [d[0] for d in self.db.sql("SHOW DATABASES")]“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 121, in sql”, " self.connect()“, " File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 67, in connect”, " use_unicode=True, charset=‘utf8mb4’)“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py", line 86, in Connect”, " return Connection(*args, **kwargs)“, " File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 204, in init”, " super(Connection, self).init(*args, **kwargs2)", “_mysql_exceptions.OperationalError: (1045, "Access denied for user ‘root’@‘localhost’ (using password: YES)")”], “stdout”: “”, “stdout_lines”: []}
to retry, use: --limit @/tmp/.bench/playbooks/production/install.retry

PLAY RECAP **************************************************************************************************************************************************
localhost : ok=73 changed=43 unreachable=0 failed=1

Dear Community,

Can anyone help or give at least a piece of advise about this issue?

@Gandolf Seems like traceback show permission issue. Can you please try installing as user not as root. In case install script doesn’t work, one of my existing thread maybe helpful.

Feel free to come back in case you need further help.

Sunil

Hi Sunil,

I tried this week to follow your advice and I tried also to run the same Easy Installation script on a fresh Ubuntu servers 16.04 and 14.04 deployed in AWS. Nothing worked. I still get the same error below. It’s very frustrating and I have almost given up on considering this nice free open source system for our small business. Any other ideas?
Please note I’m a novice to the ERPNext system itself and Ubuntu in general.

TASK [mariadb : Install MariaDB] ****************************************************************************************************************************
failed: [localhost] (item=[u’mariadb-server’, u’mariadb-client’, u’mariadb-common’, u’libmariadbclient-dev’, u’python-mysqldb’]) => {“cache_update_time”: 1513468523, “cache_updated”: false, “failed”: true, “item”: [“mariadb-server”, “mariadb-client”, “mariadb-common”, “libmariadbclient-dev”, “python-mysqldb”], “msg”: “‘/usr/bin/apt-get -y -o "Dpkg::Options::=–force-confdef" -o "Dpkg::Options::=–force-confold" install ‘mariadb-server’ ‘mariadb-client’ ‘mariadb-common’ ‘libmariadbclient-dev’ ‘python-mysqldb’’ failed: E: Unable to correct problems, you have held broken packages.\n”, “rc”: 100, “stderr”: “E: Unable to correct problems, you have held broken packages.\n”, “stderr_lines”: [“E: Unable to correct problems, you have held broken packages.”], “stdout”: “Reading package lists…\nBuilding dependency tree…\nReading state information…\nSome packages could not be installed. This may mean that you have\nrequested an impossible situation or if you are using the unstable\ndistribution that some required packages have not yet been created\nor been moved out of Incoming.\nThe following information may help to resolve the situation:\n\nThe following packages have unmet dependencies:\n libmariadbclient-dev : Depends: libmariadbclient18 (>= 10.1.29+maria-1~xenial) but it is not going to be installed\n mariadb-client : Depends: mariadb-client-10.1 (= 10.1.29+maria-1~xenial) but it is not going to be installed\n mariadb-server : Depends: mariadb-server-10.1 (= 10.1.29+maria-1~xenial) but it is not going to be installed\n python-mysqldb : Depends: libmysqlclient18 (>= 5.5.13-1) but it is not going to be installed\n”, “stdout_lines”: [“Reading package lists…”, “Building dependency tree…”, “Reading state information…”, “Some packages could not be installed. This may mean that you have”, “requested an impossible situation or if you are using the unstable”, “distribution that some required packages have not yet been created”, “or been moved out of Incoming.”, “The following information may help to resolve the situation:”, “”, “The following packages have unmet dependencies:”, " libmariadbclient-dev : Depends: libmariadbclient18 (>= 10.1.29+maria-1~xenial) but it is not going to be installed", " mariadb-client : Depends: mariadb-client-10.1 (= 10.1.29+maria-1~xenial) but it is not going to be installed", " mariadb-server : Depends: mariadb-server-10.1 (= 10.1.29+maria-1~xenial) but it is not going to be installed", " python-mysqldb : Depends: libmysqlclient18 (>= 5.5.13-1) but it is not going to be installed"]}

@Gandolf Seems like dependencies & broken package issue. Don’t worry, we are here to get ERPNext up and running for your business. Can you please try installing dependencies in below sequence:

sudo apt-get install -f
sudo apt-get install python-minimal
sudo apt-get install build-essential python-setuptools

Let’s give one more shot, manual installation would be more appropriate here.

Sunil

Hi Sunil,

when I try to install MariaDB following your previous post I get the following:

ubuntu@ip-172-31-41-193:~$ sudo apt install -y mariadb-server
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
mariadb-server : Depends: mariadb-server-10.1 (= 10.1.29+maria-1~xenial) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Please advise.

@Gandolf Uninstalling database and installing again should solve issue, please try this:
Step 1: Remove existing mysql installation and cleanup

sudo service mysql stop
sudo apt-get --purge remove "mysql*"
sudo rm -rf /etc/mysql/
sudo apt-get autoremove
sudo apt-get autoclean

Step 2: Install mariadb using earlier referred link.
Step 3: Initiate ERPNext installation once again.

Sunil

possibly a permissions problem on mysql
mysql -uroot -pYOUR_MYSQL_PASSWORD -Bse "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'YOUR_MYSQL_PASSWORD' WITH GRANT OPTION;"

Thanks fo helping. When I execute the first command

ubuntu@ip-172-31-41-193:~$ sudo service mysql stop
mysql: unrecognized service

I guess logically after the second command it returns

0 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.

nothing after returns after the third

after the forth the same

0 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.

then I did run the commands as suggested in your post:
sudo apt-get install software-properties-common

sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository ‘deb [arch=amd64,i386,ppc64el] http://mirror.jmu.edu/pub/mariadb/repo/10.1/ubuntu xenial main’

sudo apt update -y
sudo apt install -y mariadb-server

after the execution of the last command I received:

ubuntu@ip-172-31-41-193:~$ sudo apt install -y mariadb-server
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
mariadb-server : Depends: mariadb-server-10.1 (= 10.1.29+maria-1~xenial) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

@Gandolf How about sharing server details through personal message? we can help in setup.

Hi Sunil,

After some time I tried one more time and this time everything went well. I installed on a fresh Ubuntu 14.04.
Now I have another problem. I did successful installation of Lets encrypt. and it stopped working but now getting:

Sorry!
We will be back soon.
Don’t panic. It’s not you, it’s us.
Most likely, our engineers are updating the code, and it should take a minute for the new code to load into memory.
Try refreshing after a minute or two.

I probably will post about it a separate topic but if you can advise some steps in troubleshooting it will be much appreciated.