New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed Server::url method (set) test when checking if a localhost regex matches #14

Open
kevinkjt2000 opened this Issue Dec 20, 2017 · 7 comments

Comments

Projects
None yet
5 participants
@kevinkjt2000

kevinkjt2000 commented Dec 20, 2017

I was trying to install the CPAN package as part of https://aur.archlinux.org/packages/perl-rpc-xml/ (which I need to compiler docker-git ultimately), but I ran into this error:

PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_load.t ..................... ok
t/10_data.t ..................... ok
t/11_base64_fh.t ................ ok
t/12_nil.t ...................... ok
t/13_no_deep_recursion.t ........ ok
t/14_datetime_iso8601.t ......... skipped: DateTime::Format::ISO8601 not available
t/15_serialize.t ................ ok
t/20_xml_parser.t ............... ok
t/21_xml_libxml.t ............... ok
t/25_parser_negative.t .......... ok
t/29_parserfactory.t ............ ok
t/30_procedure.t ................ ok
t/35_namespaces.t ............... ok
t/40_server.t ................... 16/91
#   Failed test 'RPC::XML::Server::url method (set)'
#   at t/40_server.t line 188.
#                   'http://[::1]:41259/'
#     doesn't match '(?^:http://(127[.]0[.]0[.]1|localhost|localhost[.]localdomain):41259)'
t/40_server.t ................... 35/91 Use of uninitialized value in subroutine entry at t/40_server.t line 276.
t/40_server.t ................... 41/91 Not an ARRAY reference at t/40_server.t line 333.
# Looks like your test exited with 255 just after 43.

I am not absolutely certain this is the correct repository to report this to, because perl package tests seem to fail often due to upstream changes from what little experience I have with CPAN.

@kevinkjt2000 kevinkjt2000 changed the title from Failed url method set test when checking if a localhost regex matches to Failed Server::url method (set) test when checking if a localhost regex matches Dec 20, 2017

@rjray

This comment has been minimized.

Show comment
Hide comment
@rjray

rjray Dec 20, 2017

Owner

(Dammit... that specific test (16) has caused me more headache than the whole remainder of the 40_server.t suite...)

Can you tell me your platform and Perl version that you're using? The initial test that fails (16) is just because I'm not IPv6-aware in the test. But the failures of 35 and 41 might be a bigger problem.

Owner

rjray commented Dec 20, 2017

(Dammit... that specific test (16) has caused me more headache than the whole remainder of the 40_server.t suite...)

Can you tell me your platform and Perl version that you're using? The initial test that fails (16) is just because I'm not IPv6-aware in the test. But the failures of 35 and 41 might be a bigger problem.

@rjray rjray self-assigned this Dec 20, 2017

@kevinkjt2000

This comment has been minimized.

Show comment
Hide comment
@kevinkjt2000

kevinkjt2000 Dec 21, 2017

Arch Linux 4.14.6-1-ARCH x86_64 GNU/Linux

This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux-thread-multi

Copyright 1987-2017, Larry Wall

kevinkjt2000 commented Dec 21, 2017

Arch Linux 4.14.6-1-ARCH x86_64 GNU/Linux

This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux-thread-multi

Copyright 1987-2017, Larry Wall

@rbtnx

This comment has been minimized.

Show comment
Hide comment
@rbtnx

rbtnx Dec 25, 2017

There seems to be a problem with the ipv6 loopback notation in /etc/hosts. When commented out the error does not occur (tested on my arch machine)

rbtnx commented Dec 25, 2017

There seems to be a problem with the ipv6 loopback notation in /etc/hosts. When commented out the error does not occur (tested on my arch machine)

@kevinkjt2000

This comment has been minimized.

Show comment
Hide comment
@kevinkjt2000

kevinkjt2000 Dec 28, 2017

What about checking if either localhost style regex matches or if http://search.cpan.org/~manu/Net-IP-1.25/IP.pm#ip_is_ipv4 or http://search.cpan.org/~manu/Net-IP-1.25/IP.pm#ip_is_ipv6 is true?

I suppose that much more than just validating string addresses is needed for IPv6 compatibility.

kevinkjt2000 commented Dec 28, 2017

What about checking if either localhost style regex matches or if http://search.cpan.org/~manu/Net-IP-1.25/IP.pm#ip_is_ipv4 or http://search.cpan.org/~manu/Net-IP-1.25/IP.pm#ip_is_ipv6 is true?

I suppose that much more than just validating string addresses is needed for IPv6 compatibility.

@rjray

This comment has been minimized.

Show comment
Hide comment
@rjray

rjray Dec 29, 2017

Owner

(Sorry, been on vacation and away from email)

Those are good suggestions. When I get some spare cycles I'll look at them.

Owner

rjray commented Dec 29, 2017

(Sorry, been on vacation and away from email)

Those are good suggestions. When I get some spare cycles I'll look at them.

@renyuneyun

This comment has been minimized.

Show comment
Hide comment
@renyuneyun

renyuneyun Feb 23, 2018

I hand-crafted a quick patch by adding the ipv6 loopback address to the @allhosts array but that doesn't solve the whole problem.

All I did is to change line 175 to

my @allhosts = ($local_ip, '\[::1\]', $localhostinfo[0], split q{ } => $localhostinfo[1]);

This reduces the first part of the error

t/40_server.t ................... 16/91
#   Failed test 'RPC::XML::Server::url method (set)'
#   at t/40_server.t line 188.
#                   'http://[::1]:41259/'
#     doesn't match '(?^:http://(127[.]0[.]0[.]1|localhost|localhost[.]localdomain):41259)'

but has nothing to do with the other parts.
It seems that the other parts of (at least) this file doesn't work correctly for ipv6 addresses (at least [::1]).

In the meantime, I also tried deleting the ipv6 line from /etc/hosts and this "solved" the problem.

renyuneyun commented Feb 23, 2018

I hand-crafted a quick patch by adding the ipv6 loopback address to the @allhosts array but that doesn't solve the whole problem.

All I did is to change line 175 to

my @allhosts = ($local_ip, '\[::1\]', $localhostinfo[0], split q{ } => $localhostinfo[1]);

This reduces the first part of the error

t/40_server.t ................... 16/91
#   Failed test 'RPC::XML::Server::url method (set)'
#   at t/40_server.t line 188.
#                   'http://[::1]:41259/'
#     doesn't match '(?^:http://(127[.]0[.]0[.]1|localhost|localhost[.]localdomain):41259)'

but has nothing to do with the other parts.
It seems that the other parts of (at least) this file doesn't work correctly for ipv6 addresses (at least [::1]).

In the meantime, I also tried deleting the ipv6 line from /etc/hosts and this "solved" the problem.

@Ongy

This comment has been minimized.

Show comment
Hide comment
@Ongy

Ongy Jul 13, 2018

@renyuneyun looking at your output, you didn't add it correctly. The doesn't match string there doesn't contain the ::1
And I don't think it needs the [] either, it should be a literal to compare to (like localhost)
I just ran into this today, disabling IPv6 on the lo device worked well, but it's not exactly optimal either

Ongy commented Jul 13, 2018

@renyuneyun looking at your output, you didn't add it correctly. The doesn't match string there doesn't contain the ::1
And I don't think it needs the [] either, it should be a literal to compare to (like localhost)
I just ran into this today, disabling IPv6 on the lo device worked well, but it's not exactly optimal either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment