Manual installation going wrong (centos 6.8)

Hi, I’m trying to install erpnext on centos 6.8. I don’t really want to go ahead with the script installation because I want to maintain control over the installation process. I have installed a bunch of requirements already (python27, redis, etc…) and I have downloaded the bench and added frappe-bench as per https://frappe.github.io/frappe/user/en/bench/guides/manual-setup.html

I’m trying to setup “bench setup production” but this gives me an error about a username. So I then did “bench setup production ”. This generates two files and then throws an error:

supervisor.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y
nginx.conf already exists and this will overwrite it. Do you want to continue? [y/N]: y
Traceback (most recent call last):
File “/opt/rh/python27/root/usr/bin/bench”, line 9, in
load_entry_point(‘bench==3.0.0’, ‘console_scripts’, ‘bench’)()
File “/home/my-username/mywebsite/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/opt/rh/python27/root/usr/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/opt/rh/python27/root/usr/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/opt/rh/python27/root/usr/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/rh/python27/root/usr/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/rh/python27/root/usr/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/rh/python27/root/usr/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/my-username/mywebsite/bench-repo/bench/commands/setup.py”, line 43, in setup_production
setup_production(user=user)
File “/home/my-username/mywebsite/bench-repo/bench/config/production_setup.py”, line 17, in setup_production
bench_name=bench_name, extn=supervisor_conf_extn))
File “/opt/rh/python27/root/usr/lib64/python2.7/posixpath.py”, line 77, in join
elif path == ‘’ or path.endswith(‘/’):
AttributeError: ‘NoneType’ object has no attribute ‘endswith’

Have I missed a step in the installation process? Was I supposed to have created a user somewhere along the way? Is it correct to use my ssh username? (the user that owns files, the /home/myusername user)?

Thanks for your guidance.

I edited the script and now ‘kinda’ passed the setup stage. I have nginx error:
unknown directive “proxy_http_version”

*edit: updated nginx by adding the nginx repo and running
yum update nginx

This installed the latest version which recognizes this parameter.

Now I’m getting a 500 internal error… :frowning:

Stopping nginx: [ OK ]
Starting nginx: nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[FAILED]

I tried to run bench setup production. This is the error I got. I get a /etc/nginx/conf.d/frappe.conf file which wants to bind port 80 but this port is already in use by apache. How can I run the bench setup production command and define a different port (e.g. 8080)?

edit: ran bench set-nginx-port mysitename.local 8080 and restarted nginx - still 502 error bad gateway.

@Laurens See the gunicorn log in frappe-bench/logs folder

Hi @rmehta, I appreciate your help. I don’t have this file though:

frappe-bench]# ls logs/
./ node-socketio.error.log redis-queue.log web.error.log
…/ node-socketio.log redis-socketio.error.log web.log
auto_update_log.log redis-cache.error.log redis-socketio.log worker.error.log
backup.log redis-cache.log schedule.error.log worker.log
bench.log redis-queue.error.log schedule.log

I checked web.error.log etc… and found this though:

/home/myusername/frappe-bench/env/bin/python2: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

Where do I have to place this file? I have it on my filesystem:

locate libpython2.7.so.1.0
/opt/rh/python27/root/usr/lib64/libpython2.7.so.1.0

Trying this tip:

I’m reporting back if I know more.

Ok guys, as long as I’m seeing a different error, I’m continuing this endeavour. What a trip! I’ve been working and ploughing on this for hours on end, every time a new error pops up. At least I can resolve most of these things step by step… The thing is, I hope in the future things will get easier because our company will rely on this software and we can’t afford to lose this much time every time e.g. an update gets released, so I hope it will get smoother once I got everything sorted out. At least this can be used as a backlog for anybody running into the same kinds of problems as I did.

I also had to reinstall my site because apparently there were no databases created the first time. I followed the tips at this link: error when new site · Issue #1061 · frappe/frappe · GitHub
I also enabled the scheduler for my site with the command bench --site mysitename enable-scheduler

Right now supervisord correctly started as well (no more fails and backoffs) and redis also seems to behave. But now I have a internal server error of nginx again. ldconfig seems to have helped to resolve a part of the problems (see post above), but still it seems some programs can’t find this python library… Which programs are related to the following logfiles?

schedule.error.log worker.error.log

These are the ones still complaining about the missing library.

1 Like

Oh my god… I can’t believe it… it works. I’m now running erpnext.
I’m still worried though, I need these python errors dealt with because they’ll come back and bite me later if I don’t get this done.

Any suggestions?

1 Like

@Laurens Awesome. If its working you should not worry!

@rmehta, I respectfully but strongly disagree! Whenever everything seems to be working ok, but the logfiles are full of errors, you can be sure a disaster is waiting to happen. I’d like to resolve those errors before it’s too late and our data is corrupted beyond repair. Our company will depend on it.

@Laurens data validation is done within the app at the time of each entry, so that should not be the worry. If you have logs, it could affect performance or cause the system to crash.

Always best to keep redundant backups!

Dear rmehta,

I am facing problem sin installing bench on Centos 6.8. see the error below;

hroms@hroms.net [~]# bench init frappe-bench --reference
Traceback (most recent call last):
File “/usr/bin/bench”, line 5, in
from pkg_resources import load_entry_point
File “/usr/lib/python2.6/site-packages/setuptools-0.9.8-py2.6.egg/pkg_resources.py”, line 3007, in

File “/usr/lib/python2.6/site-packages/setuptools-0.9.8-py2.6.egg/pkg_resources.py”, line 728, in require
if search_path is None:
File “/usr/lib/python2.6/site-packages/setuptools-0.9.8-py2.6.egg/pkg_resources.py”, line 626, in resolve
# success, no need to try any more versions of this project
pkg_resources.DistributionNotFound: bench==4.1.0

hroms@hroms.net [~]# bench init frappe-bench
Traceback (most recent call last):
File “/usr/bin/bench”, line 5, in
from pkg_resources import load_entry_point
File “/usr/lib/python2.6/site-packages/setuptools-0.9.8-py2.6.egg/pkg_resources.py”, line 3007, in

File “/usr/lib/python2.6/site-packages/setuptools-0.9.8-py2.6.egg/pkg_resources.py”, line 728, in require
if search_path is None:
File “/usr/lib/python2.6/site-packages/setuptools-0.9.8-py2.6.egg/pkg_resources.py”, line 626, in resolve
# success, no need to try any more versions of this project
pkg_resources.DistributionNotFound: bench==4.1.0