Question after upgrade to mm 3.2.3 and latest postorius
Hi all,
I have just upgraded to mailman 3.2.3. My installation is from the git sources and I use two different venv:s, one for the web part as I did not want to compile the web server plugin to a newer python version than 3.5, and one venv for the rest running python 3.7. Apart from some missing dependencies and some changes that affected the django config I just have two issues with postorius:
The index page with all lists is not sorted in any useful way although it is based on something as the order seems to be stable. Prior to the upgrade the lists were sorted in alphabetical order after list name which is a lot more usable for me as admin. If I click the link at the bottom with "click to view all lists" I get the old behaviour.
The template menu simply does not work, it seems as if some database table is missing even after running migrations. Django logs the following:
ERROR 2019-08-11 20:58:55,038 exception 11837 139756347221760 Internal Server Error: /mailman3/lists/TESTLIST/templates Traceback (most recent call last): File "/...VENV3.5/lib/python3.5/site-packages/django/db/backends/utils.py", line 85, in _execute return self.cursor.execute(sql, params) psycopg2.errors.UndefinedTable: relation "postorius_emailtemplate" does not exist LINE 1: ...ext", "postorius_emailtemplate"."identifier" FROM "postorius..
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/...VENV3.5/lib/python3.5/site-packages/django/core/handlers/exception.py", line 35, in inner response = get_response(request) File "/...VENV3.5/lib/python3.5/site-packages/django/core/handlers/base.py", line 158, in _get_response response = self.process_exception_by_middleware(e, request) File "/...VENV3.5/lib/python3.5/site-packages/django/core/handlers/base.py", line 156, in _get_response response = response.render() File "/...VENV3.5/lib/python3.5/site-packages/django/template/response.py", line 106, in render self.content = self.rendered_content File "/...VENV3.5/lib/python3.5/site-packages/django/template/response.py", line 83, in rendered_content content = template.render(context, self._request) File "/...VENV3.5/lib/python3.5/site-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 175, in render return self._render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 167, in _render return self.nodelist.render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 943, in render bit = node.render_annotated(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 910, in render_annotated return self.render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/loader_tags.py", line 155, in render return compiled_parent._render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 167, in _render return self.nodelist.render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 943, in render bit = node.render_annotated(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 910, in render_annotated return self.render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/loader_tags.py", line 67, in render result = block.nodelist.render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 943, in render bit = node.render_annotated(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 910, in render_annotated return self.render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/defaulttags.py", line 313, in render if match: File "/...VENV3.5/lib/python3.5/site-packages/django/db/models/query.py", line 276, in __bool__ self._fetch_all() File "/...VENV3.5/lib/python3.5/site-packages/django/db/models/query.py", line 1179, in _fetch_all self._result_cache = list(self._iterable_class(self)) File "/...VENV3.5/lib/python3.5/site-packages/django/db/models/query.py", line 54, in __iter__ results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) File "/...VENV3.5/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 1063, in execute_sql cursor.execute(sql, params) File "/...VENV3.5/lib/python3.5/site-packages/django/db/backends/utils.py", line 68, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/...VENV3.5/lib/python3.5/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers return executor(sql, params, many, context) File "/...VENV3.5/lib/python3.5/site-packages/django/db/backends/utils.py", line 85, in _execute return self.cursor.execute(sql, params) File "/...VENV3.5/lib/python3.5/site-packages/django/db/utils.py", line 89, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/...VENV3.5/lib/python3.5/site-packages/django/db/backends/utils.py", line 85, in _execute return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: relation "postorius_emailtemplate" does not exist LINE 1: ...ext", "postorius_emailtemplate"."identifier" FROM "postorius...
Cheers // David
On Sun, Aug 11, 2019, at 12:43 PM, David Krantz wrote:
Hi all,
I have just upgraded to mailman 3.2.3. My installation is from the git sources and I use two different venv:s, one for the web part as I did not want to compile the web server plugin to a newer python version than 3.5, and one venv for the rest running python 3.7. Apart from some missing dependencies and some changes that affected the django config I just have two issues with postorius:
I would recommend that you bump up to 3.7 for the web part too, mostly because 3.5 is now has been in security maintenance state for a while. We will drop support for 3.5 after this next release (so you do have some time :), but I fear there *could* potentially be other dependent libraries who might have dropped 3.5 support.
Even though we do run CI and we'd (hopefully) know when there is a dependent library seriously breaking, but since we don't pin down versions, newer releases can cause problems.
The web-server plugin I assume is mod_wsgi?
If you use a separate wsgi server than the one embedded in web-server, you can bump versions a bit more easily. gunicorn or uwsgi are recommended options. Do note that the new version of Mailman Core also uses gunicorn now.
- The index page with all lists is not sorted in any useful way although it is based on something as the order seems to be stable. Prior to the upgrade the lists were sorted in alphabetical order after list name which is a lot more usable for me as admin. If I click the link at the bottom with "click to view all lists" I get the old behaviour.
This change was made so that you will see only the lists you are a member of either as a subscriber, moderator or owner. This is default when you are logged-in, but when logged-out, you will see the old view with all lists alphabetically sorted.
- The template menu simply does not work, it seems as if some database table is missing even after running migrations.
Are you sure the migrations are there? I can see the following list on the latest git master of Postorius (all the ones after 0004_ are related to emailtemplate):
$ python manage.py showmigrations
<snip>
postorius
[X] 0001_initial
[X] 0002_auto_20160210_0721
[X] 0003_drop_addressconfirmationprofile
[X] 0004_create_email_template
[X] 0005_auto_20180707_1107
[X] 0006_auto_20180711_1359
[X] 0007_auto_20180712_0536
[X] 0008_auto_20190310_0717
[X] 0009_auto_20190508_1604
<snip>
Django logs the following:
ERROR 2019-08-11 20:58:55,038 exception 11837 139756347221760 Internal Server Error: /mailman3/lists/TESTLIST/templates Traceback (most recent call last): File "/...VENV3.5/lib/python3.5/site-packages/django/db/backends/utils.py", line 85, in _execute return self.cursor.execute(sql, params) psycopg2.errors.UndefinedTable: relation "postorius_emailtemplate" does not exist LINE 1: ...ext", "postorius_emailtemplate"."identifier" FROM "postorius..
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/...VENV3.5/lib/python3.5/site-packages/django/core/handlers/exception.py", line 35, in inner response = get_response(request) File "/...VENV3.5/lib/python3.5/site-packages/django/core/handlers/base.py", line 158, in _get_response response = self.process_exception_by_middleware(e, request) File "/...VENV3.5/lib/python3.5/site-packages/django/core/handlers/base.py", line 156, in _get_response response = response.render() File "/...VENV3.5/lib/python3.5/site-packages/django/template/response.py", line 106, in render self.content = self.rendered_content File "/...VENV3.5/lib/python3.5/site-packages/django/template/response.py", line 83, in rendered_content content = template.render(context, self._request) File "/...VENV3.5/lib/python3.5/site-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 175, in render return self._render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 167, in _render return self.nodelist.render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 943, in render bit = node.render_annotated(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 910, in render_annotated return self.render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/loader_tags.py", line 155, in render return compiled_parent._render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 167, in _render return self.nodelist.render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 943, in render bit = node.render_annotated(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 910, in render_annotated return self.render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/loader_tags.py", line 67, in render result = block.nodelist.render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 943, in render bit = node.render_annotated(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/base.py", line 910, in render_annotated return self.render(context) File "/...VENV3.5/lib/python3.5/site-packages/django/template/defaulttags.py", line 313, in render if match: File "/...VENV3.5/lib/python3.5/site-packages/django/db/models/query.py", line 276, in __bool__ self._fetch_all() File "/...VENV3.5/lib/python3.5/site-packages/django/db/models/query.py", line 1179, in _fetch_all self._result_cache = list(self._iterable_class(self)) File "/...VENV3.5/lib/python3.5/site-packages/django/db/models/query.py", line 54, in __iter__ results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) File "/...VENV3.5/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 1063, in execute_sql cursor.execute(sql, params) File "/...VENV3.5/lib/python3.5/site-packages/django/db/backends/utils.py", line 68, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/...VENV3.5/lib/python3.5/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers return executor(sql, params, many, context) File "/...VENV3.5/lib/python3.5/site-packages/django/db/backends/utils.py", line 85, in _execute return self.cursor.execute(sql, params) File "/...VENV3.5/lib/python3.5/site-packages/django/db/utils.py", line 89, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/...VENV3.5/lib/python3.5/site-packages/django/db/backends/utils.py", line 85, in _execute return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: relation "postorius_emailtemplate" does not exist LINE 1: ...ext", "postorius_emailtemplate"."identifier" FROM "postorius...
Cheers // David
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- thanks, Abhilash Raj (maxking)
Thank you for your quick reply! Comments below.
On Sun, Aug 11, 2019 at 10:03 PM Abhilash Raj <maxking@asynchronous.in> wrote:
I would recommend that you bump up to 3.7 for the web part too, mostly because 3.5 is now has been in security maintenance state for a while. We will drop support for 3.5 after this next release (so you do have some time :), but I fear there *could* potentially be other dependent libraries who might have dropped 3.5 support.
Even though we do run CI and we'd (hopefully) know when there is a dependent library seriously breaking, but since we don't pin down versions, newer releases can cause problems.
The web-server plugin I assume is mod_wsgi?
Good information. Of course it is mod_wsgi.
If you use a separate wsgi server than the one embedded in web-server, you can bump versions a bit more easily. gunicorn or uwsgi are recommended options. Do note that the new version of Mailman Core also uses gunicorn now.
That might be simpler although I probably still will have to use apache as passthrough as there are other things on that server using port 443 (80) and yet another server running is not what I'd like even if wsgi is a server process anyway as I understand it. I'll consider that and change it.
- The index page with all lists is not sorted in any useful way
although it is based on something as the order seems to be stable. Prior to the upgrade the lists were sorted in alphabetical order after list name which is a lot more usable for me as admin. If I click the link at the bottom with "click to view all lists" I get the old behaviour.
This change was made so that you will see only the lists you are a member of either as a subscriber, moderator or owner. This is default when you are logged-in, but when logged-out, you will see the old view with all lists alphabetically sorted.
That is very good. It still is strange that this view is not sorted.
Are you sure the migrations are there? I can see the following list on the latest git master of Postorius (all the ones after 0004_ are related to emailtemplate):
I thought so, but it seems as if they are not. That said I have not used django for anything else. After setting up the django-admin-script and modifying a few paths I got it to work correctly. The run I had made did not work although it also failed silently. Had I been used to django I'd known that it should print "OK" and ticked boxes for performed migrations, but I just use django for mailman-things.
So now it works. Great.
Thanks! // David
On Sun, Aug 11, 2019, at 2:49 PM, David Krantz wrote:
Thank you for your quick reply! Comments below.
On Sun, Aug 11, 2019 at 10:03 PM Abhilash Raj <maxking@asynchronous.in> wrote:
I would recommend that you bump up to 3.7 for the web part too, mostly because 3.5 is now has been in security maintenance state for a while. We will drop support for 3.5 after this next release (so you do have some time :), but I fear there *could* potentially be other dependent libraries who might have dropped 3.5 support.
Even though we do run CI and we'd (hopefully) know when there is a dependent library seriously breaking, but since we don't pin down versions, newer releases can cause problems.
The web-server plugin I assume is mod_wsgi?
Good information. Of course it is mod_wsgi.
If you use a separate wsgi server than the one embedded in web-server, you can bump versions a bit more easily. gunicorn or uwsgi are recommended options. Do note that the new version of Mailman Core also uses gunicorn now.
That might be simpler although I probably still will have to use apache as passthrough as there are other things on that server using port 443 (80) and yet another server running is not what I'd like even if wsgi is a server process anyway as I understand it. I'll consider that and change it.
Right, using a webserver for passthrough (and, serving static content) is actually recommended practice since they are more battle tested for security + load than wsgi servers.
We use gunicorn + nginx for running this very list.
- The index page with all lists is not sorted in any useful way
although it is based on something as the order seems to be stable. Prior to the upgrade the lists were sorted in alphabetical order after list name which is a lot more usable for me as admin. If I click the link at the bottom with "click to view all lists" I get the old behaviour.
This change was made so that you will see only the lists you are a member of either as a subscriber, moderator or owner. This is default when you are logged-in, but when logged-out, you will see the old view with all lists alphabetically sorted.
That is very good. It still is strange that this view is not sorted.
Noted, thanks! https://gitlab.com/mailman/postorius/issues/379
Are you sure the migrations are there? I can see the following list on the latest git master of Postorius (all the ones after 0004_ are related to emailtemplate):
I thought so, but it seems as if they are not. That said I have not used django for anything else. After setting up the django-admin-script and modifying a few paths I got it to work correctly. The run I had made did not work although it also failed silently. Had I been used to django I'd known that it should print "OK" and ticked boxes for performed migrations, but I just use django for mailman-things.
I would love to have some more time and sort out some minor annoyances with Django :(
This might be a great opportunity for someone with Django experience to help make it easier, I have some ideas there which should already be in the issue tracker.
-- thanks, Abhilash Raj (maxking)
David Krantz writes:
I have just upgraded to mailman 3.2.3. My installation is from the git sources and I use two different venv:s, one for the web part as I did not want to compile the web server plugin to a newer python version than 3.5,
I see elsewhere that this is mod_wsgi. I forget exactly what my story was, but I did recompile on Linux and it was straightforward.
Of course there are a million reasons why you might not want to do that. I just wanted to take this chance to report that for 3.6 and 3.7 this was very straightforward, in case anybody else is thinking about doing it.
participants (3)
-
Abhilash Raj
-
David Krantz
-
Stephen J. Turnbull