View Issue Details

IDProjectCategoryView StatusLast Update
0000202Pgpool-IIBugpublic2017-08-29 09:34
ReportershanmuAssigned Topengbo 
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionopen 
Platformpgpool-IIOSFreeBSDOS Version10.1
Product Version 
Target VersionFixed in Version 
Summary0000202: failed to create INET domain socket
DescriptionHi,

I have installed pgpool-II 3.5.2 in FreeBSD 10.1 from source and followed the procedure given in link http://www.pgpool.net/docs/latest/tutorial-en.html#install

after the configuration when I tried to start the pgpool it is giving below error.

root@otp3:~ # pgpool -n
2016-05-27 18:06:36: pid 3567: FATAL: failed to create INET domain socket
2016-05-27 18:06:36: pid 3567: DETAIL: getaddrinfo() failed: hostname nor servname provided, or not known
root@otp3:~ #

my /etc/rc.conf
hostname="otp3.blr.cherrylabs.in"
ifconfig_em0="inet 10.200.1.62 netmask 255.255.255.0"
defaultrouter="10.200.1.250"
sshd_enable="YES"
pgpool_user="pgpool"
pgpool_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
root@otp3:~ #

my /etc/hosts

::1 localhost otp3.blr.cherrylabs.in
127.0.0.1 localhost otp3.blr.cherrylabs.in
10.200.1.62 otp3.blr.cherrylabs.in
#

PLEASE HELP

Thanks
- Shanmu
TagsNo tags attached.

Activities

shanmu

2016-05-30 13:25

reporter   ~0000844

nor servname provided, or not known" is coming only if put listen_addresses = '*' in the /usr/local/etc/pgpool.conf.

In case of specific address this error is not coming and pgpool is starting...

I need the pgpool to listen in all the ports since the nodes are configured with cluster and has virtual IP.

Regards
Shanmu

shanmu

2016-06-09 15:19

reporter   ~0000853

Hi,

Any update please.

- Shanmu

henkeb

2016-06-10 03:25

reporter   ~0000854

A work-around is to set listen_addresses = '0.0.0.0', that works for me.

- Henrik

shanmu

2016-06-10 15:39

reporter   ~0000856

Hi Henrik,

Thanks.. work-around seems working.

- Shanmu

pengbo

2016-06-12 22:06

developer   ~0000857

Hi,
I changed the source code, that in case of '*' it will set the hostname to NULL.
I attached the patch file. Could you try it again?

pengbo

2016-06-12 22:07

developer  

diff.patch (559 bytes)
diff --git a/src/main/pgpool_main.c b/src/main/pgpool_main.c
index 017dc7a..a394dda 100644
--- a/src/main/pgpool_main.c
+++ b/src/main/pgpool_main.c
@@ -776,7 +776,7 @@ static int *create_inet_domain_sockets(const char *hostname, const int port)
 			errdetail("asprintf() failed: %s", strerror(errno))));
 	}
 
