Coder Social home page Coder Social logo

Comments (2)

KessoumML avatar KessoumML commented on August 15, 2024 1

Thank you for the quick response, much appreciated !
I have a model "Record" which differ from other models only on two things

  • Record inherit multiple abstract models
  • Record is not cached by cacheops
    The model definition is: class Record(ModelDiffMixin, ModelMixinFoo, ModelMixin1Bar, models.Model):
    The error happens when bootstrapping the project, the following is the full error trace log
[2023-05-17 14:08:06 +0200] [8] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/funcy/calc.py", line 59, in wrapper
    return memory[key]
KeyError: (<class 'entity.Record'>,)

During handling of the above exception, another exception occurred:


Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.9/site-packages/gunicorn/util.py", line 359, in import_app
    mod = importlib.import_module(module)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/code/creator/wsgi.py", line 18, in <module>
    application = StaticFilesHandler(get_wsgi_application())
  File "/usr/local/lib/python3.9/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
    django.setup(set_prefix=False)
  File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.9/site-packages/django/apps/registry.py", line 122, in populate
    app_config.ready()
  File "/usr/local/lib/python3.9/site-packages/cacheops/apps.py", line 11, in ready
    install_cacheops()
  File "/usr/local/lib/python3.9/site-packages/funcy/flow.py", line 258, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/cacheops/query.py", line 562, in install_cacheops
    if family_has_profile(model):
  File "/usr/local/lib/python3.9/site-packages/funcy/calc.py", line 62, in wrapper
    value = memory[key] = func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/cacheops/utils.py", line 34, in family_has_profile
    return any(model_profile, model_family(cls))
  File "/usr/local/lib/python3.9/site-packages/funcy/colls.py", line 207, in any
    return _any(xmap(pred, seq))
  File "/usr/local/lib/python3.9/site-packages/cacheops/conf.py", line 99, in model_profile
    assert not model._meta.abstract, "This should be handled by caller"
AssertionError: This should be handled by caller
[2023-05-17 14:08:06 +0200] [8] [INFO] Worker exiting (pid: 8)
[2023-05-17 14:08:06 +0200] [7] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/funcy/calc.py", line 59, in wrapper
    return memory[key]
KeyError: (<class 'entity.Record'>,)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.9/site-packages/gunicorn/util.py", line 359, in import_app
    mod = importlib.import_module(module)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/code/creator/wsgi.py", line 18, in <module>
    application = StaticFilesHandler(get_wsgi_application())
  File "/usr/local/lib/python3.9/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
    django.setup(set_prefix=False)
  File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.9/site-packages/django/apps/registry.py", line 122, in populate
    app_config.ready()
  File "/usr/local/lib/python3.9/site-packages/cacheops/apps.py", line 11, in ready
    install_cacheops()
  File "/usr/local/lib/python3.9/site-packages/funcy/flow.py", line 258, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/cacheops/query.py", line 562, in install_cacheops
    if family_has_profile(model):
  File "/usr/local/lib/python3.9/site-packages/funcy/calc.py", line 62, in wrapper
    value = memory[key] = func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/cacheops/utils.py", line 34, in family_has_profile
    return any(model_profile, model_family(cls))
  File "/usr/local/lib/python3.9/site-packages/funcy/colls.py", line 207, in any
    return _any(xmap(pred, seq))
  File "/usr/local/lib/python3.9/site-packages/cacheops/conf.py", line 99, in model_profile
    assert not model._meta.abstract, "This should be handled by caller"
AssertionError: This should be handled by caller
[2023-05-17 14:08:06 +0200] [7] [INFO] Worker exiting (pid: 7)
[2023-05-17 14:08:07 +0200] [1] [WARNING] Worker with pid 7 was terminated due to signal 15

from django-cacheops.

Suor avatar Suor commented on August 15, 2024

Second one is a dup of #449. BTW, one might not switch CACHEOPS_INSIDEOUT on an existing cache, it needs to be dropped. It may even corrupt your cache, which will result into similar messages with any settings.

One the first one. Can you say on which particular model is it failing?

from django-cacheops.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.