Bug 1270434 - Cannot login to postgresql-94-rhel7 after creating postgresql with postgresql-persistent-template.json
Cannot login to postgresql-94-rhel7 after creating postgresql with postgresq...
Status: CLOSED NOTABUG
Product: Red Hat Software Collections
Classification: Red Hat
Component: rh-postgresql94-docker (Show other bugs)
rh-postgresql94
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Pavel Raiskup
wewang
:
Depends On:
Blocks: 1220712
  Show dependency treegraph
 
Reported: 2015-10-10 00:56 EDT by wewang
Modified: 2015-11-02 11:04 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-27 11:32:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description wewang 2015-10-10 00:56:08 EDT
Version-Release number of selected component (if applicable):
openshift v3.0.2.0-17-g701346b
kubernetes v1.1.0-alpha.0-1605-g44c91b1
rhscl/postgresql-94-rhel7      image-id:20a1960468dc

Description of problem:
Cannot login to  postgresql-94-rhel7 after creating postgresql with postgresql-persistent-template.json
How reproducible:
Always

Steps to Reproduce:
1. Setup nfs server
2. Create pv on master
3. Create a project
4. Create postgresql imagestream
5. create postgresql with postgresql-persistent-template.json(Note: change the imagestream namespace and name to your own project  in template)
$ oc process -f https://raw.githubusercontent.com/openshift/origin/master/examples/db-templates/postgresql-persistent-template.json | oc create -f -

6.  Check the start-up pod status
# oc get pods
NAME                 READY     STATUS    RESTARTS   AGE
postgresql-1-i66gv   1/1       Running   0          1m
# oc get pvc
NAME         LABELS                                         STATUS    VOLUME    AGE
postgresql   map[template:postgresql-persistent-template]   Bound     wangpv6   16m

7. Check db account
# oc env pod postgresql-1-i66gv --list
# pods postgresql-1-i66gv, container postgresql
POSTGRESQL_USER=userL7X
POSTGRESQL_PASSWORD=Qh7x3CY8WFyInC6Y
POSTGRESQL_DATABASE=sampledb

8. Access into postgresql pod and write some data
[root@dhcp-128-91 V3]# oc rsh postgresql-1-i66gv
bash-4.2$ psql -h postgresql-1-i66gv -U userL7X -d sampledb
psql: could not connect to server: Connection refused
    Is the server running on host "postgresql-1-i66gv" (10.1.1.162) and accepting
    TCP/IP connections on port 5432?

9.[root@dhcp-128-91 V3]# oc describe pod postgresql-1-i66gv
Name:                postgresql-1-i66gv
Namespace:            project6
Image(s):            registry.access.redhat.com/rhscl_beta/postgresql-94-rhel7:latest
Node:                openshift-137.lab.sjc.redhat.com/10.14.6.137
Labels:                deployment=postgresql-1,deploymentconfig=postgresql,name=postgresql
Status:                Running
Reason:                
Message:            
IP:                10.1.1.162
Replication Controllers:    postgresql-1 (1/1 replicas created)
Containers:
  postgresql:
    Image:        registry.access.redhat.com/rhscl_beta/postgresql-94-rhel7:latest
    State:        Running
      Started:        Sat, 10 Oct 2015 10:32:33 +0800
    Ready:        True
    Restart Count:    0
    Variables:
      POSTGRESQL_USER:        userL7X
      POSTGRESQL_PASSWORD:    Qh7x3CY8WFyInC6Y
      POSTGRESQL_DATABASE:    sampledb


Actual results:
8. Cannot login to postgresql successfully 


Expected results:
Connect to postgresql successfully 

-------------------------------------
Additional info:
Login to postgresql successfully  when creating postgresql with postgresql-ephemeral-template.json
Comment 2 Pavel Raiskup 2015-10-10 07:20:05 EDT
Sorry, I can't reproduce.  I'm able to connect to postgresql server
both from host and from image itself:

  $ docker run --rm -ti -e POSTGRESQL_USER=userL7X -e POSTGRESQL_PASSWORD=Qh7x3CY8WFyInC6Y -e POSTGRESQL_DATABASE=sampledb rcm-img-docker01.build.eng.bos.redhat.com:5001/rhscl/postgresql-94-rhel7:latest
  $ docker inspect --format '{{ .NetworkSettings.IPAddress }}' `docker ps -q`
  172.17.03
  $ psql -h 172.17.03 -U userL7X -d sampledb
  Password for user userL7X: 
  psql (9.4.4)
  Type "help" for help.

sampledb=>

  The same from container itself:
  $ docker exec -ti `docker ps -q` bash
  bash-4.2$ psql
  psql (9.4.4)
  Type "help" for help.
  
  postgres=#
Comment 3 Pavel Raiskup 2015-10-21 09:10:02 EDT
Ping, any news here, wewang?
Comment 4 Pavel Raiskup 2015-10-21 09:20:34 EDT
I've been told that this is blocker for OpenShift and that Ben could possibly
help here.  Do we have self-standing reproducer?
Comment 5 Ben Parees 2015-10-21 10:20:32 EDT
wewang, can you confirm that the mounted storage in the container (/var/lib/pgsql/data) is writable?  Is there any other interesting information in the pod logs?
Comment 6 Ben Parees 2015-10-21 11:50:50 EDT
I was able to run this successfully using a a non-NFS persistent volume (i followed this instead to create a persistent volume: https://github.com/openshift/postgresql/tree/master/examples/replica#deployment)

so i think the issue here is likely a permissions one, though i'm surprised the pod started at all if the permissions aren't correct.

wewang, please retest using the latest image and check if there is a permissions problem with the mounted storage.
Comment 7 wewang 2015-10-22 08:05:04 EDT
I will verify it tomorrow in ose, pls wait,thx
Comment 8 Pavel Raiskup 2015-10-23 05:47:14 EDT
(In reply to wewang from comment #7)
> I will verify it tomorrow in ose, pls wait,thx

Thanks!  Re-adding the needinfo back then.
Comment 10 wewang 2015-10-26 21:53:07 EDT
verified in ose_3.1
openshift v3.0.2.902
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4
etcd 2.1.2
Comment 11 Pavel Raiskup 2015-10-27 04:47:10 EDT
Isn't this rather notabug?  Or bad component (rh-postgresql94-docker)?
Because I'm not aware of any bug I fixed ... which could be VERIFIED.

Note You need to log in before you can comment on or make changes to this bug.