sympa-community / sympa

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

Error in SOAP with lists command #1682

Closed acasadoual closed 1 year ago

acasadoual commented 1 year ago

Version

6.2.72

Installation method

rpm EPEL

Expected behavior

135 'homepage=https://alboran.ual.es/sympa/info/profesores_master_ing_agronomica;subject=Profesores con docencia en master ingenier\xEDa agron\xF3mica;listAddress=profesores_master_ing_agronomica@lista.ual.es' 136 'homepage=https://alboran.ual.es/sympa/info/profesores_master_ing_industrial;subject=Profesores con docencia en master ingenier\xEDa industrial;listAddress=profesores_master_ing_industrial@lista.ual.es' 137 'homepage=https://alboran.ual.es/sympa/info/profesores_master_ing_quimica;subject=Profesores con docencia en master ingenier\xEDa qu\xEDmica;listAddress=profesores_master_ing_quimica@lista.ual.es'

Actual behavior

135 "\x{00ed}" does not map to utf8 at /usr/share/sympa/lib/Sympa/CLI/test/soap.pm line 280. "\x{00f3}" does not map to utf8 at /usr/share/sympa/lib/Sympa/CLI/test/soap.pm line 280. 'homepage=https://alboran.ual.es/sympa/info/profesores_master_ing_agronomica;subject=Profesores con docencia en master ingenier\xEDa agron\xF3mica;listAddress=profesores_master_ing_agronomica@lista.ual.es' 136 "\x{00ed}" does not map to utf8 at /usr/share/sympa/lib/Sympa/CLI/test/soap.pm line 280. 'homepage=https://alboran.ual.es/sympa/info/profesores_master_ing_industrial;subject=Profesores con docencia en master ingenier\xEDa industrial;listAddress=profesores_master_ing_industrial@lista.ual.es' 137 "\x{00ed}" does not map to utf8 at /usr/share/sympa/lib/Sympa/CLI/test/soap.pm line 280. "\x{00ed}" does not map to utf8 at /usr/share/sympa/lib/Sympa/CLI/test/soap.pm line 280. 'homepage=https://alboran.ual.es/sympa/info/profesores_master_ing_quimica;subject=Profesores con docencia en master ingenier\xEDa qu\xEDmica;listAddress=profesores_master_ing_quimica@lista.ual.es'

Steps to reproduce

sympa test soap --trusted_application=abc --trusted_application_password='abcpass' --service=lists --proxy_vars='USER_EMAIL=foo@ual.es' --service_parameters='obligatoria' https://bar.foo.es/sympasoap

Additional information

In 6.2.70 no error.

acasadoual commented 1 year ago

which works BAD (same results) complexLists works OK info works OK complexWhich works OK amI works OK review works OK subscribe works OK signoff works OK add works OK del works OK

ikedas commented 1 year ago

Hi @acasadoual , Have you applied any patches to Sympa 6.2.72? If you have, revert it and check if the problem is regenerated.

acasadoual commented 1 year ago

I'm late, sorry I'm not applied any patches.

ikedas commented 1 year ago

All right. Could you please show the lines around /usr/share/sympa/lib/Sympa/CLI/test/soap.pm line 280?

acasadoual commented 1 year ago

Hi @ikedas

274 # Dump a variable's content
275 # Old name: Sympa::Tools::Data::dump_var().
276 sub _dump_var {
277     my $var = shift;
278     my $level = shift || 0;
279
280     if (ref $var eq 'ARRAY') {
281         foreach my $index (0 .. $#{$var}) {
282             printf "%s%d\n", "\t" x $level, $index;
283             _dump_var($var->[$index], $level + 1);
284         }
285     } elsif (ref $var eq 'HASH') {
286         foreach my $key (sort keys %{$var}) {
287             printf "%s_%s_\n", "\t" x $level, $key;
288             _dump_var($var->{$key}, $level + 1);
289         }
290     } elsif (ref $var) {
291         printf "%s'%s'\n", "\t" x $level, ref $var;
292     } elsif (defined $var) {
293         printf "%s'%s'\n", "\t" x $level, $var;
294     } else {
295         printf "%sUNDEF\n", "\t" x $level;
296     }
297 }
298
299 1;
300 __END__
ikedas commented 1 year ago
280     if (ref $var eq 'ARRAY') {

It is unlikely that a warning like the one you reported would be issued on this line. Assuming you are not looking at a different source code than what is actually working, I have no idea what is causing this problem.

acasadoual commented 1 year ago

In Sympa 6.2.70 no error with:

# /usr/share/sympa/bin/sympa_soap_client.pl

with

# sympa test soap --trusted_application=myapp --trusted_application_password='mypass' --service=lists --proxy_vars='USER_EMAIL=myuser@ual.es' https://mysoapserver

...
262
"\x{00c1}" does not map to utf8 at /usr/share/sympa/lib/Sympa/CLI/test/soap.pm line 280.
"\x{00ed}" does not map to utf8 at /usr/share/sympa/lib/Sympa/CLI/test/soap.pm line 280.
"\x{00f3}" does not map to utf8 at /usr/share/sympa/lib/Sympa/CLI/test/soap.pm line 280.
        'homepage=https://alboran.ual.es/sympa/info/the;subject=**\xC1**rea Teor**\xED**a e Historia de la Educaci**\xF3**n;listAddress=the@lista.ual.es'
...

Each warning matches a utf8 character

This works ok:

# sympa test soap --trusted_application=myapp --trusted_application_password='mypass' --service=info --proxy_vars='USER_EMAIL=myuser@ual.es' --service_parameters='the' https://mysoapserver

0
        _homepage_
                'https://alboran.ual.es/sympa/info/the'
        _info_
                'Lista de distribución del área de Teoría e Historia de la Educación.
Suscripción cerrada.'
        _isOwner_
                '1'
        _listAddress_
                'the@lista.ual.es'
        _subject_
                'Área Teoría e Historia de la Educación'
acasadoual commented 1 year ago

Solution:

In /usr/share/sympa/lib/Sympa/WWW/Soap.pm 1528 # push @all, Encode::decode_utf8($k . '=' . $data->{$k}); 1529 push @all, $k . '=' . $data->{$k};

ikedas commented 1 year ago

This should be merged into #1541 . Let's continue there.

ikedas commented 1 year ago

It turned out that the problem about "not map to utf8" is the bug in XML-Parser CPAN module: https://github.com/toddr/XML-Parser/issues/30 .