Bench build --force > 404

Using docker stack, I “bench build --force” and now, login looks like:

Looks like the references to previous versions are somewhere used.
Any idea what I should do to get everything back?

Try running bench update

If you are using containers refer: Frequently Asked Questions · frappe/frappe_docker Wiki · GitHub

@frappefr open your container and run this
chmod -R o+rx /home/frappe
change frappe with your user name.

Operation not permitted, and no sudo in the container

@revant_one OK, I see: You cannot build assets using bench build in running production containers. It will mess up the attached assets volume for the container in which the command was executed. It will cause problems in serving static assets. The asset building process is done during the image build. Images come pre-packaged with built assets and there is no need to build assets in production environment.

What should I do now to get it right and keep the app and site?

@ejaaz ERROR: Command 'git symbolic-ref -q --short HEAD' returned non-zero exit status 128. within the container

@frappefr I am almost sure you need to run this . as your console log shows , all css files not loading which indicates a permission error . you can run sudo inside the container , or open the root user .

Stop the containers and recreate them

use --force-recreate with docker compose up command it will re-create containers with correct assets from image.

Assumption in most answers is that you’re using a Debian or Ubuntu VM and not using containers. Anyone using containers please mention you’re using containers, It is useful for me to quote that and point our fixes.

sudo is not available in containers, so changing permissions with sudo will not work.

Again if you read FAQ is says to not do bench build in containers. Further changing the permissions is not at all recommended!

people are just scared of containers :slight_smile: . we are engineers , we install sudo on the containers . if we need permissions we take it . haha joking , use the method that suits you better .

The problem is, easy-install.py is using containers. New comers will use easy-install.py and land up with containers running.

Once that is done people generally need ton of other official and unofficial apps to really make ERPNext usable. Then posts like this pop-up.

In my OP:

I didn’t use easy-install but plain docker-compose. Here is my frappe stack on Chromium:

My desktop is the host. It’s running PopOS (Ubuntu) 22.04. No Windows involved anywhere here, haha.
To me, docker is the best, running multiple tests with it locally.

I’m following the doc. Unfortunately the doc just ignores the docker case (new comers using easy-install will find it pretty fast, and maybe they’ll go away from frappe).

Thank you for pointing me to the right doc @revant_one
I’ll try to re-compose everything.
I wonder if I’ll loose my app in the process. I’ll backup first.

Changed to image 15.47.1
Good you added Commands restricted in prodution container, Read FAQ before you proceed: https://frappe.fyi/ctr-faq

Same problem, for frontend:

for docker swarm I follow this: custom_containers/docs/docker-swarm.md at main · castlecraft/custom_containers · GitHub

port based multi-tenant and site resolution is challenging. Try dns based multi tenant as mentioned in the above doc.

1 Like

Thank you @revant_one, good to know for the future!
Now, I’m trying the VSCode way locally:

and I’ll try to move the app (batwara) to my docker hosting

Here is a video of everything working as expected on my end with stack:

Read my doc : docker-swarm.md, You can try what I did in video locally. I also did it locally.

For dind/local setup copy dind-devcontainer to .devcontainer and reopen in devcontainer.

mentioned here: custom_containers/docs/docker-swarm.md at main · castlecraft/custom_containers · GitHub

1 Like