Skip to content
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

The client was disconnected by the server because of inactivity. #2419

Closed
GreatBahram opened this issue May 26, 2021 · 1 comment
Closed

Comments

@GreatBahram
Copy link

Hi there,
I got this exception when I have a long connection that exceeds both wait_timeout and interactive_timeout timeouts:

  File "/usr/lib/python3/dist-packages/peewee.py", line 5513, in get
    return sq.get()
  File "/usr/lib/python3/dist-packages/peewee.py", line 5911, in get
    return clone.execute(database)[0]
  File "/usr/lib/python3/dist-packages/peewee.py", line 1587, in inner
    return method(self, database, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/peewee.py", line 1658, in execute
    return self._execute(database)
  File "/usr/lib/python3/dist-packages/peewee.py", line 1809, in _execute
    cursor = database.execute(self)
  File "/usr/lib/python3/dist-packages/peewee.py", line 2666, in execute
    return self.execute_sql(sql, params, commit=commit)
  File "/usr/lib/python3/dist-packages/peewee.py", line 2660, in execute_sql
    self.commit()
  File "/usr/lib/python3/dist-packages/peewee.py", line 2451, in __exit__
    reraise(new_type, new_type(*exc_args), traceback)
  File "/usr/lib/python3/dist-packages/peewee.py", line 178, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/peewee.py", line 2653, in execute_sql
    cursor.execute(sql, params or ())
  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 209, in execute
    res = self._query(query)
  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 315, in _query
    db.query(q)
  File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 226, in query
    _mysql.connection.query(self, query)
peewee.OperationalError: (4031, 'The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.')

I spotted the shortcuts module inside the peewee code handles these errors: 2006,2013, 2014. I think this can be added to the ReconnectMixin class as well.

Do you want me to add this into the ReconnectMixin class?

@GreatBahram
Copy link
Author

Thanks

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

1 participant