Why code change is not presented in production server?

Hello, all members of this great community.
I want to get help for this problem.
I have an erpnext app with aws bitnami instance.
When I directly change codes in erpnext app, for example stock_entry.py in erpnext/erpnext/stock/doctypes/stock_entry/stock_entry.py, the change is only presented for one time, and that change is fixed no matter I change codes or clear all contents of this file.
What is the reason and how can I resolve this?

try bench restart and bench clear-cache

Thank you for your reply.
Actually, I tried bench restart and bench clear-cache, even bench clear-website-cache
but that is not fixed.
I will show some screenshots.


I added frappe.msgprint(“args:”+str(args)) to show this message box.
but after I removed this part, there is no change, I even removed the whole file content.

image
but nothing changes and still shows this message.

I tried those three commands.
bench restart
bench clear-cache
bench clear-website-cache
but there is no change.


this is after executing those commands.

do you think this is because of bench?
if the bench is installed correctly, can it be fixed?

What is maintenance_mode in bench config?
is this related to this issue?

Have you put your site in development mode?
That could be the issue: How to Enable Developer Mode in Frappe

I don’t see any other reason if you’ve already tried clearing cache and restarting bench.

thank you for your reply.
I didn’t try it in development mode. I will try.
What about maintenance_mode ?

bench clear-cache sometimes does not work.

Please restart the supervisor
sudo supervisorctl restart all

Or disable the production and start bench in development more

sudo bench disable-production
bench use SITENAME
bench start

Use the port mentioned to access the app

thank you for your advise.
I solved this problem by restarting services in bitnami server.
sudo /opt/bitnami/ctlscript.sh restart

this command restarts services running background, mainly apache server.
after executing this command, the code refreshed.
thank you again.