Django errors after deleting a thread
After deleting a thread via the web interface (because it's spam), I get lots of messages from hyperkitty
E.g. Internal Server Error: /hyperkitty/list/list@domain/top-threads
DoesNotExist at /hyperkitty/list/list@domain/top-threads Thread matching query does not exist.
Request Method: GET Request URL: https://example.com/hyperkitty/list/list@domain/top-threads Django Version: 2.2.17 Python Executable: /usr/bin/uwsgi-core Python Version: 3.8.6 Python Path: ['.', '', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages'] Server time: Wed, 25 Nov 2020 07:12:00 +1100 Installed Applications: ('hyperkitty', 'postorius', 'django_mailman3', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'django_mailman3.middleware.TimezoneMiddleware', 'postorius.middleware.PostoriusMiddleware')
Traceback:
File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py" in inner 34. response = get_response(request)
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in _get_response 115. response = self.process_exception_by_middleware(e, request)
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in _get_response 113. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3/dist-packages/hyperkitty/lib/view_helpers.py" in inner 135. return func(request, *args, **kwargs)
File "/usr/lib/python3/dist-packages/hyperkitty/views/mlist.py" in overview_top_threads 220. 'threads': mlist.top_threads,
File "/usr/lib/python3/dist-packages/hyperkitty/models/mailinglist.py" in top_threads 168. return self.cached_values"top_threads"
File "/usr/lib/python3/dist-packages/hyperkitty/models/common.py" in __call__ 59. return self.get_or_set(*args, **kwargs)
File "/usr/lib/python3/dist-packages/hyperkitty/models/mailinglist.py" in get_or_set 376. return [Thread.objects.get(pk=pk) for pk in thread_ids]
File "/usr/lib/python3/dist-packages/hyperkitty/models/mailinglist.py" in <listcomp> 376. return [Thread.objects.get(pk=pk) for pk in thread_ids]
File "/usr/lib/python3/dist-packages/django/db/models/manager.py" in manager_method 82. return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/lib/python3/dist-packages/django/db/models/query.py" in get 406. raise self.model.DoesNotExist(
Exception Type: DoesNotExist at /hyperkitty/list/devel@sel4.systems/top-threads Exception Value: Thread matching query does not exist. Request information: USER: AnonymousUser
GET: No GET data
POST: No POST data
FILES: No FILES data
COOKIES: No cookie data
On 11/24/20 12:45 PM, peter@chubb.wattle.id.au wrote:
After deleting a thread via the web interface (because it's spam), I get lots of messages from hyperkitty
E.g. Internal Server Error: /hyperkitty/list/list@domain/top-threads
DoesNotExist at /hyperkitty/list/list@domain/top-threads Thread matching query does not exist.
This should resolve itself eventually if you are running the Django periodic jobs, but to fix it you can manually run
your_django_admin_command runjob recent_threads_cache
which is a daily job which refreshes the recent threads cache.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
"Mark" == Mark Sapiro <mark@msapiro.net> writes:
On 11/24/20 12:45 PM, peter@chubb.wattle.id.au wrote:
E.g. Internal Server Error: /hyperkitty/list/list@domain/top-threads
Mark> This should resolve itself eventually if you are running the Mark> Django periodic jobs, but to fix it you can manually run
Mark> your_django_admin_command runjob recent_threads_cache
Mark> which is a daily job which refreshes the recent threads cache.
That did it.
BTW thankyou *very* much for being so responsive on this mailing list. It's much appreciated.
Peter C
I manually run runjob: mailman-web runjob recent_threads_cache
but still error: ERROR 2022-07-01 08:32:58,941 16983 django.request Internal Server Error: /archives/list/cstnet@mailgroups.cstnet.cn/posted-to Traceback (most recent call last): File "/opt/mailman/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/opt/mailman/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 115, in _get_response response = self.process_exception_by_middleware(e, request) File "/opt/mailman/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/mailman/venv/lib/python3.10/site-packages/hyperkitty/lib/view_helpers.py", line 134, in inner return func(request, *args, **kwargs) File "/opt/mailman/venv/lib/python3.10/site-packages/hyperkitty/views/mlist.py", line 254, in overview_posted_to for thread in mlist.recent_threads: File "/opt/mailman/venv/lib/python3.10/site-packages/hyperkitty/models/mailinglist.py", line 160, in recent_threads return self.cached_values"recent_threads" File "/opt/mailman/venv/lib/python3.10/site-packages/hyperkitty/models/common.py", line 58, in __call__ return self.get_or_set(*args, **kwargs) File "/opt/mailman/venv/lib/python3.10/site-packages/hyperkitty/models/mailinglist.py", line 315, in get_or_set return [Thread.objects.get(pk=pk) for pk in thread_ids] File "/opt/mailman/venv/lib/python3.10/site-packages/hyperkitty/models/mailinglist.py", line 315, in <listcomp> return [Thread.objects.get(pk=pk) for pk in thread_ids] File "/opt/mailman/venv/lib/python3.10/site-packages/django/db/models/manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/opt/mailman/venv/lib/python3.10/site-packages/django/db/models/query.py", line 415, in get raise self.model.DoesNotExist( hyperkitty.models.thread.Thread.DoesNotExist: Thread matching query does not exist.
1、install memcached 2、pip install python-memcached [root@mailgroups ~]# su - mailman (venv) [mailman@mailman ~]$ pip install python-memcached 3、(venv) [mailman@mailman ~]$ vi /etc/mailman3/settings.py CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': '127.0.0.1:11211', } } (venv) [mailman@mailgroups ~]$ exit [root@mailgroups ~]# systemctl restart mailmanweb
participants (3)
-
Mark Sapiro
-
peter@chubb.wattle.id.au
-
rqchen@cnic.cn