*SOLVED* Install.py now FAILS on Unbuntu 14.04, Debian 8, Centos 7. What happened? (also same on Ubuntu 16.04) *SOLVED*

Same error with --production and exact same script

TASK [Create new site] **********************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "new-site", "site1.local", "--admin-password", "frappe", "--mariadb-root-password", "frappe"], "delta": "0:00:03.217272", "end": "2018-01-19 22:26:55.814059", "failed": true, "rc": 1, "start": "2018-01-19 22:26:52.596787", "stderr": "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)", "stderr_lines": ["ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)"], "stdout": "Database not installed, this can due to lack of permission, or that the database name exists.\nCheck your mysql root password, or use --force to reinstall", "stdout_lines": ["Database not installed, this can due to lack of permission, or that the database name exists.", "Check your mysql root password, or use --force to reinstall"]}
    to retry, use: --limit @/tmp/.bench/playbooks/production/install.retry

PLAY RECAP **********************************************************************************************************************************************
localhost                  : ok=69   changed=41   unreachable=0    failed=1   

Traceback (most recent call last):
 File "install.py", line 388, in <module>
install_bench(args)
 File "install.py", line 114, in install_bench
run_playbook('production/install.yml', sudo=True, extra_vars=extra_vars)
File "install.py", line 326, 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

Yes, but it is still close. Still installing into /home/root. hmmmm.

Thanks for @bkm and @James_Robertson for all their efforts in getting this fixed. You are both a credit to the Community :sunglasses:

3 Likes

I just tried the

sudo python install.py --develop --user frappe --mysql-root-password frappe --admin-password frappe

And it works

when I change it to – production it breaks

sudo python install.py --production --user frappe --mysql-root-password frappe --admin-password frappe

TASK [Create new site] **********************************************************************************************************************************
fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: [“bench”, “new-site”, “site1.local”, “–admin-password”, “frappe”, “–mariadb-root-password”, “frappe”], “delta”: “0:00:02.630226”, “end”: “2018-01-19 23:56:31.031747”, “failed”: true, “rc”: 1, “start”: “2018-01-19 23:56:28.401521”, “stderr”: “ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)”, “stderr_lines”: [“ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)”], “stdout”: “Database not installed, this can due to lack of permission, or that the database name exists.\nCheck your mysql root password, or use --force to reinstall”, “stdout_lines”: [“Database not installed, this can due to lack of permission, or that the database name exists.”, “Check your mysql root password, or use --force to reinstall”]}
to retry, use: --limit @/tmp/.bench/playbooks/production/install.retry

PLAY RECAP **********************************************************************************************************************************************
localhost : ok=69 changed=41 unreachable=0 failed=1

Traceback (most recent call last):
File “install.py”, line 388, in
install_bench(args)
File “install.py”, line 114, in install_bench
run_playbook(‘production/install.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 326, 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

1 Like

:rofl: As I laugh to myself, I suspected this to be the case. I was just too tired from testing almost 20 different mutations of installing PRODUCTION servers today that the thought of doing a developer version was more of an annoyance. Developers need to realize that the project they hold so dear is almost entirely dependent on PRODUCTION servers actually working. :rofl::upside_down_face::rofl::astonished:

BKM

2 Likes

@bkm
Thanks for the traceback. Will look into it.

@bibinqcs
Thanks for mentioning. I think I’ll need to edit some more playbooks. I never tried installing with the --production flag… @bkm you might be right. The production flag might be the issue

Will try to get the issue fixed as soon as possible!
@Julian_Robbins, true indeed. Thanks a ton to everyone in this thread for their help.

2 Likes

Thanks for hanging with us @codingCoffee and suffering our poking fun at developers along the way. We really appreciate your time to make this right. We feel making installs easy is the key to promoting the project overall. Your efforts on this part of that goal are really important to us.

Thanks,

BKM

2 Likes

I am happy to help :smile:

1 Like

This is huge. The --develop flag does barely anything in the grand scheme of things. The --production flag should actually be default and --develop removed IMO. You can turn a “production” site into “develop” mode with a quick and easy step after installation, which I provide link to in my admin guide instructions. Even “development/non-production” sites still need all the settings and nginx.conf stuff as development sites to properly run. Especially if you need/want the development site to be shared.

ALL testing should be done with --production flag.

1 Like

Update:
Have fixed the issue in the production script as well.

@bkm the issue of setting SELinux to permissive has also been fixed in the script. Referring to this

@James_Robertson @bkm @bibinqcs could you please test the easy install out and give feedback !

Will surely remember that henceforth :stuck_out_tongue:

1 Like

Thanks for the update @codingCoffee, it works perfectly now, I could install it on VM with Ubuntu Linux 16.04 in the production environment.

Thank you @codingCoffee. I have confirmed that the script now works on all 4 versions of linux that were the subject of this thread.

  • CentOS 7
  • Debian 8
  • Ubuntu 14.04
  • Ubuntu 16.04

All now work as they should with the latest fixes to install.py

Great work folks!!

This thread can now be marked solved and closed.

BKM

2 Likes

My apologies BKM for finger problems while I learn how to unhide you post that I hid by mistake…