Bug 1380805 - Postgresql pod is error when using persistent storage
Summary: Postgresql pod is error when using persistent storage
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Bradley Childs
QA Contact: Jianwei Hou
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-30 15:28 UTC by Christian Hernandez
Modified: 2016-10-10 12:52 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-10-10 12:52:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Christian Hernandez 2016-09-30 15:28:01 UTC
Description of problem:

On 3.3 I'm trying to get a pgsql database up and running and I get the following error
---
waiting for server to start....FATAL:  data directory "/var/lib/pgsql/data/userdata" has wrong ownership
HINT:  The server must be started by the user that owns the data directory.
pg_ctl: could not start server
---

Version-Release number of selected component (if applicable):

[root@ose3-master ~]# oc version
oc v3.3.0.32
kubernetes v1.3.0+52492b4
features: Basic-Auth GSSAPI Kerberos SPNEGO


How reproducible:

Every time


Steps to Reproduce:
1. Create an NFS share

mkdir -m 777 /var/export/vol1/gogs-pgsql 

chown -R nfsnobody:nfsnobody /var/export/vol1/gogs-pgsql 

/var/export/vol1/gogs-pgsql *(rw,sync,all_squash)

exportfs -a

2. Create a pv of 1Gi with RWX,RWO

3. Run the following command

oc new-app --template=postgresql-persistent -p POSTGRESQL_USER=gogs,POSTGRESQL_PASSWORD=gogs,POSTGRESQL_DATABASE=gogs

Actual results:

Deployer Pod errors out

Expected results:

Running PGSQL pod with persistent storage

Additional info:

This doesn't work ~> https://access.redhat.com/solutions/2313231

Comment 1 Christian Hernandez 2016-09-30 15:46:16 UTC
Looks like I needed `root_squash` instead 

The article should list this  https://access.redhat.com/solutions/2313231

Comment 2 Jan Safranek 2016-10-07 12:38:53 UTC
I am not sure what's the bug here - you asked your NFS server to squash all users to nfsnobody and then you complain that PostgreSQL can't create/chown a directory as a user, because it's squashed to nfsnobody.

Yes, root_squash is much more appropriate here. I don't know who created the solution in our customer portal nor the blog post - it may work on GitLab, IMO it can't work for PostgreSQL.


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