no access to Postorius web pages after upgrade
Upgrading to MM3 3.39, Postorius 1.3.10, Hyperkitty, 1.3.8, Django-mailman3 1.3.11, and Mailman-web 0.0.8 in a venv all seemed to go OK. Mailman3 lists work as expected, and admins can log in via Django.
However, any attempt to reach lists, domains, users, etc. now returns a 404 Not Found error. All the Postorius stuff worked as expected before the upgrade.
In the nginx server logs, any Hyperkitty and Postorius URLs are now appended to /opt/www/roundcubemail, which is this web server's root directory but not the root for Mailman3 (I run Roundcubemail and MM3 on the same server; don't judge me :-).
Here is the nginx error, with obfuscation of client and server info:
2023/10/22 10:43:24 [error] 2264140#2264140: *135 "/opt/www/roundcubemail/postorius/domains/index.php" is not found (2: No such file or directory), client: 1.2.3.4, server: lists.example.com, request: "GET /postorius/domains/ HTTP/2.0", host: "lists.example.com", referrer: "https://lists.example.com/mailman3/listinfo"
And here are the relevant bits of the Nginx config. Again, this worked before the upgrade.
server {
listen 443 ssl http2; server_name lists.example.com; root /opt/www/roundcubemail;
# begin mailman3 stuff
location /static/ { alias /opt/mailman/web/static/; }
location /mailman3/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } location /archives/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } location /accounts/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr; } location /admin/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } location /mailman/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } location /user-profile/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; }
# end mailman3 stuff
}
Also, I'm not sure if it's relevant but after upgrading, the migrate command throws a warning like this:
(venv) mailman@mail10:~$ mailman-web migrate System check identified some issues:
WARNINGS: account.EmailAddress: (models.W036) MariaDB does not support unique constraints with conditions. HINT: A constraint won't be created. Silence this warning if you don't care about it. account.EmailAddress: (models.W043) MariaDB does not support indexes on expressions. HINT: An index won't be created. Silence this warning if you don't care about it. Operations to perform: Apply all migrations: account, admin, auth, contenttypes, django_mailman3, django_q, hyperkitty, postorius, sessions, sites, socialaccount Running migrations: No migrations to apply.
Thanks in advance for clues on getting all Postorius/Django links working again.
dn
On 10/22/23 10:53, David Newman wrote:
Upgrading to MM3 3.39, Postorius 1.3.10, Hyperkitty, 1.3.8, Django-mailman3 1.3.11, and Mailman-web 0.0.8 in a venv all seemed to go OK. Mailman3 lists work as expected, and admins can log in via Django.
However, any attempt to reach lists, domains, users, etc. now returns a 404 Not Found error. All the Postorius stuff worked as expected before the upgrade.
In the nginx server logs, any Hyperkitty and Postorius URLs are now appended to /opt/www/roundcubemail, which is this web server's root directory but not the root for Mailman3 (I run Roundcubemail and MM3 on the same server; don't judge me :-).
Here is the nginx error, with obfuscation of client and server info:
2023/10/22 10:43:24 [error] 2264140#2264140: *135 "/opt/www/roundcubemail/postorius/domains/index.php" is not found (2: No such file or directory), client: 1.2.3.4, server: lists.example.com, request: "GET /postorius/domains/ HTTP/2.0", host: "lists.example.com", referrer: "https://lists.example.com/mailman3/listinfo"
Here you are trying to get https://lists.example.com/postorius/domains/, but (see below)
And here are the relevant bits of the Nginx config. Again, this worked before the upgrade.
server {
listen 443 ssl http2; server_name lists.example.com; root /opt/www/roundcubemail;
# begin mailman3 stuff
location /static/ { alias /opt/mailman/web/static/; }
location /mailman3/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } location /archives/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } location /accounts/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr; } location /admin/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } location /mailman/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } location /user-profile/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; }
Above you have defined proxying for the paths beginning with /mailman3/, /archives/, /mailman/ and others, but not /postorius/ or /hyperkitty/.
Note that /mailman/ will get to Django, but probably won't work unless you have something like
path('mailman3/', include('postorius.urls')),
or possibly
re_path('mailman3?/', include('postorius.urls')),
in your urls.py (default mailman_web/urls.py)
Also, I'm not sure if it's relevant but after upgrading, the migrate command throws a warning like this:
(venv) mailman@mail10:~$ mailman-web migrate System check identified some issues:
WARNINGS: account.EmailAddress: (models.W036) MariaDB does not support unique constraints with conditions. HINT: A constraint won't be created. Silence this warning if you don't care about it. account.EmailAddress: (models.W043) MariaDB does not support indexes on expressions. HINT: An index won't be created. Silence this warning if you don't care about it. Operations to perform: Apply all migrations: account, admin, auth, contenttypes, django_mailman3, django_q, hyperkitty, postorius, sessions, sites, socialaccount Running migrations: No migrations to apply.
This is an issue with MariaDB and MySQL. It can result in more processing because of the lack of an index or possibly a database operation succeeding that should fail because of the unsupported constraint, but these shouldn't affect operation.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 10/22/23 2:16 PM, Mark Sapiro wrote:
Here is the nginx error, with obfuscation of client and server info:
2023/10/22 10:43:24 [error] 2264140#2264140: *135 "/opt/www/roundcubemail/postorius/domains/index.php" is not found (2: No such file or directory), client: 1.2.3.4, server: lists.example.com, request: "GET /postorius/domains/ HTTP/2.0", host: "lists.example.com", referrer: "https://lists.example.com/mailman3/listinfo"
Here you are trying to get https://lists.example.com/postorius/domains/, but (see below)
# begin mailman3 stuff
location /static/ { alias /opt/mailman/web/static/; }
location /mailman3/ { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; }
Above you have defined proxying for the paths beginning with /mailman3/, /archives/, /mailman/ and others, but not /postorius/ or /hyperkitty/.
Bingo. Adding location statements for hyperkitty and postorius and restarting Nginx cleared the issue.
Unclear why this ever worked before the upgrade. I don't remember monkeying with a urls.py file. Anyway, it works now. Thank you Mark!
(venv) mailman@mail10:~$ mailman-web migrate System check identified some issues:
WARNINGS: account.EmailAddress: (models.W036) MariaDB does not support unique constraints with conditions.
This is an issue with MariaDB and MySQL.
Thanks again. No issues here, but glad to see you previously raised this as a known issue.
dn
Mark Sapiro wrote:
Note that /mailman/ will get to Django, but probably won't work unless you have something like
path('mailman3/', include('postorius.urls')),
That should have said
path('mailman/', include('postorius.urls')),
in addition to
path('mailman3/', include('postorius.urls')),\
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
David Newman
-
Mark Sapiro