pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: lcj34@cornell.edu
Subject: BUG #15854: postgres wtih Docker: binding port fails with release greater than 9.6.13
Date: Sun, 16 Jun 2019 12:35:07 +0000
Message-ID: <15854-544de1495db7399b@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15854
Logged by:          Lynn Johnson
Email address:      lcj34@cornell.edu
PostgreSQL version: 11.3
Operating system:   CentOS 7.6.1810
Description:        

I am running Postgres in a docker, creating a container, mounting a
directory, binding a port.  The container comes up successfully and I can
run psql to enter.  But only for release 9.6.  When I pull postgres docker
image for anything greater than 9.6 (I tried with 10, 10.3, 11.3) the
binding fails.  here are specifics:

1.  pull docker images via the following (pulling both 9.6 and latest for
testing):
    docker pull postgres:latest  
    docker pull postgres:9.6.13

2.  Create a container with mount points for 9.6.13:
   docker run -i --detach --name lcj34__biohpc_phg_postgres_container -e
POSTGRES_PASSWORD=phgP0stgr3s -v
/workdir/lcj34/DockerPostgresTests_working/dockerDB_data/data:/var/lib/postgresql/data
-p 8010:5432 postgres:9.6

3.  Start the container from above:
   docker start lcj34__biohpc_phg_postgres_container

4.  enter with psql gives these results:
[lcj34@cbsubl01 DockerPostgresTests_working]$ psql -h localhost -p 8010 -U
postgres
Password for user postgres: 
psql (9.2.24, server 9.6.13)
WARNING: psql version 9.2, server version 9.6.
         Some psql features might not work.
Type "help" for help.

postgres=# \q

IT is successful. 

Remove the running container, start again  but use a postgres version later
than 9.6.  here I'm using "latest", pulled on June 16, 2019.  note the
commands below are identical to the example above except for the postgres
docker image used.

1.  Create container:
  docker run -i --detach --name lcj34__biohpc_phg_postgres_container -e
POSTGRES_PASSWORD=phgP0stgr3s -v
/workdir/lcj34/DockerPostgresTests_working/dockerDB_data/data:/var/lib/postgresql/data
-p 8010:5432 postgres:latest

2. Start container:
  docker start lcj34__biohpc_phg_postgres_container
3.  Try at connect with psql give this response:
[lcj34@cbsubl01 DockerPostgresTests_working]$ psql -h localhost -p 8010 -U
postgres
psql: could not connect to server: Connection refused
	Is the server running on host "localhost" (::1) and accepting
	TCP/IP connections on port 8010?
could not connect to server: Connection refused
	Is the server running on host "localhost" (127.0.0.1) and accepting
	TCP/IP connections on port 8010?
[lcj34@cbsubl01 DockerPostgresTests_working]$ 

Using net stat, I can see port 8010 was not bound:

[lcj34@cbsubl01 DockerPostgresTests_working]$ netstat -tulpn | grep LISTEN
(No info could be read for "-p": geteuid()=1719 but you should be root.)
tcp        0      0 0.0.0.0:5801            0.0.0.0:*               LISTEN  
   -                   
tcp        0      0 0.0.0.0:49258           0.0.0.0:*               LISTEN  
   -                   
tcp        0      0 0.0.0.0:5901            0.0.0.0:*               LISTEN  
   -                   
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN  
   -                   
tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN  
   -                   
tcp        0      0 0.0.0.0:6001            0.0.0.0:*               LISTEN  
   -                   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN  
   -                   
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN  
   -                   
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN  
   -                   
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN  
   -                   
tcp        0      0 127.0.0.1:6012          0.0.0.0:*               LISTEN  
   -                   
tcp        0      0 0.0.0.0:988             0.0.0.0:*               LISTEN  
   -                   
tcp        0      0 0.0.0.0:3071            0.0.0.0:*               LISTEN  
   -                   
tcp6       0      0 :::5801                 :::*                    LISTEN  
   -                   
tcp6       0      0 :::5901                 :::*                    LISTEN  
   -                   
tcp6       0      0 :::111                  :::*                    LISTEN  
   -                   
tcp6       0      0 :::6000                 :::*                    LISTEN  
   -                   
tcp6       0      0 :::6001                 :::*                    LISTEN  
   -                   
tcp6       0      0 :::22                   :::*                    LISTEN  
   -                   
tcp6       0      0 ::1:631                 :::*                    LISTEN  
   -                   
tcp6       0      0 ::1:25                  :::*                    LISTEN  
   -                   
tcp6       0      0 ::1:6010                :::*                    LISTEN  
   -                   
tcp6       0      0 ::1:6012                :::*                    LISTEN  
   -                   
[lcj34@cbsubl01 DockerPostgresTests_working]
   
I believe this is a postgres issue vs docker issue as the only change from
working to non-working is the postgres image from docker.  Or perhaps this
ticket should be against the post 9.6 postgres dockers.



view thread (5+ messages)  latest in thread

Message-ID: <15854-544de1495db7399b@postgresql.org>
Permalink:  ../15854-544de1495db7399b@postgresql.org/
Also on:    postgresql.org/message-id/15854-544de1495db7399b@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, lcj34@cornell.edu
  Subject: Re: BUG #15854: postgres wtih Docker: binding port fails with release greater than 9.6.13
  In-Reply-To: <15854-544de1495db7399b@postgresql.org>
  References: <15854-544de1495db7399b@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox