New install fails on Centos 7 (SOLVED)

Hi, I just installed following Easy Way on Digital Ocean Centos 7 droplet, and setup_frappe.sh did it’s thing and completed correctly (all except wkhtmltopdf, but that’s ok). However, today I installed ERPNext on a new Centos 7 server using the Centos installation DVD (“network infrastructure server” profile), and setup_frappe.sh fails as follows. This is my second attempt, the first also failed because pip wasn’t installed by the Centos install profile. I did a fresh install (because it’s not clear how to cleanup after the install failure), installed pip and then ran setup_frappe.sh. Is the cause obvious to anyone, or can anyone say what the lower-level requirements are for setup_frappe.sh?

Thanks

[root@whizzer ~]# 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
Cannot install wkhtmltodpdf. Skipping…
Configuring CentOS services
Starting services
Adding frappe user
setup_frappe.sh: line 300: hash: pip-2.7: not found
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 35, 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 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 385, in _patch_mariadb_config
exec_cmd(os.path.join(repo_dir, ‘patches’, ‘fix-mariadb.sh’), cwd=os.path.join(repo_dir, ‘patches’))
File “/home/frappe/bench-repo/bench/utils.py”, line 61, 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 ‘/home/frappe/bench-repo/bench/patches/fix-mariadb.sh’ returned non-zero exit status 1
[root@whizzer ~]#

Working on this issue. Am able to replicate on DO images also.

frappe / ERPNext appears to be crashing on my Digital Ocean droplet once daily. This is the 2nd morning in a row browsing to ERPNext shows “Internal Server Failure”. All seems OK for at least 3~4 hours after booting the system, it’s always been overnight before I’ve noticed ERPNext has crashed. I still have ssh access to the droplet, and rebooting (# shutdown -r) restores ERPNext operation.

To fix the installation issue, we’ll have to fork mysql-python and apply a patch. Will be fixing that tomorrow.

For the “Internal Server Error”, please check the logs, process list (ps aux) and mysql processlist (select processlist; query) for clues.

thanks pdvyas. Is there a simple way to undue the partial install (by setup_frappe.sh before it crashed), or will it be simplest at this point to wipe the drive again and start over with a fresh Centos install?

I’ll start a new thread for “Internal Server Error” next time it happens.

If you can start with a clean install, that’d be great (hope that it isn’t much of a bother). Here’s the fix for the issue, Fix maridb patch by pdvyas · Pull Request #76 · frappe/bench · GitHub
will merge tomorrow.

No bother, but how to I use the patch? I have been using setup_frappe.sh, which won’t work until your patch is merged. Is the only alternative to do a full manual install?

Will release in sometime, so you can install using the automated script.

Did you try with the new release?

Hi pdvyas, I’m just trying to figure out what’s happening, but the short answer is there is still a problem.

setup_frappe.sh completes without error (see log). I can login as root over ssh, but my web browser on my laptop says no connection.

Here’s output from ps - faux, just ask if you want more info - this is my first date with Centos (more familiar with bsd) and I don’t really know what’s where.

Update 1. this is a clean install from the Centos 7 Everything-DVD on a Dell Optiplex 755. I installed the “network server infrastructure” (?) profile, and added email server and CIFS file server. After it was running I installed the Python EPEL repository and pip, and then grabbed and ran setup_frappe.sh

Update 2. I compared “ps -faux” on this new bare metal server to that output on my DigitalOcean server (the one where setup_frappe.sh did seem to install ERPNext correctly, but on Digital Ocean’s Centos 7 install). I don’t know how exactly to interpret this, but there seem to be a lot of processes not running on the new bare metal server (same log file as referenced above).

Update 3. pdvyas, sorry I couldn’t get back to you sooner, your last post was late morning my time (I think I am GMT-8 now) and I didn’t have time to experiment. However, I can work on this same time tomorrow. Please send any ideas (or request for more data).

Process list looks good. Check the following,

  • nginx bound to correct address (Does curl locahost work?)
  • Firewall
  • Some weird SELinux policy (Digital Ocean’s image is with SELinux disabled)

Also, adding EPEL or pip is not required, the shell script will do so anyway.

[root@hotstuff ~]# curl localhost
curl: (7) Failed connect to localhost:80; Connection refused
[root@hotstuff ~]#

I liked bsd because I didn’t have to learn about SELinux and other complications. Is there a master switch somewhere to disable SELinux?

So, nginx doesn’t seem to run but is in the processlist.
Anything in tail /var/log/nginx/error.log?

[root@hotstuff ~]# tail /var/log/nginx/error.log
[root@hotstuff ~]#

I liked the idea of using Centos (our local IT climate is, if it has to be unix instead of Windows, then it’s RedHat). However, I would grudgingly switch to Ubuntu if you think that would be faster for me (but will help debug this if you have the time).

I disabled SELinux (which I assume was originally on)

[root@hotstuff ~]# setenforce 0
[root@hotstuff ~]# sestatus | grep -i mode
Current mode: permissive
Mode from config file: enforcing
[root@hotstuff ~]#

then checked and confirmed firwalld is running:

[root@hotstuff ~]# ps fax | grep firewalld
3546 pts/0 S+ 0:00 _ grep --color=auto firewalld
3142 ? Ssl 0:00 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
[root@hotstuff ~]#

A Digital Ocean tutorial indicated firewalld would block httpd by default, so I added a rule for httpd and restarted firewalld (assuming that would be needed to pick up the new rule):

[root@hotstuff ~]# firewall-cmd --permanent --add-service=http
success
[root@hotstuff ~]# systemctl restart firewalld
[root@hotstuff ~]#

However, I still get “webpage not available” in a browser (Chrome). Clicking Details gives a bit more information:

This webpage is not available

Google Chrome's connection attempt to 192.168.1.123 was rejected. The website may be down, or your network may not be properly configured.

Does this give any clues?

Solved. pdvyas was able to diagnose the cause of the problem. 1) firewalld needs a rule to enable remote web client requests (which I had created), but also a SELinux profile was required for Nginx (which I still don’t understand at all ;-)). The ERPNext repo will be updated shortly so the SELinux profile is created during install, but the firewall rule will still be necessary.

