Bench command unresponsive

Our debian image has the bench installed in /home/erpnext/frappe-bench and runs as erpnext user.

You should add a user, move the bench, run chown, regenerate virtualenv, regenerate the nginx and supervisor config & link them.

OK, this may bring trouble… we wanted anyway to move soon to CentOS 7 so maybe it is the right moment now.

Is it possible to make a fresh install on CentOS and then export the database of debian and import it in the fresh CentOS installation?

OK, we found how to install with CentOS 7, it seems to be with an automated script:

And then i guess we just need to download and restore the backup:

Yes, and also copy the files form sites/{sitename}/public/files

Hi, everything went OK except the files, we were copying correctly pictures to sites/{sitename}/public/files but we receive a 404 error.

404 for assets? then run bench update --build

We tried bench update --build but did not work. We deleted the image and tried to upload again from the item page, but we get broken links on all images under:

/files/{anything}.jpg

Does the nignx log say permission denied?

No, nothing appears in nginx error log. When trying to open the picture in a new tab, nginx access log throws a 200 code so everything should be OK. But in the browser we get a 404 error.:

 Page missing or moved
We are very sorry for this, but the page you are looking for is missing (this could be because of a typo in the address) or moved.

Wait a sec. There was a mismatch in the folder name of the site, so after correcting the site folder in nginx conf, we indeed get a permission denied in nginx error log:

2014/11/17 09:36:33 [crit] 2691#0: *188 stat() "frappe-bench/sites/erpnext/public/website_script.js" failed (13: Permission denied), client: X.Y.Y.Z, server: erpnext.domain.com, request: "GET /website_script.js HTTP/1.1", host: "erpnext.domain.com", referrer: "http://erpnext.domain.com/files/picture-03.jpg"

Try regenerating the nginx conf with bench setup nginx and reload (assuming that you made a symlink for it)…

Cannot execute bench setup nginx:

IOError: [Errno 13] Permission denied: 'config/nginx.conf'

Can you remove that file as root and try again?

OK, removing the nginx.conf file works. But still the same problem with the permissions in nginx error log. We are trying to make requests with localhost and external requests also to the domain erpnext.domain.com but we get always the permissions error.

did you run ,

chmod o+rx /home/frappe

if not, run it and restart nginx

Yes, i did it before, i saw that maybe the folder permissions could be the problem in a previous post:

But is not working, must be something else…

As per the logs, it’s a file permission issue, ie. the nginx user is not able to access the file. You will have to investigate this further.

also, if you’ve SELinux on, you’ll have to enable a policy like httpd_home_dir

OK, thanks for the support. We finally found it. It was needed to edit the file /etc/nginx/nginx.conf
Line 5, user was set to ‘nginx’, has to be set to the user that performed the installation, in our case ‘frappe’

No, it’s sudo setsebool -P httpd_enable_homedirs 1

and you can also sudo usermod -aG frappe-user nginx and chmod g+rx /home/frappe-user so that you can use nginx as its intended user compatible with other apps