Installation of V5 fail

There is error when i install the V5:

[root@localhost ~]# sudo bash setup_frappe.sh --setup-production
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
Adding frappe user
Installing frappe-bench
Setting up first site
Restarted supervisord
Job for nginx.service failed. See ‘systemctl status nginx.service’ and ‘journalctl -xn’ for details.
Error: None
Traceback (most recent call last):
File “/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/bench-repo/bench/cli.py”, line 56, in cli
bench()
File “/usr/lib/python2.7/site-packages/click/core.py”, line 664, in call
return self.main(*args, **kwargs)
File “/usr/lib/python2.7/site-packages/click/core.py”, line 644, in main
rv = self.invoke(ctx)
File “/usr/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib/python2.7/site-packages/click/core.py”, line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/lib/python2.7/site-packages/click/core.py”, line 464, in invoke
return callback(*args, **kwargs)
File “/home/frappe/bench-repo/bench/cli.py”, line 421, in setup_production
_setup_production(user=user)
File “/home/frappe/bench-repo/bench/production_setup.py”, line 59, in setup_production
restart_service(‘nginx’)
File “/home/frappe/bench-repo/bench/production_setup.py”, line 9, in restart_service
exec_cmd("{prog} restart {service}".format(prog=‘systemctl’, service=service))
File “/home/frappe/bench-repo/bench/utils.py”, line 79, in exec_cmd
subprocess.check_call(cmd, cwd=cwd, shell=True)
File “/usr/lib64/python2.7/subprocess.py”, line 542, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘systemctl restart nginx’ returned non-zero exit status 1

Pls do not install as root.
Make a fresh VM and install as user.

Sunil

I tried install it as a normal user (with sudo), but still getting the same error.

BTW, I use the minimal installation of the Centos 7.

The detailed error as below:

[adam@localhost ~]$ sudo bash setup_frappe.sh --setup-production
[sudo] password for adam:
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
Adding frappe user
Installing frappe-bench
Setting up first site
Restarted supervisord
Job for nginx.service failed. See ‘systemctl status nginx.service’ and ‘journalctl -xn’ for details.
Error: None
Traceback (most recent call last):
File “/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/home/adam/bench-repo/bench/cli.py”, line 56, in cli
bench()
File “/usr/lib/python2.7/site-packages/click/core.py”, line 664, in call
return self.main(*args, **kwargs)
File “/usr/lib/python2.7/site-packages/click/core.py”, line 644, in main
rv = self.invoke(ctx)
File “/usr/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib/python2.7/site-packages/click/core.py”, line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/lib/python2.7/site-packages/click/core.py”, line 464, in invoke
return callback(*args, **kwargs)
File “/home/adam/bench-repo/bench/cli.py”, line 421, in setup_production
_setup_production(user=user)
File “/home/adam/bench-repo/bench/production_setup.py”, line 59, in setup_production
restart_service(‘nginx’)
File “/home/adam/bench-repo/bench/production_setup.py”, line 9, in restart_service
exec_cmd("{prog} restart {service}".format(prog=‘systemctl’, service=service))
File “/home/adam/bench-repo/bench/utils.py”, line 79, in exec_cmd
subprocess.check_call(cmd, cwd=cwd, shell=True)
File “/usr/lib64/python2.7/subprocess.py”, line 542, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘systemctl restart nginx’ returned non-zero exit status 1

Ignore this. It can be run as root

@adam

Running should give a clue

systemctl restart nginx
systemctl status nginx.service'
journalctl -xn
tail /var/log/nginx/error.log
``` from the shell should give a clue.

My hunch is that apache must be running on port 80.

[root@test2 ~]# systemctl status nginx.service
nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled)
Active: failed (Result: exit-code) since 五 2015-05-29 08:12:11 EDT; 5s ago
Process: 24709 ExecStop=/bin/kill -s QUIT $MAINPID (code=exited, status=0/SUCCESS)
Process: 23195 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Process: 27324 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
Main PID: 23197 (code=exited, status=0/SUCCESS)

5月 29 08:12:11 test2.erbees.com systemd[1]: Starting The nginx HTTP and re…
5月 29 08:12:11 test2.erbees.com nginx[27324]: nginx: [emerg] open() "/etc/…3
5月 29 08:12:11 test2.erbees.com nginx[27324]: nginx: configuration file /e…d
5月 29 08:12:11 test2.erbees.com systemd[1]: nginx.service: control process…1
5月 29 08:12:11 test2.erbees.com systemd[1]: Failed to start The nginx HTTP…
5月 29 08:12:11 test2.erbees.com systemd[1]: Unit nginx.service entered fai…
Hint: Some lines were ellipsized, use -l to show in full.
[root@test2 ~]# journalctl -xn
– Logs begin at 四 2015-05-28 12:55:46 EDT, end at 五 2015-05-29 08:12:11 EDT. –
5月 29 08:12:06 test2.erbees.com systemd[1]: nginx.service: control process exited, code=exited
5月 29 08:12:06 test2.erbees.com systemd[1]: Failed to start The nginx HTTP and reverse proxy se
– Subject: Unit nginx.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit nginx.service has failed.

– The result is failed.
5月 29 08:12:06 test2.erbees.com systemd[1]: Unit nginx.service entered failed state.
5月 29 08:12:11 test2.erbees.com sudo[27321]: root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND
5月 29 08:12:11 test2.erbees.com systemd[1]: Starting The nginx HTTP and reverse proxy server…
– Subject: Unit nginx.service has begun with start-up
– Defined-By: systemd


– Unit nginx.service has begun starting up.
5月 29 08:12:11 test2.erbees.com nginx[27324]: nginx: [emerg] open() "/etc/nginx/conf.d/frappe.c
5月 29 08:12:11 test2.erbees.com nginx[27324]: nginx: configuration file /etc/nginx/nginx.conf t
5月 29 08:12:11 test2.erbees.com systemd[1]: nginx.service: control process exited, code=exited
5月 29 08:12:11 test2.erbees.com systemd[1]: Failed to start The nginx HTTP and reverse proxy se
– Subject: Unit nginx.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit nginx.service has failed.

– The result is failed.
5月 29 08:12:11 test2.erbees.com systemd[1]: Unit nginx.service entered failed state.
[root@test2 ~]# tail /var/log/nginx/error.log
2015/05/29 08:12:06 [emerg] 27317#0: open() “/etc/nginx/conf.d/frappe.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:43
2015/05/29 08:12:11 [emerg] 27324#0: open() “/etc/nginx/conf.d/frappe.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:43

I am also getting the same error. Is there any solution found for this issue?

tail /var/log/nginx/error.log
2015/06/05 11:08:56 [emerg] 14747#0: open() “/etc/nginx/conf.d/frappe.conf” failed (13: Permission denied) in /etc/nginx/ngin x.conf:43
2015/06/05 11:16:21 [emerg] 14836#0: open() “/etc/nginx/conf.d/frappe.conf” failed (13: Permission denied) in /etc/nginx/ngin x.conf:43

Solved this error. As the installation was on CentOS7, it was due to SELinux set as Enforcing. After setting it to Disabled and rebooting the system nginx started on it’s own.