Problem with Bench Install Command line error: no such option: --setup-production

Hi,

I am trying to install bench on CentOS 7, and I am not able to install since there is I am getting the error as below on running

yum bash setup_frappe.sh --setup-production

I am getting this error message after I run the above command:

Loaded plugins: fastestmirror
Usage: yum [options] COMMAND

List of Commands:

check          Check for problems in the rpmdb
check-update   Check for available package updates
clean          Remove cached data
deplist        List a package's dependencies
distribution-synchronization Synchronize installed packages to the latest available versions
downgrade      downgrade a package
erase          Remove a package or packages from your system
fs             Creates filesystem snapshots, or lists/deletes current snapshots.
fssnapshot     Creates filesystem snapshots, or lists/deletes current snapshots.
groups         Display, or use, the groups information
help           Display a helpful usage message
history        Display, or use, the transaction history
info           Display details about a package or group of packages
install        Install a package or packages on your system
list           List a package or groups of packages
load-transaction load a saved transaction from filename
makecache      Generate the metadata cache
provides       Find what package provides the given value
reinstall      reinstall a package
repo-pkgs      Treat a repo. as a group of packages, so we can install/remove all of them
repolist       Display the configured software repositories
search         Search package details for the given string
shell          Run an interactive yum shell
swap           Simple way to swap packages, instead of using shell
update         Update a package or packages on your system
update-minimal Works like upgrade, but goes to the 'newest' package match which fixes a problem that affects your system
updateinfo     Acts on repository update information
upgrade        Update packages taking obsoletes into account
version        Display a version for the machine and/or available repos.


Command line error: no such option: --setup-production

I have resolved this issue by installing sudo on centos7, but I am stuck at the below error:

Cloning into 'frappe'...
Compiling /home/frappe/frappe-bench/env/build/gunicorn/gunicorn/workers/_gaiohtt                                                                                                                     p.py ...
  File "/home/frappe/frappe-bench/env/build/gunicorn/gunicorn/workers/_gaiohttp.                                                                                                                     py", line 64
    yield from self.wsgi.close()
             ^
SyntaxError: invalid syntax

Wrote ./assets/js/frappe-web.min.js - 90k
Wrote ./assets/js/print_format_v3.min.js - 18k
Wrote ./assets/css/frappe.css - 224k
Wrote ./assets/css/frappe-web.css - 163k
Wrote ./assets/js/editor.min.js - 27k
Wrote ./assets/js/frappe.min.js - 608k
Wrote ./assets/js/slickgrid.min.js - 102k
Wrote ./assets/js/canvasResize.min.js - 22k
installing frappe
Traceback (most recent call last):
  File "/bin/bench", line 9, in <module>
    load_entry_point('bench==0.1', 'console_scripts', 'bench')()
  File "/home/frappe/bench-repo/bench/cli.py", line 38, in cli
    return bench()
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 610, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 590, in main
    rv = self.invoke(ctx)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 936, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 416, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/bench-repo/bench/cli.py", line 106, in init
    no_auto_update=no_auto_update, frappe_path=frappe_path, frappe_branch=frappe                                                                                                                     _branch)
  File "/home/frappe/bench-repo/bench/utils.py", line 53, in init
    setup_backups(bench=path)
  File "/home/frappe/bench-repo/bench/utils.py", line 120, in setup_backups
    logfile=os.path.join(get_bench_dir(bench=bench), 'logs', 'backup.log')))
  File "/home/frappe/bench-repo/bench/utils.py", line 123, in add_to_crontab
    current_crontab = read_crontab()
  File "/home/frappe/bench-repo/bench/utils.py", line 131, in read_crontab
    s = subprocess.Popen(["crontab", "-l"], stdin=subprocess.PIPE, stdout=subpro                                                                                                                     cess.PIPE)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1308, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

I have tried to run the bench setup command again and this time I am getting a mysql error:

Installing for centos 7 amd64
In case you encounter an error, you can post on https://discuss.frappe.io

Adding centos mariadb repo
Installing packages for centos. This might take time...
Installing wkhtmltopdf
Configuring CentOS services
Starting services
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

Sir did you get the solution for this issue…?
bcoz i m also facing same problem…!
IF yes so please tell me the solution
Thanks in Advance

I think this error is outdated as the bench has gone through changes in leaps and bounds…can you post your error so that the team can analyse the error

@DNGupta are you trying to do a fresh new install? If so make sure you completely delete MariaDB from you Centos instance before you start. You can check by:
yum list installed | grep MariaDB

MariaDB jumped from Ver 5.x to Ver10.x a short while ago.

Thanks for your reply…!
And you are right sir
Here after run this command this msg is coming
[root@localhost ~]# yum list installed | grep MariaDB
MariaDB-Galera-server.x86_64 10.0.17-1.el7.centos @mariadb
MariaDB-client.x86_64 10.0.19-1.el7.centos @mariadb
MariaDB-common.x86_64 10.0.19-1.el7.centos @mariadb
MariaDB-devel.x86_64 10.0.19-1.el7.centos @mariadb
MariaDB-shared.x86_64 10.0.19-1.el7.centos @mariadb

After remove all the MariaDB by yum remove MariaDB-XXXXX
and than stop the server manually by : systemctl stop mysql
bcoz after remove all MariaDB i got this error
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2 “No such file or directory”)’
Check that mysqld is running and that the socket: ‘/var/lib/mysql/mysql.sock’ exists!
So this error i have solved by this command (systemctl stop mysql)
But still getting this error

[root@localhost ~]# bash setup_frappe.sh
Installing for centos 7 amd64
In case you encounter an error, you can post on https://discuss.frappe.io

Adding centos mariadb repo
Installing packages for centos. This might take time…
Installing wkhtmltopdf
Configuring CentOS services
Starting services
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘root’@‘localhost’ (using password: NO)’
[root@localhost ~]#


It looks like you have a DB that was previously created by the frappe installer.
You could log into mysql as root and drop the DB and try the frappe installer again.

Or delete MariaDB and do fresh frappe install (sorry I am no expert but this should delete pretty much all MariaDB stuff). If any of the yum remove commands return no file found no problem it just means it didn’t exsist.

sudo systemctl stop mariadb
sudo yum remove mariadb-server mariadb mariadb-libs
sudo yum remove mariadb-common mariadb-compat
sudo yum remove mysql-libs mysql-devel
sudo rm /etc/yum.repos.d/MariaDB.repo
And then run one or both of these commands depending on what install you have
sudo rm /etc/my.cnf
sudo rm /etc/my.cnf.d

sudo yum clean all

Then to see if all your db parts have been deleted
yum list installed | grep MariaDB

Then run frappe installer again…

This should work…

It’s of Sir it not the mater of ERPNEXT
Because this issue is related with MySQL
Your solution is really valuable for me which i had applied
But now this error is coming after executing this Frappe installation command

[root@localhost ~]# bash setup_frappe.sh
Installing for centos 7 amd64
In case you encounter an error, you can post on https://discuss.frappe.io

Adding centos mariadb repo
Installing packages for centos. This might take time…
Installing wkhtmltopdf
Configuring CentOS services
Starting services
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2 “No such file or directory”)’
Check that mysqld is running and that the socket: ‘/var/lib/mysql/mysql.sock’ exists!

I also got that error, Can’t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock
Any solution?

Have you tried my advice in the post above?
This advice is based on the idea that you do not currently have other running DB’s and you are preforming a fresh install.
Also make sure you have latest CentOS 7 and EPEL installed before starting.

Yes, I have done step above. Also checked that my EPEL is installed.