Bench command unresponsive

Hi,

since the last update we cannot update ERPNext with the command bench update, we receive the following error:

You should not run this command as root

We installed the debian image of ERP version 4 some months ago and we used the command without problems since the last bench upgrade

are you running the command as root?

yes, we were installing just the precooked debian image that you offered for download. How can we change it? With another user i cannot access the /root folder

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:
https://discuss.frappe.io/t/files-from-assets-directory-not-loading-in-production-mode/3547/2
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.