[Bug 2047155] Re: "Could not create socket" with apt update when update libc6 to 2.35-0ubuntu3.5 and using nscd
James Dingwall
2047155 at bugs.launchpad.net
Mon Jan 1 21:25:38 UTC 2024
Here is a short test program which demonstrates behaviour with/without
nscd:
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <arpa/inet.h>
extern
int main(int argc, char *argv[])
{
struct addrinfo hints;
struct addrinfo *rp, *result;
struct sockaddr *sa;
int rc;
char s[INET6_ADDRSTRLEN];
size_t slen = sizeof(s);
memset(&hints, 0, sizeof(hints));
switch(atoi(argv[1])) {
case 4:
hints.ai_family = AF_INET;
break;
case 6:
hints.ai_family = AF_INET6;
break;
default:
hints.ai_family = AF_UNSPEC;
break;
}
rc = getaddrinfo(argv[2], NULL, &hints, &result);
if(rc) {
fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rc));
exit(EXIT_FAILURE);
}
for (rp = result; rp != NULL; rp = rp->ai_next) {
sa = rp->ai_addr;
switch(sa->sa_family) {
case AF_INET:
inet_ntop(AF_INET, &(((struct sockaddr_in *)sa)->sin_addr), s, slen);
fprintf(stderr, "result (IPv4): %s\n", s);
break;
case AF_INET6:
inet_ntop(AF_INET6, &(((struct sockaddr_in6 *)sa)->sin6_addr), s, slen);
fprintf(stderr, "result (IPv6): %s\n", s);
break;
default:
fprintf(stderr, "Unknown AF: %d\n", sa->sa_family);
break;
}
}
return 0;
}
nscd running:
$ ./a.out 0 ap1.example.com
result (IPv6): x:x:x:x::x:c
result (IPv6): x:x:x:x::x:c
result (IPv6): x:x:x:x::x:c
result (IPv4): x.x.x.12
result (IPv4): x.x.x.12
result (IPv4): x.x.x.12
$ ./a.out 4 ap1.example.com
result (IPv4): x.x.x.12
result (IPv4): x.x.x.12
result (IPv4): x.x.x.12
$ ./a.out 6 ap1.example.com
Unknown AF: 0
Unknown AF: 0
Unknown AF: 0
nscd not running:
$ ./a.out 0 ap1.example.com
result (IPv6): x:x:x:x::x:c
result (IPv6): x:x:x:x::x:c
result (IPv6): x:x:x:x::x:c
result (IPv4): x.x.x.12
result (IPv4): x.x.x.12
result (IPv4): x.x.x.12
$ ./a.out 4 ap1.example.com
result (IPv4): x.x.x.12
result (IPv4): x.x.x.12
result (IPv4): x.x.x.12
$ ./a.out 6 ap1.example.com
result (IPv6): x:x:x:x::x:c
result (IPv6): x:x:x:x::x:c
result (IPv6): x:x:x:x::x:c
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/2047155
Title:
"Could not create socket" with apt update when update libc6 to
2.35-0ubuntu3.5 and using nscd
Status in glibc package in Ubuntu:
Confirmed
Bug description:
1) lsb_release -rd
Description: Ubuntu 22.04.3 LTS
Release: 22.04
2) apt-cache policy libc6
libc6:
Installed: 2.35-0ubuntu3.5
Candidate: 2.35-0ubuntu3.5
Version table:
*** 2.35-0ubuntu3.5 500
500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
500 http://archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages
100 /var/lib/dpkg/status
2.35-0ubuntu3 500
500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
3) apt-get update or apt update are successfully done.
4) Could not create a socket and failure command.
Error messages are followings.
$ sudo apt update
Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Err:5 http://archive.ubuntu.com/ubuntu jammy Release
Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol)
Err:6 http://archive.ubuntu.com/ubuntu jammy-updates Release
Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol)
Err:7 http://archive.ubuntu.com/ubuntu jammy-backports Release
Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol)
Err:8 http://archive.ubuntu.com/ubuntu jammy-security Release
Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol) Could not create a socket for (f=0 t=1 p=6) - socket (97: Address family not supported by protocol)
Reading package lists... Done
E: The repository 'http://archive.ubuntu.com/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu jammy-updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu jammy-backports Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://archive.ubuntu.com/ubuntu jammy-security Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
To reproduce
* Install OS
* Having only IPv6 interface
* Install nscd
* Upgrade libc6 to 2.35-0ubuntu3.5
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/2047155/+subscriptions
More information about the foundations-bugs
mailing list