-
Notifications
You must be signed in to change notification settings - Fork 98
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
peewee.InterfaceError: (0, '') | pymysql.err.InterfaceError: (0, '') #59
Comments
according to this tread: http://stackoverflow.com/questions/6650940/interfaceerror-0 here I must mention what I use
do context manager releases cursors after exiting a transaction? |
Hello @dikderoy! Could you provide complete code snippet to reproduce the issue?
Transactions in async mode is a kind of tricky thing. Usually in blocking mode connection for transaction is saved into thread locals so it can't interfere with other connections from other threads / transactions. Is sync mode we can't use thread locals, so we're using per-task context. That means, each transactions should run within separate async task. So, I'm not sure, It may be some edge case. |
it occurs on this code (quite tricky, nested coroutines and several
later I will try to write an app to reproduce the issue, for now this is a snippet from my project itself as is. |
according to stacktrace - it appears in case then
at 3rd "level" |
looks like the issue has nothing to do with i've refactored my code, removing nested atomics, and make the problematic call with no transaction at all, problem persists.. and after relaunch - it works normally... |
so far my investigation led me to following:
I forged a simple app with a unit test which reproduce an issue. resulting exception is different (not InterfaceError) but I think these two cases are connected. here is a repo with an app - if you're interested: https://github.com/dikderoy/peewee-async-bug and here is a trace:
|
Hi @dikderoy! I've performed a little investigation, here are some thoughts.
But what bothers me is that sync query is triggered, I think I'll dive into it some time later. |
my test is designed to show what bug appears in simple, real-world scenario, "crazy-monkey method" to speed up tests - is just a way of getting work done faster =) Here is another thing which can help to track the cause - in all variations of code and execution graphs - it always fail while working with I am not familiar with peewee internals but it looks connected. |
Experiencing the same InterfaceError, any progress on this? |
I am also encountering this. I am not using anything fancy from peewee - just the high level API. And indeed, it happens after long idle time. Edit: Looks like I got the wrong repo, I'm actually using normal peewee. This is still an issue for me, though. Maybe this will help you narrow it down. |
I got same error in combination of
|
Same here. Peewee used in an asyncio method
|
@Sispheor This call is not async, my guess is that sync fallback is used which is not intended: target_user = DiscordUser.get(id=user_id) |
Yes, sorry. I googled my error and fell here. It's an issue with Peewee. |
face the same question , when I run my web application with peewee after 8 hours , it throw out" err.InterfaceError(0, "")" error |
I am encountering this exception (using high-level api) then my asyncio based daemon is idle (about 15 minutes or so), after that time, this exception occurs, I have tried to close and reopen connection, and was surprised that Manager (high-level api) did not track its state (close/reopen is done using its methods).
after reopening a connection I've got stuck with a bunch of coroutines waiting for resolution which obviously will never come. =(
any thoughts on how to fix that?
The text was updated successfully, but these errors were encountered: