v14 works fine. v15 only show web.1
infos,
and logs
folder didn’t has web.log
and web.error.log
Anyone help, thanks!!
Can you please share what errors it is showing and the traceback?
If any server errors occur, the terminal will display error message if you are in a local environment.
I click button and python occured, but it didn’t display any error message now, only show me 500 error, I can’t debug without messages.
Hi,
See if these links have anything useful:
https://frappeframework.com/docs/user/en/logging
https://frappeframework.com/docs/user/en/debugging#monitoring
I have tested with versions 14 and 15. It shows an error in the terminal where bench start
is running. Are you running background jobs on button clicks ?, and is developer mode enabled in your local environment?
The message is coming from your custom app override file. Please check if print
is added in the material_request
file within the create_purchase_order
method.
Thank you for everyone’s enthusiastic reply!!
here is common_site_config.json
and site_config.json
.
@NCP terminal can show print result, I want it auto show python error infos if python occured. not only 500 http error.
{
"background_workers": 1,
"default_site": "erpnext",
"enable_frappe_logger": true,
"file_watcher_port": 6787,
"frappe_user": "en",
"gunicorn_workers": 9,
"live_reload": true,
"maintenance_mode": 0,
"pause_scheduler": 0,
"rebase_on_pull": false,
"redis_cache": "redis://127.0.0.1:13000",
"redis_queue": "redis://127.0.0.1:11000",
"redis_socketio": "redis://127.0.0.1:13000",
"restart_supervisor_on_update": false,
"restart_systemd_on_update": false,
"scheduler_interval": "60",
"serve_default_site": true,
"server_script_enabled": 1,
"shallow_clone": true,
"socketio_port": 9000,
"use_redis_auth": false,
"webserver_port": 8000
}
{
"db_name": "...",
"db_password": "...",
"db_type": "mariadb",
"developer_mode": 1,
"encryption_key": "...",
"keep_backups_for_hours": "240"
}
you have to check the code, it is not an issue from the site config, it’s from the custom app.
for ex: my code in create_purchase_order
is something like:
def create_purchase_order():
a = 1 + "a"
return a
when I run it, I need terminal show error message like below for me to fix code up. Now it not worked.
File "apps/myapp/myapp/overrides/material_request.py", line 48, in create_purchase_order
a = 1+"a"
TypeError: unsupported operand type(s) for +: 'int' and 'str'
use it.
If you want to concatenate them as a string, you can convert the integer to a string like this:
def create_purchase_order():
a = str(1) + "a"
return a
Thank you very much for your time, you may not have understood my needs.
I understand Python syntax, and the erroneous code above was intentionally written by me.
I want to display errors in the console to facilitate problem and code correction. However, currently the console only shows a 500 error, making it difficult for me to find out which line of my code is problematic.
You need to debug the code and check the errors. If there is still an issue, uninstall the app and check the console. If no error or message appears, confirm that the issue is coming from the custom app.
The app is written myself, I need error infos to fix it over and over.
Now it has error infos now.
Thanks every one , I close it now.