Site display in browser is messed up

Hello everyone,

Kindly bear with me as this is my first post. I am 100% new to Frappe.
I followed a guide to install frappe+erpnext on my test platform - a VMWare VM on my machine.
During the development testing, all was well and I could log in to the site using http://a.b.c.d:8000. Then I switched to production mode and rebooted the VM. Now the site is supposed to be on http://a.b.c.d:80 and it displays on the browser as if the CSS files are missing and I cannot even login to the site:

![frappe-site|690x383](upload://5Tjg1odTusP66HSydMW2jZ1u829.png)

I have googled for a solution and saw ‘sudo supervisorctl restart all’ which did not solve the issue.
All services are running:

(env) frappe@debian12:~/frappe-bench$ sudo supervisorctl status
[sudo] password for frappe:
frappe-bench-redis:frappe-bench-redis-cache                 RUNNING   pid 45819, uptime 0:54:41
frappe-bench-redis:frappe-bench-redis-queue                 RUNNING   pid 45820, uptime 0:54:41
frappe-bench-redis:frappe-bench-redis-socketio              RUNNING   pid 45821, uptime 0:54:41
frappe-bench-web:frappe-bench-frappe-web                    RUNNING   pid 45822, uptime 0:54:41
frappe-bench-web:frappe-bench-node-socketio                 RUNNING   pid 45823, uptime 0:54:41
frappe-bench-workers:frappe-bench-frappe-default-worker-0   RUNNING   pid 45825, uptime 0:54:41
frappe-bench-workers:frappe-bench-frappe-long-worker-0      RUNNING   pid 45827, uptime 0:54:41
frappe-bench-workers:frappe-bench-frappe-schedule           RUNNING   pid 45824, uptime 0:54:41
frappe-bench-workers:frappe-bench-frappe-short-worker-0     RUNNING   pid 45826, uptime 0:54:41

Because I think the browser display is something to do with cache, I have cleared browser cache too and that didn’t help.
I also saw a suggestion to add context.no_cache = 1 somewhere, but I don’t know where to add that.

I hope someone can help find a solution.

TIA

Do bench backup --with-files to take precautionary backup. Then try bench build && bench migrate after that do bench clear-cache Is your frappe production or development?

1 Like

Thank you for the suggestion. Suppose sh*t hits the fan and I need to restore from backup, what is the command? Just curious, because I don’t want to go over a reinstall. Or should I simply backup the whole directory - /home/frappe/ - to be safe?
As mentioned, I changed from development to production and that is where the problem started.
I have done all you have suggested, but it has not helped. My browser still displays the same useless stuff and I still can’t login.

https://frappeframework.com/docs/v14/user/en/bench/bench-commands

bench backup --with-files should give you 3 files. Create a new site with all the apps ready and restore the files as below

bench --site abc.com --force restore ~/file path -database.sql.gz --with-public-files ~/file path -private-files.tar --with-private-files ~/file path -files.tar

Keep MariaDB password ready. change abc.com to your site name.

Do I have to restore files, much as they weren’t working?
I just want a solution for my site to display properly on a browser for now. That’s what’s urgent.
I will keep these notes for the future, as I RTFM.

Although Muzzy’s approach is MUCH safer as a general rule, I always find that
bench update --reset
works quite well too

1 Like

It appears that the image I attached did not show up and so people are not exactly understanding my problem.

What I am seeing when I go to a.b.c.d:80 is this screen:

https://webmail.kictanet.or.ke/~wash/frappe-site.png

I am not getting a window I can login to.

Try running the bench update --reset again

I did, and here is the output:

https://pastebin.ubuntu.com/p/D3Ds4zXm7h/`

But I am still stuck on the same browser issue.

Have you tried Muzzy’s suggestion of
bench clear-cache

That too didn’t change anything. I actually tried that yesterday.
I guess found the problem, but I am not sure about the solution:

root@debian12:/home/wash/MySQL_DB_Backups# tail -f /var/log/nginx/error.log
2023/03/12 04:03:08 [crit] 63522#63522: *1 open() "/home/frappe/frappe-bench/sites/wash.lan/public//blog" failed (13: Permission denied), client: 172.16.17.109, server: wash.lan, request: "GET /blog HTTP/1.1", host: "172.16.17.107", referrer: "http://172.16.17.107/"
2023/03/12 04:03:08 [crit] 63522#63522: *1 open() "/home/frappe/frappe-bench/sites/assets/frappe/dist/css/website.bundle.2QAVX6VB.css" failed (13: Permission denied), client: 172.16.17.109, server: wash.lan, request: "GET /assets/frappe/dist/css/website.bundle.2QAVX6VB.css HTTP/1.1", host: "172.16.17.107", referrer: "http://172.16.17.107/blog"
2023/03/12 04:03:08 [crit] 63522#63522: *5 open() "/home/frappe/frappe-bench/sites/wash.lan/public//website_script.js" failed (13: Permission denied), client: 172.16.17.109, server: wash.lan, request: "GET /website_script.js HTTP/1.1", host: "172.16.17.107", referrer: "http://172.16.17.107/blog"
2023/03/12 04:03:08 [crit] 63522#63522: *3 open() "/home/frappe/frappe-bench/sites/assets/erpnext/dist/css/erpnext-web.bundle.GHC4AXL3.css" failed (13: Permission denied), client: 172.16.17.109, server: wash.lan, request: "GET /assets/erpnext/dist/css/erpnext-web.bundle.GHC4AXL3.css HTTP/1.1", host: "172.16.17.107", referrer: "http://172.16.17.107/blog"
2023/03/12 04:03:08 [crit] 63522#63522: *4 open() "/home/frappe/frappe-bench/sites/assets/frappe/dist/js/frappe-web.bundle.7TTW5I6I.js" failed (13: Permission denied), client: 172.16.17.109, server: wash.lan, request: "GET /assets/frappe/dist/js/frappe-web.bundle.7TTW5I6I.js HTTP/1.1", host: "172.16.17.107", referrer: "http://172.16.17.107/blog"
2023/03/12 04:03:08 [crit] 63522#63522: *6 open() "/home/frappe/frappe-bench/sites/assets/erpnext/dist/js/erpnext-web.bundle.SJSJGLAQ.js" failed (13: Permission denied), client: 172.16.17.109, server: wash.lan, request: "GET /assets/erpnext/dist/js/erpnext-web.bundle.SJSJGLAQ.js HTTP/1.1", host: "172.16.17.107", referrer: "http://172.16.17.107/blog"

So nginx has no permissions to read files.
This should be a known issue, no

SOLVED:

I solved this by installing in /opt/frappe instead of /home/frappe.

bench should always be installed in frappe-bench directory within frappe user home directory. All bench commands should be executed from frappe-bench directory.

1 Like