sympa-community / sympa

Sympa, Mailing List Management Software
https://www.sympa.community/sympa
GNU General Public License v2.0
249 stars 98 forks source link

wwsympa always returns HTTP status code 421 and empty page after update to 6.2.72 #1791

Closed bohrsty closed 2 months ago

bohrsty commented 9 months ago

I updated my sympa installation to version 6.2.72 and the web interface (wwsympa) stops working, it shows an empty page with HTTP status code 421 (Misdirected Request).

Version

sympa: 6.2.72 sympa-nginx: 6.2.72

Installation method

rpm (fedora 36, but same behavior after upgrade to fedora 38) wwsympa uses "virtual domain settings" with robot.conf

Expected behavior

Show the wwsympa web interface after opening the url.

Actual behavior

Empty page with HTTP status code 421 after opening the url.

Steps to reproduce

Opening the url (after upgrade from 6.2.70 to 6.2.72)

Additional information

The nginx log only shows the request and the status code 421:

<IPv6 address> - - [18/Jan/2024:21:57:44 +0100] "GET /sympa/info/info-ls HTTP/1.1" 421 11 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0"

With log_level 3 sympa.log shows these entries during request and nothing more:

Jan 18 21:32:05 lists wwsympa[2199]: debug2 Sympa::List::get_robots()
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: ORIG_PATH_INFO=
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: ORIG_SCRIPT_NAME=
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: PATH_INFO=/info/info-ls
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: QUERY_STRING=
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: REMOTE_ADDR=`<IPv6 address>
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: REMOTE_HOST=
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: REQUEST_METHOD=GET
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: SCRIPT_NAME=/sympa
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: SERVER_NAME=<server name>
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: SERVER_PORT=443
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: SYMPA_DOMAIN=
Jan 18 21:32:05 lists wwsympa[2199]: debug2 Sympa::List::get_robots()
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: ORIG_PATH_INFO=
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: ORIG_SCRIPT_NAME=
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: PATH_INFO=/info/info-ls
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: QUERY_STRING=
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: REMOTE_ADDR=`<IPv6 address>
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: REMOTE_HOST=
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: REQUEST_METHOD=GET
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: SCRIPT_NAME=/sympa
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: SERVER_NAME=<server name>
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: SERVER_PORT=443
Jan 18 21:32:05 lists wwsympa[2199]: debug main:: SYMPA_DOMAIN=
ikedas commented 9 months ago

Hi @bohrsty , Could you please show the settings of nginx and Smpa?

bohrsty commented 9 months ago

Sure: nginx/sympa.conf:

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name lists.bohrs.net judo.bohrs.net;

    access_log /var/log/nginx/sympa_ssl_access.log;

    ssl_certificate /etc/letsencrypt/lists.bohrs.net/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/lists.bohrs.net/key.pem;

    location / {
#        return 301 https://$host/sympa;
        root /var/www/judo.bohrs.net;
    }

    location /sympa {
        include       /etc/nginx/fastcgi_params;
        fastcgi_pass  unix:/run/sympa/wwsympa.socket;

        # If you changed wwsympa_url in sympa.conf, change this regex too!
        fastcgi_split_path_info ^(/sympa)(.*)$;
        fastcgi_param SCRIPT_FILENAME /usr/libexec/sympa/wwsympa.fcgi;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }

    location /static-sympa/css {
        alias /var/lib/sympa/css;
    }
    location /static-sympa/pictures {
        alias /var/lib/sympa/pictures;
    }
    location /static-sympa {
        alias /usr/share/sympa/static_content;
    }
}

sympa.conf:

########################################################################
# Initial configuration
# See https://sympa-community.github.io/manual/install/generate-initial-configuration.html
########################################################################

domain              judo.bohrs.net
listmaster          <secret>
lang                de

########################################################################
# Setup database
# See https://sympa-community.github.io/manual/install/setup-database.html
########################################################################

db_type             MySQL
db_name             sympa
db_host             localhost
#db_port
db_user             sympa
db_passwd           <secret>
#db_env

########################################################################
# Configure system log
# See https://sympa-community.github.io/manual/install/configure-system-log.html
########################################################################

#syslog              LOCAL1 
#log_socket_type     unix

########################################################################
# Configure mail server
# See https://sympa-community.github.io/manual/install/configure-mail-server.html
########################################################################

sendmail_aliases    /etc/sympa/sympa_transport
aliases_program     postmap
aliases_db_type     hash
#sendmail            /usr/sbin/sendmail
#sendmail_args       (if you use sendmail(1), this need not change)

########################################################################
# Configure HTTP server
# See https://sympa-community.github.io/manual/install/configure-http-server.html
########################################################################

#mhonarc             /usr/bin/mhonarc
#log_facility        LOCAL1

# If you chose single domain setting, you may have to define following
# parameters in this sympa.conf file.  Otherwise, if you chose virtual
# domain setting (recommended), you should define them in robot.conf by
# each domain.

#wwsympa_url         (You must define this parameter to enable web interface)

########################################################################
# Customizing Sympa
# You can customize Sympa, its web interface and/or SOAP/HTTP service
# defining more parameters in this file sympa.conf or robot.conf by each
# domain.
# For more details see https://sympa-community.github.io/manual/customize.html
########################################################################

robot.conf:

wwsympa_url     https://judo.bohrs.net/sympa
title           BFV LS - Mailservice
gecos           BFV LS Mailservice

Are these sufficient, or do you need more?

But as far as I know, none of these configs changed during the update...

ikedas commented 9 months ago

What is the full path of robot.conf?

bohrsty commented 9 months ago

The path is /etc/sympa/judo.bohrs.net/robot.conf

ikedas commented 9 months ago
    server_name lists.bohrs.net judo.bohrs.net;

This line should be

    server_name judo.bohrs.net;

Or, if you want to use the both host names as Sympa's virtual hosts, insert this line just after incude line:

fastcgi_param SERVER_NAME $host;
bohrsty commented 9 months ago

Thank you so far, the webinterface works again after adding the suggested line...

But now all icons are not shown, they are only rectangles with the corresponding hex-codes in it (like F015)... I cannot see any errors in the browser console or errors loading any file in network-tab...Have you an idea, what causes this problem?

bohrsty commented 7 months ago

@ikedas any news about those icons?

ikedas commented 7 months ago

@bohrsty , how about removing location / { … }?

bohrsty commented 6 months ago

@ikedas, I've tried, but it doesn't change anything...

ikedas commented 6 months ago

@bohrsty , please see the documentation to configure HTTP server from scratch.

ikedas commented 2 months ago

The documentation has been updated. To handle multiple virtual hosts with one server section, insert a line as below:

server {
    ...
    server_name vhost1 vhost2...;
    ...
    location /sympa {
        include       fastcgi_params;
        fastcgi_param SERVER_NAME $host;  # <- Insert it
        fastcgi_pass  unix:$PIDDIR/wwsympa.socket;
    }
    ...
}
bohrsty commented 2 months ago

this line was already in my config, but the icons are actually shown correctly... I'm not sure since when exactly, because the server (and the web-ui) isn't used very frequently. I updated the server in july and there where minor updates for sympa and sympa-nginx included... maybe the config option and this update fixed the icons...

thank you for analysis and the fixes, I'll close this issue, because all my problems are fixed...