Skip to content

Internal Server Error #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
trhubwork opened this issue Sep 29, 2016 · 8 comments
Open

Internal Server Error #3

trhubwork opened this issue Sep 29, 2016 · 8 comments

Comments

@trhubwork
Copy link

I get the following error message in my terminal when I click the submit button.

  • Running on http://127.0.0.1:5002/ (Press CTRL+C to quit)
    127.0.0.1 - - [29/Sep/2016 15:53:10] "GET / HTTP/1.1" 200 -
    127.0.0.1 - - [29/Sep/2016 15:53:13] "GET /showSignUp HTTP/1.1" 200 -
    127.0.0.1 - - [29/Sep/2016 15:53:14] "GET /static/css/signup.css HTTP/1.1" 200 -
    127.0.0.1 - - [29/Sep/2016 15:53:14] "GET /static/js/jquery-1.11.2.js HTTP/1.1" 200 -
    127.0.0.1 - - [29/Sep/2016 15:53:14] "GET /static/js/signUp.js HTTP/1.1" 200 -
    [2016-09-29 15:53:19,759] ERROR in app: Exception on /signUp [POST]
    Traceback (most recent call last):
    File "C:\Users\TR\AppData\Local\Programs\Python\Python35-32\lib\site-packages\flask\app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
    File "C:\Users\TR\AppData\Local\Programs\Python\Python35-32\lib\site-packages\flask\app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "C:\Users\TR\AppData\Local\Programs\Python\Python35-32\lib\site-packages\flask\app.py", line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "C:\Users\TR\AppData\Local\Programs\Python\Python35-32\lib\site-packages\flask_compat.py", line 33, in reraise
    raise value
    File "C:\Users\TR\AppData\Local\Programs\Python\Python35-32\lib\site-packages\flask\app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
    File "C:\Users\TR\AppData\Local\Programs\Python\Python35-32\lib\site-packages\flask\app.py", line 1625, in dispatch_request
    return self.view_functionsrule.endpoint
    File "app.py", line 54, in signUp
    cursor.close()
    UnboundLocalError: local variable 'cursor' referenced before assignment
    127.0.0.1 - - [29/Sep/2016 15:53:19] "POST /signUp HTTP/1.1" 500 -

The console in dev tools reads:

jquery-1.11.2.js:9659

POST http://localhost:5002/signUp 500 (INTERNAL SERVER ERROR)send @ jquery-1.11.2.js:9659ajax @ jquery-1.11.2.js:9210(anonymous function) @ signUp.js:4dispatch @ jquery-1.11.2.js:4665elemData.handle @ jquery-1.11.2.js:4333

signUp.js:12 Object {readyState: 4, responseText: "↵", status: 500, statusText: "INTERNAL SERVER ERROR"}abort: ( statusText )always: ()complete: ()done: ()error: ()fail: ()getAllResponseHeaders: ()getResponseHeader: ( key )overrideMimeType: ( type )pipe: ( /* fnDone, fnFail, fnProgress / )progress: ()promise: ( obj )readyState: 4responseText: "↵<title>500 Internal Server Error</title>↵

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

↵"setRequestHeader: ( name, value )state: ()status: 500statusCode: ( map )statusText: "INTERNAL SERVER ERROR"success: ()then: ( /
fnDone, fnFail, fnProgress */ )proto: Object

@lameei
Copy link

lameei commented Nov 6, 2016

Any solutions here?

@johnkatt
Copy link

johnkatt commented Dec 1, 2016

Has anyone been able to find the problem with this?

@shpiyu
Copy link

shpiyu commented Dec 15, 2016

make sure you're using your own username and password in mysql's config instead of "jay" in app.py
and use flaskext.mysql instead of flask.ext.mysql
from flaskext.mysql import MySQL

@asyncze
Copy link

asyncze commented Jan 17, 2017

I'm using MAMP and fixed this problem by adding,

app.config['MYSQL_DATABASE_PORT'] = 8889
app.config['MYSQL_UNIX_SOCKET'] = '/Applications/MAMP/tmp/mysql/mysql.sock'

in app.py.

@mathurawasirishabh
Copy link

mathurawasirishabh commented Jun 15, 2017

app running fine but no change in database how to resolve this :
python app.py

  • Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
  • Restarting with stat
  • Debugger is active!
  • Debugger PIN: 296-410-667
    127.0.0.1 - - [15/Jun/2017 11:00:41] "GET / HTTP/1.1" 200 -
    127.0.0.1 - - [15/Jun/2017 11:00:43] "GET /showSignUp HTTP/1.1" 200 -
    127.0.0.1 - - [15/Jun/2017 11:00:57] "POST /signUp HTTP/1.1" 200 -

@SanthoshAshokkumar
Copy link

Try running this,

if name == "main":
app.run(port=3306)

@sakthi7
Copy link

sakthi7 commented Dec 18, 2017

hey,

i am getting the bellow ERROR, Will any one help me for fix this issue. I am struggling ...

ERROR -

[2017-12-19 04:10:57,469] ERROR in app: Exception on /signUp [POST]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functionsrule.endpoint
File "app.py", line 57, in signUp
cursor.close()
UnboundLocalError: local variable 'cursor' referenced before assignment
127.0.0.1 - - [19/Dec/2017 04:10:57] "POST /signUp HTTP/1.1" 500 -

@gnany07
Copy link

gnany07 commented Apr 6, 2019

sakthi7 from the error i feel that,you did not assign the cursor variable.did you do 'cursor =conn.cursor()'.Please check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants