View Issue Details

IDProjectCategoryView StatusLast Update
0000359Pgpool-IIBugpublic2017-10-25 19:43
Reporterjplinux Assigned ToMuhammad Usama  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionno change required 
PlatformLinuxOSUbuntuOS Version14.04.5
Product Version3.6.6 
Summary0000359: invalid PCP packet, incorrect packet length, could not connect to pcp on port 9898
DescriptionHi Guys

Can anyone help me, please?

I am struggling to connect on pcp service using port 9898 but, I have got the below error:
psql -h localhost -U postgres -p 9898

psql: could not connect to server: Connection refused
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 9898?
FATAL: invalid PCP packet
DETAIL: incorrect packet length (2052)
FATAL: invalid PCP packet
DETAIL: incorrect packet length (21504)

Note: The postgres connection is working fine on port 5432 and pgpool on port 9999 as well.

I have tried the below solution without success:
sudo apt-get install libpgpool0
Reading package lists... Done
Building dependency tree
Reading state information... Done
libpgpool0 is already the newest version.

Here is my current configuration:

Ubuntu 14.04.5 LTS
Kernel 4.4.0-92-generic
PostgreSQL 9.4.11 64-bit
pgpool2 3.6.6-1.pgdg14.04+1 (installed via apt-get)

File /etc/pgpool2/pcp.conf:
# USERID:MD5PASSWD
postgres:md59df270eb52907fff723d9b8b7436113a

Note: I have used SELECT on postgres instead of pg_md5 because there is a bug that generates a wrong md5 password:
SELECT passwd FROM pg_shadow WHERE usename = 'postgres';

File /etc/postgresql/9.4/main/pg_hba.conf:
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5

File /etc/pgpool2/pool_hba.conf:
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
host all all 0.0.0.0/0 md5

File: /etc/pgpool2/pgpool.conf
# - pgpool Communication Manager Connection Settings -

pcp_listen_addresses = '*'
                                   # Host name or IP address for pcp process to listen on:
                                   # '*' for all, '' for no TCP/IP connections
                                   # (change requires restart)
pcp_port = 9898
                                   # Port number for pcp
                                   # (change requires restart)
pcp_socket_dir = '/var/run/postgresql'
                                   # Unix domain socket path for pcp
                                   # The Debian package defaults to
                                   # /var/run/postgresql
                                   # (change requires restart)
listen_backlog_multiplier = 2
                                   # Set the backlog parameter of listen(2) to
                                                                   # num_init_children * listen_backlog_multiplier.
                                   # (change requires restart)
serialize_accept = off
                                   # whether to serialize accept() call to avoid thundering herd problem
                                   # (change requires restart)

I have restarted the services but still without connection, any suggestion, please?
Tagscould not connect to pcp on port 9898, incorrect packet length, Ubuntu invalid PCP packet

Activities

Muhammad Usama

2017-10-24 22:05

developer   ~0001778

Only PCP utilities can connect on PCP port. You can't use PostgreSQL clients to communicate on PCP ports. btw why you want to connect to pcp port using psql client?

jplinux

2017-10-25 02:18

reporter   ~0001782

Well, that would explains a Lot! I just want to test the pcp connection...

jplinux

2017-10-25 02:31

reporter   ~0001783

Thanks Muhammad

My mistake, and now I have tested using the right tool:

pcp_node_count -h localhost -p 9898 -U postgres

This ticket can be closed

Issue History

Date Modified Username Field Change
2017-10-24 00:18 jplinux New Issue
2017-10-24 00:18 jplinux Tag Attached: could not connect to pcp on port 9898
2017-10-24 00:18 jplinux Tag Attached: incorrect packet length
2017-10-24 00:18 jplinux Tag Attached: Ubuntu invalid PCP packet
2017-10-24 22:05 Muhammad Usama Note Added: 0001778
2017-10-25 02:18 jplinux Note Added: 0001782
2017-10-25 02:31 jplinux Note Added: 0001783
2017-10-25 19:43 Muhammad Usama Assigned To => Muhammad Usama
2017-10-25 19:43 Muhammad Usama Status new => closed
2017-10-25 19:43 Muhammad Usama Resolution open => no change required