Custombuild ipv6 error on cronjob.

Richard G

Verified User
Joined
Jul 6, 2008
Messages
13,501
Location
Maastricht
I guess it's related to spamassassin.

/etc/cron.daily/custombuild:

Subroutine IO::Socket::INET6::sockaddr_in6 redefined at /usr/share/perl5/Exporter.pm line 67.
at /usr/share/perl5/IO/Socket/INET6.pm line 21

Now I found the same issue 2 years ago here, but it still isn't fixed completely:
http://forum.directadmin.com/showthread.php?t=43935&page=2

The solution was to install IO::Socket::INET6 via cpan and then remove the yum version:
yum remove perl-IO-Socket-INET6

However.... I can't remove the yum version since I just installed munin.

And installing the cpan version won't work because of various errors:
Code:
Building IO-Socket-INET6
  SHLOMIF/IO-Socket-INET6-2.72.tar.gz
  ./Build -- OK
Running Build test
t/blocking.t .............. 1/2 Can't call method "blocking" on an undefined value at t/blocking.t line 51.
# Looks like you planned 2 tests but ran 1.
# Looks like your test exited with 101 just after 1.
Use of uninitialized value $sock in <HANDLE> at t/blocking.t line 56.
readline() on unopened filehandle at t/blocking.t line 56.
t/blocking.t .............. Dubious, test returned 101 (wstat 25856, 0x6500)
Failed 1/2 subtests 
t/configure6.t ............ ok   
t/host6.t ................. 1/4 Can't call method "peerhost" on an undefined value at t/host6.t line 63.
Use of uninitialized value $sock in <HANDLE> at t/host6.t line 50.
readline() on unopened filehandle at t/host6.t line 50.
t/host6.t ................. Failed 3/4 subtests 
t/io_multihomed6.t ........ skipped: localhost does not resolve to both 127.0.0.1 and ::1
t/io_sock6.t .............. 11/20 Can't call method "sockport" on an undefined value at t/io_sock6.t line 190, <GEN4> line 2.
t/io_sock6.t .............. Dubious, test returned 99 (wstat 25344, 0x6300)
Failed 10/20 subtests 
t/io_udp6.t ............... ok   
t/listen_port_only.t ...... 1/1 
#   Failed test 'Client was initialised - connected.'
#   at t/listen_port_only.t line 41.
# Looks like you failed 1 test of 1.
t/listen_port_only.t ...... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 
t/pod-coverage.t .......... skipped: Test::Pod::Coverage 1.04 required for testing POD coverage
t/pod.t ................... skipped: Test::Pod 1.14 required for testing POD
t/style-trailing-space.t .. skipped: Test::TrailingSpace required for trailing space test.

Test Summary Report
-------------------
t/blocking.t            (Wstat: 25856 Tests: 1 Failed: 0)
  Non-zero exit status: 101
  Parse errors: Bad plan.  You planned 2 tests but ran 1.
t/host6.t               (Wstat: 0 Tests: 1 Failed: 0)
  Parse errors: Bad plan.  You planned 4 tests but ran 1.
t/io_sock6.t            (Wstat: 25344 Tests: 11 Failed: 1)
  Failed test:  10
  Non-zero exit status: 99
  Parse errors: Bad plan.  You planned 20 tests but ran 11.
t/listen_port_only.t    (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=10, Tests=22, 35 wallclock secs ( 0.04 usr  0.01 sys +  0.14 cusr  0.03 csys =  0.22 CPU)
Result: FAIL
Failed 4/10 test programs. 2/22 subtests failed.
  SHLOMIF/IO-Socket-INET6-2.72.tar.gz
  ./Build test -- NOT OK

Any idea's on how to fix this?
 
Oke I managed to solve the cpan issue by activating ipv6 again on the server (yeah I'm shaming myself now).

However, I still can't uninstall perl-IO-Socket-INET6 in any way.
 
I've found a workaround.

Since this was the error:
Subroutine IO::Socket::INET6::sockaddr_in6 redefined at /usr/share/perl5/Exporter.pm line 67.
at /usr/share/perl5/IO/Socket/INET6.pm line 21

I commented this complete section containing also line 21 from INET6.pm.

Code:
# IO::Socket and Socket already import stuff here - possibly AF_INET6
# and PF_INET6 so selectively import things from Socket6.
#use Socket6 (
#    qw(AI_PASSIVE inet_ntop inet_pton getaddrinfo
#    sockaddr_in6 unpack_sockaddr_in6_all pack_sockaddr_in6_all)
#);

Exporter.pm line 67 says this:
Code:
  # shortcut for the common case of no type character
  *{"$callpkg\::$_"} = \&{"$pkg\::$_"} foreach @_;

I don't know which line is wiser to comment (disable), maybe somebody can advise me.
 
Hmmm I found this:
https://rt.cpan.org/Public/Bug/Display.html?id=72769

which states that "it should be fixed in 2.69".
There was an included patch:
https://rt.cpan.org/Public/Ticket/Attachment/1004975/523704/IO-Socket-INET6-2.68-test-typo.patch

Code:
[COLOR=#000000]--- IO-Socket-INET6-2.68/t/io_multihomed6.t
[/COLOR]+++ IO-Socket-INET6-2.68/t/io_multihomed6.t
@@ -52,7 +52,7 @@
 # and PF_INET6 so selectively import things from Socket6.
 use Socket6 (
     qw(AI_PASSIVE getaddrinfo
[COLOR=#b22222]-    sockaddr_in6 unpack_sockaddr_in6_all pack_sockaddr_in6_all in6addr_any[/COLOR]
[COLOR=#008000]+    sockaddr_in6 unpack_sockaddr_in6 pack_sockaddr_in6_all in6addr_any[/COLOR]
     inet_ntop
     ) [COLOR=#000000] );[/COLOR]
which has very similar code to what you've commented out.
By basically swapping the red code to the green.. that may sort it out, but best to update to the newest version.

This is all info from 2011 though, so I'm not sure if it's even current or not.
You may even have a newer version than the patch is providing.
I've not run into this before, so I'm not too certain of the correct path to take on this.

Are you able to find out which version of IO-Socket-INET6 you are using at the moment? Might be near the top of the file.

John
 
I've read a lot of those things but not the fix or I did not understand it.

The Cpan version I'm using is already version 2.72 so it should be fixed already in that version.
I changed the line you pointed to, but then the same error is occuring again, seems there are also some other changes made somewhere, because the line above also looks different in 2.72 as you can see from the lines I posted.
So I've commented it again.

The odd thing is, from yum in Centos 6.x, it's IO-Socket-INET6 version 2.56 on yum and there is no upgrade present yet.

If it will cause no problems to leave the lines commented, I'm good with it too.
 
Hi Tristan.

Not I didn't. I needed it for Munin so I enabled ipv6 again like stated in post #3 and used the first edit mentioned in #4 to /usr/share/perl5/IO/Socket/INET6.pm as a workaround.
It's still working this way without issues, but it in fact it still is a workaround and no real solution.
 
Back
Top