Eprnext installation gets stuck at rebuilding login.css

Hi,
I tried installing erpnext version 13 as per instructions here:

and also refered to official doc.
Everything seemed fine until the bench start command. The start process got stuck on rebuilding login.css.
I tried reinstalling but with same result
Tried to access the web site ignoring it but it gives an 404 not found error
erpnext v13 was installed on a Ubunut20.4 VM using vagrant
VM configured with correct port forwarding and 4Gb memory
The request for web site can be seen being correctly forwarded to bench cli and it shows a 404 not found error. Tried accessing 0.0.0.0:8000
What is going wrong?

vagrant@ubuntu-focal:~/frappe-bench$ bench start

17:33:33 system | redis_cache.1 started (pid=3262)
17:33:33 system | web.1 started (pid=3266)
17:33:33 system | worker_short.1 started (pid=3274)
17:33:33 system | schedule.1 started (pid=3275)
17:33:33 redis_cache.1 | 3270:C 30 Mar 2022 17:33:33.890 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
17:33:33 redis_cache.1 | 3270:C 30 Mar 2022 17:33:33.890 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=3270, just started
17:33:33 redis_cache.1 | 3270:C 30 Mar 2022 17:33:33.890 # Configuration loaded
17:33:33 redis_cache.1 | 3270:M 30 Mar 2022 17:33:33.891 * Increased maximum number of open files to 10032 (it was originally set to 1024).
17:33:33 system | redis_queue.1 started (pid=3273)
17:33:33 system | watch.1 started (pid=3284)
17:33:33 system | redis_socketio.1 started (pid=3285)
17:33:33 system | socketio.1 started (pid=3282)
17:33:33 redis_cache.1 | 3270:M 30 Mar 2022 17:33:33.916 * Running mode=standalone, port=13000.
17:33:33 redis_cache.1 | 3270:M 30 Mar 2022 17:33:33.916 # Server initialized
17:33:33 redis_cache.1 | 3270:M 30 Mar 2022 17:33:33.916 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
17:33:33 redis_cache.1 | 3270:M 30 Mar 2022 17:33:33.916 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
17:33:33 redis_socketio.1 | 3287:C 30 Mar 2022 17:33:33.915 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
17:33:33 redis_socketio.1 | 3287:C 30 Mar 2022 17:33:33.915 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=3287, just started
17:33:33 redis_socketio.1 | 3287:C 30 Mar 2022 17:33:33.915 # Configuration loaded
17:33:33 redis_queue.1 | 3279:C 30 Mar 2022 17:33:33.916 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
17:33:33 redis_queue.1 | 3279:C 30 Mar 2022 17:33:33.917 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=3279, just started
17:33:33 redis_queue.1 | 3279:C 30 Mar 2022 17:33:33.917 # Configuration loaded
17:33:33 redis_queue.1 | 3279:M 30 Mar 2022 17:33:33.918 * Increased maximum number of open files to 10032 (it was originally set to 1024).
17:33:33 redis_queue.1 | 3279:M 30 Mar 2022 17:33:33.922 * Running mode=standalone, port=11000.
17:33:33 redis_socketio.1 | 3287:M 30 Mar 2022 17:33:33.924 * Increased maximum number of open files to 10032 (it was originally set to 1024).
17:33:33 redis_cache.1 | 3270:M 30 Mar 2022 17:33:33.925 * DB loaded from disk: 0.009 seconds
17:33:33 redis_cache.1 | 3270:M 30 Mar 2022 17:33:33.925 * Ready to accept connections
17:33:33 redis_socketio.1 | 3287:M 30 Mar 2022 17:33:33.925 * Running mode=standalone, port=12000.
17:33:33 redis_socketio.1 | 3287:M 30 Mar 2022 17:33:33.925 # Server initialized
17:33:33 redis_socketio.1 | 3287:M 30 Mar 2022 17:33:33.925 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
17:33:33 redis_socketio.1 | 3287:M 30 Mar 2022 17:33:33.925 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
17:33:33 redis_socketio.1 | 3287:M 30 Mar 2022 17:33:33.926 * Ready to accept connections
17:33:33 redis_queue.1 | 3279:M 30 Mar 2022 17:33:33.928 # Server initialized
17:33:33 redis_queue.1 | 3279:M 30 Mar 2022 17:33:33.931 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
17:33:33 redis_queue.1 | 3279:M 30 Mar 2022 17:33:33.932 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
17:33:34 system | worker_long.1 started (pid=3294)
17:33:33 redis_queue.1 | 3279:M 30 Mar 2022 17:33:33.933 * Ready to accept connections
17:33:34 system | worker_default.1 started (pid=3296)
17:33:35 web.1 | /home/vagrant/frappe-bench/env/lib/python3.8/site-packages/past/builtins/misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module’s documentation for alternative uses
17:33:35 web.1 | from imp import reload
17:33:35 schedule.1 | /home/vagrant/frappe-bench/env/lib/python3.8/site-packages/past/builtins/misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module’s documentation for alternative uses
17:33:35 schedule.1 | from imp import reload
17:33:35 watch.1 | /home/vagrant/frappe-bench/env/lib/python3.8/site-packages/past/builtins/misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module’s documentation for alternative uses
17:33:35 watch.1 | from imp import reload
17:33:37 web.1 | * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)
17:33:37 web.1 | * Restarting with inotify reloader
17:33:37 watch.1 | yarn run v1.22.18
17:33:37 web.1 | /home/vagrant/frappe-bench/env/lib/python3.8/site-packages/past/builtins/misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module’s documentation for alternative uses
17:33:37 web.1 | from imp import reload
17:33:37 watch.1 | $ node rollup/watch.js
17:33:38 web.1 | * Debugger is active!
17:33:38 web.1 | * Debugger PIN: 158-038-774
17:33:45 socketio.1 | listening on *: 9000
17:34:09 watch.1 |
17:34:09 watch.1 | Rollup Watcher Started
17:34:09 watch.1 |
17:34:09 watch.1 | Watching…
17:34:13 watch.1 | Browserslist: caniuse-lite is outdated. Please run:
17:34:13 watch.1 | npx browserslist@latest --update-db
17:34:13 watch.1 | Rebuilding erpnext.css
17:34:14 watch.1 | Rebuilding marketplace.css
17:34:14 watch.1 | Rebuilding erpnext-web.min.js
17:34:14 watch.1 | Rebuilding erpnext-web.css
17:34:14 watch.1 | Rebuilding marketplace.min.js
17:34:21 watch.1 | Rebuilding erpnext.min.js
17:34:23 watch.1 | Rebuilding item-dashboard.min.js
17:34:23 watch.1 | Rebuilding point-of-sale.min.js
17:34:24 watch.1 | Rebuilding bank-reconciliation-tool.min.js
17:34:24 watch.1 | Rebuilding e-commerce.min.js
17:34:25 watch.1 | Rebuilding hierarchy-chart.min.js
17:34:27 watch.1 | Rebuilding erpnext.css
17:34:27 watch.1 | Rebuilding marketplace.css
17:34:27 watch.1 | Rebuilding erpnext-web.css
17:34:30 watch.1 | Rebuilding frappe-web-b4.css
17:34:31 watch.1 | Rebuilding frappe-recorder.min.js
17:34:34 watch.1 | Rebuilding checkout.min.js
17:34:34 watch.1 | Rebuilding frappe-web.min.js
17:34:37 watch.1 | Rebuilding bootstrap-4-web.min.js
17:34:38 watch.1 | Rebuilding control.min.js
17:34:46 watch.1 | Rebuilding dialog.min.js
17:34:49 watch.1 | Rebuilding desk.min.css
17:34:50 watch.1 | Rebuilding printview.css
17:34:50 watch.1 | Rebuilding desk.min.js
17:35:00 watch.1 | Rebuilding form.min.js
17:35:07 watch.1 | Rebuilding list.min.js
17:35:11 watch.1 | Rebuilding report.min.css
17:35:11 watch.1 | Rebuilding report.min.js
17:35:13 watch.1 | Rebuilding web_form.min.js
17:35:13 watch.1 | Rebuilding web_form.css
17:35:13 watch.1 | Rebuilding email.css
17:35:13 watch.1 | Rebuilding barcode_scanner.min.js
17:35:15 watch.1 | Rebuilding user_profile_controller.min.js
17:35:16 watch.1 | Rebuilding login.css
17:35:16 watch.1 | Rebuilding data_import_tools.min.js
17:35:18 watch.1 | Rebuilding frappe-web-b4.css
17:35:20 watch.1 | Rebuilding desk.min.css
17:35:20 watch.1 | Rebuilding printview.css
17:35:20 watch.1 | Rebuilding report.min.css
17:35:20 watch.1 | Rebuilding web_form.css
17:35:20 watch.1 | Rebuilding email.css
17:35:20 watch.1 | Rebuilding login.css
17:38:38 web.1 | 10.0.2.2 - - [30/Mar/2022 17:38:38] “GET / HTTP/1.1” 404 -
17:38:39 web.1 | 10.0.2.2 - - [30/Mar/2022 17:38:39] “GET /favicon.ico HTTP/1.1” 404 -