A quick solution, although not recommended because it reduces the security of the default system, is to disable firewalld and SELinux:

# systemctl stop firewalld
# systemctl disable firewalld
# systemctl status firewalld

Set SELINUX=disabled in /etc/selinux/config:

# vi /etc/selinux/config

and reboot:

# shutdown -r now

I am installing ERPNext on an internal enterprise LAN to demonstrate a proof-of-concept. In this situation, the tradeoff between convenience and security is acceptable.

2 Likes

Fyi, I just created new Centos 7 system (from install DVD) and used current setup_frappe.sh to install ERPNext. With default SELINUX=enforcing in /etc/selinux/config, I could not connect to ERPNext from a remote browser. I then changed to SELINUX=permissive and could connect.

Hi,

I've tried to install ERPNext in CentOS 6.3 32 bit in VirtualBox on MacOSX. I did the following:

Follow instructions on https://github.com/webnotes/erpnext/wiki/Install-ERPNext-on-RedHat-based-systems
Execute installation according to https://github.com/webnotes/erpnext/wiki/How-to-Install-ERPNext
Create a port forwarding rule in VM settings (under Network -> Portforwarding) to forward TCP 127.0.0.1:8080 to 10.0.2.15:8080

Upon finishing the ERPNext installation, it prompts that the system is available on the host computer at localhost:8080. However, the page doesn't load (nor is it displaying any connection problems).

Any ideas or suggestions on where to start solving this problem?

Thanks in advance!



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi Neil,

It could be due to selinux.
Try: http://www.crypt.gen.nz/selinux/disable_selinux.html

Thanks,
Anand.

On 03-Sep-2013, at 5:07 PM, ne...@vanesstudio.eu wrote:

Hi,

I've tried to install ERPNext in CentOS 6.3 32 bit in VirtualBox on MacOSX. I did the following:

Create a port forwarding rule in VM settings (under Network -> Portforwarding) to forward TCP 127.0.0.1:8080 to 10.0.2.15:8080

Upon finishing the ERPNext installation, it prompts that the system is available on the host computer at localhost:8080. However, the page doesn't load (nor is it displaying any connection problems).

Any ideas or suggestions on where to start solving this problem?

Thanks in advance!



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.