-	if ((ret = getaddrinfo(hostname, portstr, &hints, &res)) != 0)
+	if ((ret = getaddrinfo((!hostname || hostname[0] == '\0') ? NULL : hostname, portstr, &hints, &res)) != 0)
 	{
 		ereport(FATAL,
 			(errmsg("failed to create INET domain socket"),
diff.patch (559 bytes)

shanmu

2016-06-13 21:41

reporter   ~0000858

Hi,

Seems like i still have the problem after applying the patch.

root@tw1:~ # tail -f /var/log/pgpool.log
Jun 13 17:59:52 tw1 pgpool: 2016-06-13 17:59:51: pid 37829:LOG: child process received shutdown request signal 2
Jun 13 17:59:52 tw1 pgpool: 2016-06-13 17:59:49: pid 37745:LOG: child process received shutdown request signal 2
Jun 13 17:59:52 tw1 pgpool: 2016-06-13 17:59:51: pid 37793:LOG: child process received shutdown request signal 2
Jun 13 17:59:52 tw1 pgpool: 2016-06-13 17:59:50: pid 37802:LOG: child process received shutdown request signal 2
Jun 13 17:59:52 tw1 pgpool[37789]: [2-1] 2016-06-13 17:59:51: pid 37789:LOG: child process received shutdown request signal 2
Jun 13 17:59:52 tw1 pgpool: 2016-06-13 17:59:51: pid 37789:LOG: child process received shutdown request signal 2
Jun 13 17:59:52 tw1 pgpool[37838]: [1-1] 2016-06-13 17:59:49: pid 37838:LOG: stop request sent to pgpool. waiting for termination...
Jun 13 18:00:16 tw1 pgpool[37874]: [1-1] 2016-06-13 18:00:16: pid 37874:FATAL: failed to create INET domain socket
Jun 13 18:00:16 tw1 pgpool: 2016-06-13 18:00:16: pid 37874:FATAL: failed to create INET domain socket
Jun 13 18:00:39 tw1 pgpool[37877]: [1-1] 2016-06-13 18:00:39: pid 37877:FATAL: could not read pid file


My config file
====

# ----------------------------
# pgPool-II configuration file
# ----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# Whitespace may be used. Comments are introduced with "#" anywhere on a line.
# The complete list of parameter names and allowed values can be found in the
# pgPool-II documentation.
#
# This file is read on server startup and when the server receives a SIGHUP
# signal. If you edit the file on a running system, you have to SIGHUP the
# server for the changes to take effect, or use "pgpool reload". Some
# parameters, which are marked below, require a server shutdown and restart to
# take effect.
#


#------------------------------------------------------------------------------
# CONNECTIONS
#------------------------------------------------------------------------------

# - pgpool Connection Settings -

listen_addresses = '*'
#listen_addresses = 'localhost'
                                   # Host name or IP address to listen on:
                                   # '*' for all, '' for no TCP/IP connections
                                   # (change requires restart)
port = 5432

pengbo

2016-09-19 22:32

developer  

diff (566 bytes)
diff --git a/src/main/pgpool_main.c b/src/main/pgpool_main.c
index 3b1fa73..0b2a8f7 100644
--- a/src/main/pgpool_main.c
+++ b/src/main/pgpool_main.c
@@ -799,7 +799,7 @@ static int *create_inet_domain_sockets(const char *hostname, const int port)
 			errdetail("asprintf() failed: %s", strerror(errno))));
 	}
 
-	if ((ret = getaddrinfo(hostname, portstr, &hints, &res)) != 0)
+	if ((ret = getaddrinfo((!hostname || strcmp(hostname, "*") == 0) ? NULL : hostname, portstr, &hints, &res)) != 0)
 	{
 		ereport(FATAL,
 			(errmsg("failed to create INET domain socket"),
diff (566 bytes)

pengbo

2016-09-19 22:32

developer   ~0001071

I am sorry. It's late.
Could you try this patch file attached?

Issue History

Date Modified Username Field Change
2016-05-27 21:46 shanmu New Issue
2016-05-30 13:25 shanmu Note Added: 0000844
2016-06-03 11:29 pengbo Assigned To => pengbo
2016-06-03 11:29 pengbo Status new => assigned
2016-06-09 15:19 shanmu Note Added: 0000853
2016-06-10 03:25 henkeb Note Added: 0000854
2016-06-10 15:39 shanmu Note Added: 0000856
2016-06-12 22:06 pengbo Note Added: 0000857
2016-06-12 22:07 pengbo File Added: diff.patch
2016-06-13 10:28 pengbo Status assigned => feedback
2016-06-13 21:41 shanmu Note Added: 0000858
2016-06-13 21:41 shanmu Status feedback => assigned
2016-09-19 22:32 pengbo File Added: diff
2016-09-19 22:32 pengbo Note Added: 0001071
2017-08-29 09:34 pengbo Status assigned => closed