My first suspect is you don’t have enough RAM.
ERPNext prefers min of 2 Core and 4GB RAM

I have allocated 4GB to my VM. Tried increasing to 5GB but with no success

hi @Dhopu_K

Please post a screenshot of your browser running on localhost site

In another post I saw this:
cd [bench directory]/sites/
sudo touch currentsite.txt
sudo nano currentsite.txt
and enter your site name for example- site1.local
ctrl+s and ctrl-x

I did that and restarted the VM. The error page says the system is updating but it remain like that for a long time and it does not progress. Not sure if the above just chaged the error message. The console now shows (after rebuilding login.css)


06:17:54 web.1 | 10.0.2.2 - - [31/Mar/2022 06:17:54] “GET / HTTP/1.1” 503 -
06:17:54 web.1 | 10.0.2.2 - - [31/Mar/2022 06:17:54] “GET /assets/frappe/js/lib/jquery/jquery.min.js HTTP/1.1” 304 -
06:17:54 web.1 | 10.0.2.2 - - [31/Mar/2022 06:17:54] “GET /assets/css/frappe-web-b4.css?ver=1648579933.0 HTTP/1.1” 200 -
06:17:54 web.1 | 10.0.2.2 - - [31/Mar/2022 06:17:54] “GET /assets/css/erpnext-web.css?ver=1648579933.0 HTTP/1.1” 200 -
06:17:54 web.1 | 10.0.2.2 - - [31/Mar/2022 06:17:54] “GET /assets/js/frappe-web.min.js?ver=1648579933.0 HTTP/1.1” 200 -
06:17:54 web.1 | 10.0.2.2 - - [31/Mar/2022 06:17:54] “GET /assets/js/bootstrap-4-web.min.js HTTP/1.1” 200 -
06:17:54 web.1 | 10.0.2.2 - - [31/Mar/2022 06:17:54] “GET /assets/js/erpnext-web.min.js?ver=1648579933.0 HTTP/1.1” 200 -
06:17:55 web.1 | 10.0.2.2 - - [31/Mar/2022 06:17:55] “GET /website_script.js?ver=1648579933.0 HTTP/1.1” 503 -
06:17:55 web.1 | 10.0.2.2 - - [31/Mar/2022 06:17:55] “POST / HTTP/1.1” 503 -
06:17:56 web.1 | 10.0.2.2 - - [31/Mar/2022 06:17:56] “GET /website_script.js?ver=1648579933.0 HTTP/1.1” 503 -
06:18:55 redis_cache.1 | 2107:M 31 Mar 2022 06:18:55.026 * 10 changes in 300 seconds. Saving…
06:18:55 redis_cache.1 | 2107:M 31 Mar 2022 06:18:55.027 * Background saving started by pid 2425
06:18:55 redis_cache.1 | 2425:C 31 Mar 2022 06:18:55.032 * DB saved on disk
06:18:55 redis_cache.1 | 2425:C 31 Mar 2022 06:18:55.033 * RDB: 0 MB of memory used by copy-on-write
06:18:55 redis_cache.1 | 2107:M 31 Mar 2022 06:18:55.130 * Background saving terminated with success
The screenshot is attached

