Help with Newbie error -- I think I deleted my server
I have recently installed mailman3 on a Debian system with Posftix and Dovecot. I did it directly and did not use the docker setup.
I managed to get it working to the point that I could send mail locally and outside my domain through mailman and log in as administrator.
I decided to add a domain, but noticed on the form that the server was called "example.com." Clearly, I thought, I missed a configuration item here.
I clicked on that, and it took me to a page where I could add servers. So, I added my real domain (libertyfp.org). It successfully added it, so I decided that I clearly didn't need "example.com" as a server, and deleted it using the same page.
Immediately, I got an "internal server error" and have now lost all web interfaces. I tried restarting the daemons and rebooting the box, to no avail.
The error message sent to my admin email is shown below.
So... I have a couple of questions:
- How can I set libertyfp.org as my server by use of a config file?
- Failing that, how do a add "example.com" back, since I no longer have the web interface?
I can't believe I did this. It took me a week to get this up and working, and I destroyed it in ten minutes after it was working.
Any help would be appreciated. I suppose reinstalling will go much more quickly, since I know the mistakes I made over the past few days, but I really don't want to do that...
Here's what it sends me:
DoesNotExist at /mailman3/lists/ Site matching query does not exist.
Request Method: GET Request URL: https://www.libertyfp.org/mailman3/lists/ Django Version: 3.0.14 Python Executable: /opt/mailman/venv/bin/uwsgi Python Version: 3.9.2 Python Path: ['/etc/mailman3/', '.', '', '/etc/mailman3', '/usr/lib/python39.zip', '/usr/lib/python3.9', '/usr/lib/python3.9/lib- dynload', '/opt/mailman/venv/lib/python3.9/site-packages'] Server time: Sat, 25 Dec 2021 04:14:00 +0000 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 (most recent call last): File "/opt/mailman/venv/lib/python3.9/site- packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/opt/mailman/venv/lib/python3.9/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.9/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.9/site- packages/postorius/views/list.py", line 978, in list_index return render(request, template, File "/opt/mailman/venv/lib/python3.9/site- packages/django/shortcuts.py", line 19, in render content = loader.render_to_string(template_name, context, request, using=using) File "/opt/mailman/venv/lib/python3.9/site- packages/django/template/loader.py", line 62, in render_to_string return template.render(context, request) File "/opt/mailman/venv/lib/python3.9/site- packages/django/template/backends/django.py", line 61, in render return self.template.render(context) File "/opt/mailman/venv/lib/python3.9/site- packages/django/template/base.py", line 169, in render with context.bind_template(self): File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__ return next(self.gen) File "/opt/mailman/venv/lib/python3.9/site- packages/django/template/context.py", line 246, in bind_template updates.update(processor(self.request)) File "/opt/mailman/venv/lib/python3.9/site- packages/django_mailman3/context_processors.py", line 32, in common context["site_name"] = get_current_site(request).name File "/opt/mailman/venv/lib/python3.9/site- packages/django/contrib/sites/shortcuts.py", line 13, in get_current_site return Site.objects.get_current(request) File "/opt/mailman/venv/lib/python3.9/site- packages/django/contrib/sites/models.py", line 58, in get_current return self._get_site_by_id(site_id) File "/opt/mailman/venv/lib/python3.9/site- packages/django/contrib/sites/models.py", line 30, in _get_site_by_id site = self.get(pk=site_id) File "/opt/mailman/venv/lib/python3.9/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.9/site- packages/django/db/models/query.py", line 415, in get raise self.model.DoesNotExist(
Exception Type: DoesNotExist at /mailman3/lists/ Exception Value: Site matching query does not exist. Request information: USER: AnonymousUser
GET: No GET data
POST: No POST data
FILES: No FILES data
COOKIES: csrftoken = 'qklMdfLOyqa1TWm0b8nEHMFVBLaa0CgU2DXhSywjpgZMTnCSTNA4MkD4lGLB6z5N'
META:
CSRF_COOKIE =
'qklMdfLOyqa1TWm0b8nEHMFVBLaa0CgU2DXhSywjpgZMTnCSTNA4MkD4lGLB6z5N'
CSRF_COOKIE_USED = True
HTTP_ACCEPT =
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image
/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9'
HTTP_ACCEPT_ENCODING = 'gzip, deflate, br'
HTTP_ACCEPT_LANGUAGE = 'en-US,en;q=0.9'
HTTP_CONNECTION = 'close'
HTTP_COOKIE =
'csrftoken=qklMdfLOyqa1TWm0b8nEHMFVBLaa0CgU2DXhSywjpgZMTnCSTNA4MkD4lGLB
6z5N'
HTTP_DNT = '1'
HTTP_HOST = 'www.libertyfp.org'
HTTP_SEC_FETCH_DEST = 'document'
HTTP_SEC_FETCH_MODE = 'navigate'
HTTP_SEC_FETCH_SITE = 'none'
HTTP_SEC_FETCH_USER = '?1'
HTTP_SEC_GPC = '1'
HTTP_UPGRADE_INSECURE_REQUESTS = '1'
HTTP_USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36'
HTTP_X_FORWARDED_FOR = '174.212.65.52'
HTTP_X_FORWARDED_HOST = 'www.libertyfp.org'
HTTP_X_FORWARDED_PROTO = 'https'
HTTP_X_FORWARDED_SERVER = 'www.libertyfp.org'
PATH_INFO = '/mailman3/lists/'
QUERY_STRING = ''
REMOTE_ADDR = '127.0.0.1'
REQUEST_METHOD = 'GET'
REQUEST_URI = '/mailman3/lists/'
SCRIPT_NAME = ''
SERVER_NAME = 'libertyfp.org'
SERVER_PORT = '8000'
SERVER_PROTOCOL = 'HTTP/1.0'
uwsgi.core = 0
uwsgi.node = b'libertyfp.org'
uwsgi.version = b'2.0.20'
wsgi.errors = <_io.TextIOWrapper name=2 mode='w' encoding='UTF-8'>
wsgi.file_wrapper = ''
wsgi.input =
Settings:
Using settings module settings
ABSOLUTE_URL_OVERRIDES = {}
ACCOUNT_AUTHENTICATION_METHOD = 'username_email'
ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'https'
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_EMAIL_VERIFICATION = 'mandatory'
ACCOUNT_UNIQUE_EMAIL = True
ADMINS = "(('Mailman Suite Admin', 'fp145@libertyfp.org'),)"
ALLOWED_HOSTS = ['localhost', 'www.libertyfp.org', 'libertyfp.org',
'mail.libertyfp.org', 'list.libertyfp.org', '127.0.0.1']
APPEND_SLASH = True
AUTHENTICATION_BACKENDS =
"('django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend')"
AUTH_PASSWORD_VALIDATORS = '********************'
AUTH_USER_MODEL = 'auth.User'
BASE_DIR = PosixPath('/opt/mailman/web')
CACHES = {'default': {'BACKEND':
'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS = 'default'
CACHE_MIDDLEWARE_KEY_PREFIX = '********************'
CACHE_MIDDLEWARE_SECONDS = 600
COMPRESSORS = {'css': 'compressor.css.CssCompressor', 'js':
'compressor.js.JsCompressor'}
COMPRESS_CACHEABLE_PRECOMPILERS = '()'
COMPRESS_CACHE_BACKEND = 'default'
COMPRESS_CACHE_KEY_FUNCTION = '********************'
COMPRESS_CLEAN_CSS_ARGUMENTS = ''
COMPRESS_CLEAN_CSS_BINARY = 'cleancss'
COMPRESS_CLOSURE_COMPILER_ARGUMENTS = ''
COMPRESS_CLOSURE_COMPILER_BINARY = 'java -jar compiler.jar'
COMPRESS_CSS_HASHING_METHOD = 'mtime'
COMPRESS_DATA_URI_MAX_SIZE = 1024
COMPRESS_DEBUG_TOGGLE = None
COMPRESS_ENABLED = True
COMPRESS_FILTERS = {'css':
['compressor.filters.css_default.CssAbsoluteFilter',
'compressor.filters.cssmin.rCSSMinFilter'], 'js':
['compressor.filters.jsmin.rJSMinFilter']}
COMPRESS_JINJA2_GET_ENVIRONMENT =
On 12/24/21 8:22 PM, William Oliver wrote:
I clicked on that, and it took me to a page where I could add servers. So, I added my real domain (libertyfp.org). It successfully added it, so I decided that I clearly didn't need "example.com" as a server, and deleted it using the same page.
Immediately, I got an "internal server error" and have now lost all web interfaces. I tried restarting the daemons and rebooting the box, to no avail.
You have to set SITE_ID in your Django settings to the correct value for your site. See https://docs.mailman3.org/en/latest/faq.html#the-domain-name-displayed-in-hy...
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Fri, 2021-12-24 at 21:12 -0800, Mark Sapiro wrote:
On 12/24/21 8:22 PM, William Oliver wrote:
I clicked on that, and it took me to a page where I could add servers. So, I added my real domain (libertyfp.org). It successfully added it, so I decided that I clearly didn't need "example.com" as a server, and deleted it using the same page.
Immediately, I got an "internal server error" and have now lost all web interfaces. I tried restarting the daemons and rebooting the box, to no avail.
You have to set SITE_ID in your Django settings to the correct value for your site. See https://docs.mailman3.org/en/latest/faq.html#the-domain-name-displayed-in-hy...
Joy! You are a lifesaver. I had to guess at the ID number, but "2" worked.
Just out of curiosity, if I could not have guessed a valid ID number and did not have the admin interface, how could I have figured out what site IDs were available?
Thanks.
billo
On 12/25/21 7:13 AM, William Oliver wrote:
Just out of curiosity, if I could not have guessed a valid ID number and did not have the admin interface, how could I have figured out what site IDs were available?
If Postorius is working, recent versions show the SITE_ID in the domains view. I.e. after you added your domain you could have noted the SITE_ID and made the change in settings before deleting the example.com domain.
In any case, the django_site table in Mailman's database has the information.
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Sat, 2021-12-25 at 10:19 -0800, Mark Sapiro wrote:
On 12/25/21 7:13 AM, William Oliver wrote:
Just out of curiosity, if I could not have guessed a valid ID number and did not have the admin interface, how could I have figured out what site IDs were available?
If Postorius is working, recent versions show the SITE_ID in the domains view. I.e. after you added your domain you could have noted the SITE_ID and made the change in settings before deleting the example.com domain.
In any case, the django_site table in Mailman's database has the information.
Thanks. Yep, I peeked at the database and there it was. That would probably been more efficient than randomly choosing numbers...
billo
participants (2)
-
Mark Sapiro
-
William Oliver