Bug 745534

Summary: zypper cannot fetch anything
Product: [openSUSE] openSUSE 12.2 Reporter: Jiri Slaby <jslaby>
Component: BasesystemAssignee: Cristian Rodríguez <crrodriguez>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: Creationn, crrodriguez, vcizek
Version: Factory   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: No
Marketing QA Status: --- IT Deployment: ---

Description Jiri Slaby 2012-02-07 09:25:34 UTC
Download (curl) error for 'http://download.opensuse.org/repositories/openSUSE:/Factory:/Contrib/standard/repodata/repomd.xml':
Error code: Unrecognized error
Error message: Failed initialization

Of course curl doesn't work:

# curl http://download.opensuse.org/repositories/openSUSE:/Factory:/Contrib/standard/repodata/repomd.xml
curl: (2) Failed initialization

Downgrade of libcurl to 7.22 solves the issue.
Comment 1 Cristian Rodríguez 2012-02-07 15:42:00 UTC
works for me... I have current factory installed... with curl-7.24.0-1.1.x86_64 ...
Comment 2 Vítězslav Čížek 2012-02-07 16:22:09 UTC
I am unable to reproduce it on Factory neither.

> rpm -q curl
curl-7.24.0-0.x86_64

> curl -s http://download.opensuse.org/repositories/openSUSE:/Factory:/Contrib/standard/repodata/repomd.xml | head -2
<?xml version="1.0" encoding="UTF-8"?>
<repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm" xmlns:suse="http://novell.com/package/metadata/suse/common">
Comment 3 Jiri Slaby 2012-02-07 16:26:31 UTC
OK, try with newer kernel. Curl does something weird:
recvfrom(4294967295, 0x7fff37299190, 513, 0, 0x7fff372993a0, 0x7fff3729918c) = -1 EBADF (Bad file descriptor)

It tries to receive from fd which is -1. Are there proper checks on open sockets in curl?