Hello @Dhopu_K

The answer that you saw was posted by me…haha.

BTW the next post after this contains your answer so go through this link.

Thanks

FYI, console was not stuck at rebuilding login.css.

It’s working in development mode so everytime you want to use erpnext then you have bench start your directory. and for stopping the server you have to use ctrl+c.

And if you dont want this then you can setup production mode using:

sudo bench setup production [user]

after this you dont have to ‘bench start’ everytime

If your intended use is for production server you have to do bench setup production [user] or else you will always have to do a bench start every time you run the VM which is for development purpose.

Great @erpnxt_user! Thanks a lot for your help. My problem is resolved
I am fine with dev mode for now. To summarize the solution for the benefit of others:

  1. Increased RAM in my vagrant VM (I reloaded the VM alsoin between the belwo steps)
  2. I added the currentsite.txt as expalined above
  3. set the bench mode as suggested by erpnext user - the link is in the response - bench --site [sitename] set-config maintenance_mode 0
  4. did bench start and it worked like a charm!

One question - when you say production mode above (sudo bench setup production [user]) - how do you stop and start the server if you want in that case.
Do you have to still do ctrl+c and bench start or is there some other way.
Do you mean that If I do ctrl+c, I need not do bench start after my VM restart. Will erpnext start automatically once the VM is restarted?
Can I use the above production mode command in my next restart. Do I have to ‘unset’ the maintainence mode or will it do automatically by the production mode. i.e do I have to execute another command to remove the maintainence mode set to 0?

hi @Dhopu_K

In development mode, you have to do bench start always to start your server and ctrl+c is to stop the server

And in production mode, the server will automatically start when you start your system, so no need to do bench start and for stopping production mode, you have to do " bench disable-production " in terminal.

Thanks

Thanks. Is there something I have to do for disabling ‘set-config maintenance_mode 0’ I did earlier

As I feared, after doing “sudo bench setup production vagrant” and reloading the VM, I have lost the site. The downloads for production was successfull. I suspect it is to do with ports in the production set up and i need to configure the same in vagrant
which port can I now access the erpnext site. is it not 8000?

I forwarded port 8000 to port 80 assuming the nginx is running on that port. Still no success. VM restart logs below
==> default: Forwarding ports…
default: 80 (guest) => 8000 (host) (adapter 1)
Now I get this and the site is down:


It is like this for a long time
where can I see some logs . What else do i have to do

Ther is an error whil executing the supervisorctl
error: <class ‘ConnectionRefusedError’>, [Errno 111] Connection refused: file: /usr/lib/python3.8/socket.py line: 796