Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#29297 closed Bug (invalid)

Exception ignored in: <generator object SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>

Reported by: kingctan Owned by: nobody
Component: Database layer (models, ORM) Version: 2.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

Exception ignored in: <generator object SQLCompiler.setup_query.<locals>.<genexpr> at 0x111aafe08>
Traceback (most recent call last):
  File "/Users/boyeestudio/Projects/OutSource/env3/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 39, in <genexpr>
    if all(self.query.alias_refcount[a] == 0 for a in self.query.alias_map):
SystemError: error return without exception set

Change History (8)

comment:1 by Tim Graham, 7 years ago

Component: UncategorizedDatabase layer (models, ORM)
Description: modified (diff)
Type: UncategorizedBug

What are the steps to reproduce the issue?

comment:2 by Tim Graham, 7 years ago

Description: modified (diff)
Resolution: needsinfo
Status: newclosed

comment:3 by Shaheed Haque, 7 years ago

Resolution: needsinfo
Status: closednew

I'm seeing the same issue with Django 2.0.5. Unfortunately, I'm not able to identify a precise cause, but it *might* be load related. Here is a scenario in which I see it:

  1. I have a moderately complex Django app (using amongst other things: Jinja templates, Celery, Viewflow, django-polymorphic)
  2. I run up the test suite. This includes django-webtest and selenium-based tests which (amongst other things) exercises both the admin and non-admin pages.
  3. I run the app under the PyCharm debug environment.
  4. Some - variable - number of the tests run clean in that the console records HTTP traffic as expected.
  5. After a while, I start to see some combination of the above exception and this one:
Exception ignored in: <generator object _salt_cipher_secret.<locals>.<genexpr> at 0x7f803ac785c8>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django/middleware/csrf.py", line 51, in <genexpr>
    pairs = zip((chars.index(x) for x in secret), (chars.index(x) for x in salt))
SystemError: error return without exception set
  1. The frequency of the exceptions seems to increase, and the responsiveness of Django decreases. For example, a 400s test run takes 800s.

If I rerun the tests without restarting Django, the exceptions start immediately. If I restart Django, the tests start clean again and slowly degrade as before. It *is* possible that there is some memory pressure on my Ubuntu Bionic system, but top rarely shows less than abut 800MB free, with about 2GB in buffer cache so this might be a red herring.

FWIW, the problem is also present in 2.0.2.

comment:4 by Simon Charette, 7 years ago

Resolution: needsinfo
Status: newclosed

Hello Shaheed,

Unfortunately I'm afraid there isn't much we can do as nothing seems to indicate Django is the culprit. We'd need a simplified and reproducible test case to figure out whether or not it's something that should be fixed in Django and not in order of the many libraries your are using.

Errors like SystemError('error return without exception set') are usually raised when an issue happens internally in C land (CPython, C library interfaced with Python bindings) which support the thesis that it has little to do with Django.

From the SystemError's documentation

Raised when the interpreter finds an internal error, but the situation does not look so serious to cause it to abandon all hope. The associated value is a string indicating what went wrong (in low-level terms).

You should report this to the author or maintainer of your Python interpreter. Be sure to report the version of the Python interpreter (sys.version; it is also printed at the start of an interactive Python session), the exact error message (the exception’s associated value) and if possible the source of the program that triggered the error.

comment:5 by Shaheed Haque, 7 years ago

I see, thanks.

I've Google'd around, and see other references to the contract of the C API being broken. Sadly, I don't see any obvious way to narrow down the culprit short of strace. Naturally, as soon as i turned on strace, I get no more errors. However, I also noticed, on what I guess from the paths quoted is a Mac rather than my Ubuntu system:

https://stackoverflow.com/questions/46039562/django-with-extend-database

with comments suggesting static files and other possible root causes. For me, this suggests some CPython package that is pulled in somewhat commonly with Django, but perhaps not always.

Last edited 7 years ago by Shaheed Haque (previous) (diff)

comment:6 by Shaheed Haque, 7 years ago

One observation is that when I run the server WITHOUT the PyCharm debugger, these errors seem not to occur. I filed https://youtrack.jetbrains.com/issue/PY-30036 with the PyCharm folk.

Last edited 7 years ago by Shaheed Haque (previous) (diff)

comment:7 by Rubi Mazaki, 6 years ago

Had the same issue too. I am accessing db through multiple threads (via APScheduler) and got the very same "ignored exception" as described above.

YET, Seems it is a PyCharm debugger issue. I followed the link given above: https://youtrack.jetbrains.com/issue/PY-30036

Setting the evironment variable PYDEVD_USE_FRAME_EVAL=NO to the debug configuration of pycharm Fixed It!

comment:8 by Tim Graham, 6 years ago

Resolution: needsinfoinvalid
Note: See TracTickets for help on using tickets.
Back to Top