(Leaving apart that there is perhaps a bug in the kernel with respect to socket opens.)
Comment 4 Jiri Slaby 2012-02-07 16:31:03 UTC
It actually closes the socket and tries to read from that again:
recvfrom(3, "\3217\201\200\0\1\0\1\0\0\0\0\10download\10opensuse\3o"..., 513, 0,
 {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.0.2.3")}, [16])
= 67
close(3)                                = 0
recvfrom(4294967295, 0x7fff463609e0, 513, 0, 0x7fff46360bf0, 0x7fff463609dc) = -
1 EBADF (Bad file descriptor)

(In reply to comment #3)
> OK, try with newer kernel.

Nope, sorry. Try to disable that shit called ipv6... Using ipv6.disable=1 kernel parameter.
Comment 5 Vítězslav Čížek 2012-02-07 16:46:50 UTC
Yep, didn't work this time.
Comment 6 Cristian Rodríguez 2012-02-07 17:07:49 UTC
Got it, does not work with ipv6.disable=1 damnit.
Comment 7 Cristian Rodríguez 2012-02-07 17:16:15 UTC
recvfrom(3, "_\377\201\200\0\1\0\1\0\0\0\0\10download\10opensuse\3o"..., 513, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.0.2.3")}, [16]) = 55
recvfrom(3, "\247\246\201\200\0\1\0\1\0\0\0\0\10download\10opensuse\3o"..., 513, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("10.0.2.3")}, [16]) = 67 

It is apparently a regression in the async_ares backend, In trying a bisect now.
Comment 8 Vítězslav Čížek 2012-02-07 17:30:43 UTC
socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = -1 EAFNOSUPPORT (Address family not supported by protocol)
time(NULL)                              = 1328633620
<error output>

This looks like it tries to open an IPv6 socket,
which fails and curl immediately terminates.
Comment 9 Cristian Rodríguez 2012-02-07 17:47:01 UTC
cannot reproduce when running in 12.1 with glibc 2.14... will try with factory...
Comment 10 Cristian Rodríguez 2012-02-07 18:00:52 UTC
sigh, I'm getting an ICE in my factory vm...
Comment 11 Cristian Rodríguez 2012-02-07 21:00:24 UTC
(In reply to comment #0)
> Download (curl) error for
> 'http://download.opensuse.org/repositories/openSUSE:/Factory:/Contrib/standard/repodata/repomd.xml':
> Error code: Unrecognized error
> Error message: Failed initialization
> 
> Of course curl doesn't work:
> 
> # curl
> http://download.opensuse.org/repositories/openSUSE:/Factory:/Contrib/standard/repodata/repomd.xml
> curl: (2) Failed initialization
> 
> Downgrade of libcurl to 7.22 solves the issue.

Just cross-checking... you had a known-working factory installation before this update ?
Comment 12 Jiri Slaby 2012-02-07 21:16:31 UTC
(In reply to comment #11)
> Just cross-checking... you had a known-working factory installation before this
> update ?

Yes, this started happening yesterday.
Comment 13 Cristian Rodríguez 2012-02-07 21:20:45 UTC
Bisected to upstream commit 


9109cdec11ee5a19f132fd7bdf2e9ceefea4de41 is the first bad commit
commit 9109cdec11ee5a19f132fd7bdf2e9ceefea4de41
Author: Daniel Stenberg <daniel@haxx.se>
Date:   Mon Dec 5 10:58:38 2011 +0100

    Curl_socket: internal replacement for socket()
    
    Moved out into a separate function to work as a "generic" socket()
    replacement.

:040000 040000 e0da372e84bb0ef7b31fd40ba0193bf5e5ca686e 0c3f9b07f90ece45b95a32e1ad0800b89ef5077d M      lib
Comment 14 Cristian Rodríguez 2012-02-07 21:54:56 UTC
reported to upstream.
Comment 15 Bernhard Wiedemann 2012-02-08 01:00:10 UTC
This is an autogenerated message for OBS integration:
This bug (745534) was mentioned in
https://build.opensuse.org/request/show/103145 Factory / curl
Comment 16 Cristian Rodríguez 2012-02-08 01:17:58 UTC
It is a problem in the c-ares backend, workaround now in factory, or https://api.opensuse.org/build/devel:libraries:c_c++/openSUSE_Factory/x86_64/curl/libcurl4-7.24.0-71.2.x86_64.rpm for testing.
Comment 17 Jiri Slaby 2012-02-08 08:39:21 UTC
(In reply to comment #16)
> It is a problem in the c-ares backend, workaround now in factory, or
> https://api.opensuse.org/build/devel:libraries:c_c++/openSUSE_Factory/x86_64/curl/libcurl4-7.24.0-71.2.x86_64.rpm
> for testing.

Yes, this works. Thanks.
Comment 18 Cristian Rodríguez 2012-02-08 16:07:46 UTC
Reducing severity as an alternative code path can be taken, however will keep this bug open until the underlying issue is solved.
Comment 19 Ursan Marius Bogdan 2012-02-13 11:40:37 UTC
openSUSE 12.2 Milestone 1, 32 bits  OS. I have curl 7.24.0, Build Date  : Fri 03 Feb 2012 11:35:25 AM EET. 

I have used zypper to refresh repositories and installed packages; both operations went well.

Personally i disable IPV6 when the installer pops up the "network configuration" windows. 

As a proposal i suggest that IPV6 support to be disabled by default. Argument to this: the majority of users don`t have access to IPV6 capabilities or their ISP is not using IPV6 yet.
Comment 20 Jiri Slaby 2012-05-29 14:19:32 UTC
(In reply to comment #18)
> Reducing severity as an alternative code path can be taken, however will keep
> this bug open until the underlying issue is solved.

Any updates here? Can we close now?
Comment 21 Cristian Rodríguez 2012-05-29 17:13:06 UTC
Yes, curl will remain without c-ares support at least for now.