I’ve been working on a dev machine, and following the structure of the erpNext app, I created a folder under public called less, added all my less files to that directory and then updated my build.json to reflect the files.
On the dev box, every-time I update and save the less files, they get compiled to valid CSS. However, I just built a production box, installed my app, and the Less files, are being updated in the CSS folder, but they are not being compiled to CSS. Its just the less code. I tried to do a “bench build” and “bench clear-cache” but the files are staying as less files.
Is there a command I am suppose to execute on production, to get the less files to compile and ready to serve?
Im logged in as root, and trying to run ‘bench restart’ and it is prompting me for a sudo password for frappe.
If I’m root, and its prompting me for sudo password for frappe, do I need to create a password and add Frappe to the sudoers?
Im confused on how production is suppose to run. I assumed, when I installed my app, upon bench build or restart of the server all the files would be/get built.
I rebuilt my droplet at DigitalOceans and proceeded with the suggestions above. I forgot to mention I’m using Ubuntu 16.04.4 x64 (DigitalOceans stock image)
Revoked SSH login for root
Created a user frappe
added user frappe to sudoers
executed su frappe
then cd ~
I proceeded with the easy install script and all went well. Created my new site. Installed my custom app and, same result
I tried bench restart and even tried to reboot the server. All that shows in my apps stylesheet is LESS code. I went to my terminal on the production server and typed:
frappe@erp:~/frappe-bench$ less
Missing filename ("less --help" for help)
frappe@erp:~/frappe-bench$
So apparently LESS compiler is installed.
The only odd or error message I see when I install my app is:
/home/frappe/frappe-bench/apps/frappe/frappe/build.py:106: UserWarning: Source /home/frappe/frappe-bench/apps/custom_styles/custom_styles/docs does not exists.
Does the above Warning have anything to do with LESS compiling?
Since LESS ‘less’ is a unix command to view a file, I don’t see a relation.
The error message you indicate, is a UserWarning and not an error per se. So there must be another error message somewhere indicated. You need to review all messages.
Still can not find any errors… So the quick work around, is after I install the app in production, and it goes through the process of installing and compiling the JS and LESS, I go back to my app in the apps directory and do a git reset (since the LESS code has been placed in the CSS Directory), and a git pull and it syncs back the CSS files in the CSS folder that was compiled on the DEV box and submitted to teh repo.
This is a quick fix, of course, I have to worry about at some point the LESS getting rebuilt at any time if I have to run certain bench commands.
So as of now, the production app/site mirrors DEV, but only due to the stated above band aid.
Can anyone steer me in the direction of a place to start looking. I’ve grep’d the frappe_bech/logs directory for errors and only errors I see are related to:
frappe.utils.error.collect_error_snapshots
Which I’m assuming/guessing is not related, and will revisit that error after this css issue is resolved.