pymysql.err.InterfaceError after some hours of usage

Νίκος Βέργος vergos.nikolas at gmail.com
Wed Oct 2 01:11:38 EDT 2019


Hello, i use 'module pymysql' for connectivity in my wsgi scripts. For some reason after some hours of i.e. 'http://superhost.gr/files' i get the following error when the script tries to run:
Do you know why this is happening?!


Error: 500 Internal Server Error
Sorry, the requested URL 'http://superhost.gr/files/' caused an error:

Internal Server Error
Exception:
InterfaceError("(0, '')",)
Traceback:
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/usr/lib/python3.6/site-packages/bottle.py", line 1740, in wrapper
    rv = callback(*a, **ka)
  File "/home/nikos/wsgi/files.py", line 143, in displayall
    convert()
  File "/home/nikos/wsgi/files.py", line 93, in convert
    cur.execute('''SELECT file FROM files''')
  File "/usr/lib64/python3.6/site-packages/pymysql/cursors.py", line 170, in execute
    result = self._query(query)
  File "/usr/lib64/python3.6/site-packages/pymysql/cursors.py", line 328, in _query
    conn.query(q)
  File "/usr/lib64/python3.6/site-packages/pymysql/connections.py", line 516, in query
    self._execute_command(COMMAND.COM_QUERY, sql)
  File "/usr/lib64/python3.6/site-packages/pymysql/connections.py", line 750, in _execute_command
    raise err.InterfaceError("(0, '')")
pymysql.err.InterfaceError: (0, '')



I only use this opening statement in the beginning of my scripts.

conn = pymysql.connect( host='localhost', user='user', password='pass', db='counters' )
cur = conn.cursor()

Then i execute insert and update sql statements but i never close the connection. I presume python closes the connection when the script ends. Doesn't it?



More information about the Python-list mailing list