How to resolve 500 Internal Server Error?
debugging, fixing, and resolving a server error from an Ajax call is exactly the same process as any other request.
Check the web server error logs for any indications of what the error is
Introduce debug statements into the serverside code around where the error is occuring (and add a little bit to your ajax request to dump all the response as plain text)
It may also be useful to copy the URL and querystring used in the Ajax call and paste it into your browser to view any responses.
Firebug for Firefox is also a useful diagnostic tool for testing what is being sent as part of the Ajax call and what is being sent back as a response.
500 Internal Server Error for some but not others
Non-logged in users got the error but logged in users didn't.
.Net application - 500 Internal Server Error
- Navigate to
%WINDIR%\system32\inetsrv\config\
- Create a backup copy of the file
applicationhost.config
and save it to a different location. - Open the
applicationhost.config
in Notepad. - Search for the following entry and Remove or disable the XPress compression schema from the configuration using the command below:
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/httpCompression /-[name='xpress']
- Verify if the compression schema has been removed form the
applicationhost.config
. - Save the
applicationhost.config
and restart IIS services.
Cannot Resolve a 500 (Internal Server Error) Code
I would try to put a more verbose exception in your code. Also, I think you can have the error
check inside your try...accept
@app.route('/todos/create', methods=['POST'])
def create_todo():
body = {}
try:
description = request.get_json()['description']
list_id = request.get_json()['list_id']
todo = Todo(description=description)
active_list = TodoList.query.get(list_id)
todo.list = active_list
db.session.add(todo)
db.session.commit()
body['description'] = todo.description
return jsonify(body)
except Exception as e:
print(e) # ------- tracing
db.session.rollback()
print(sys.exc_info())
finally:
db.session.close()
abort(500)
Related Topics
How to Add HTML Code to Jsf Facesmessage
Are Void Elements and Empty Elements The Same
Make a Parent Div Webkit-Filter Not Affect Children
HTML5 Standards of Nesting Div in Li or Dl
Aligning to The Bottom in Flexbox
CSS Sprites and Repeating Backgrounds
Is Any Way That Is Safe to Display Videos in a Browser
Word-Wrap Break-Word Does Not Work in This Example
Where Is The Default Size of a Div Element Defined or Calculated
CSS Double Border (2 Colors) Without Using Outline
CSS 100% Height with Absolute Positioning Top 0 Bottom 0
Pin a Flex Item to The Bottom of The Container
Font Size with Percentage Value (%) Not Scaling with Screen Size
Why Does Flex-Box Work with a Div, But Not a Table