Bug 1123850 - Openshift overwrites data/postgresql.conf during restart, destroying Locale and Formatting configuration
Summary: Openshift overwrites data/postgresql.conf during restart, destroying Locale a...
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Jason DeTiberus
QA Contact: libra bugs
Depends On: 1123587
TreeView+ depends on / blocked
Reported: 2014-07-28 13:18 UTC by Brenton Leanhardt
Modified: 2014-11-03 19:54 UTC (History)
7 users (show)

Fixed In Version: openshift-origin-cartridge-postgresql-1.29.2-1.git.147.ef6cd67.el6op
Doc Type: Bug Fix
Doc Text:
Clone Of: 1123587
Last Closed: 2014-11-03 19:54:36 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2014:1796 normal SHIPPED_LIVE Moderate: Red Hat OpenShift Enterprise 2.2 Release Advisory 2014-11-04 00:52:02 UTC

Description Brenton Leanhardt 2014-07-28 13:18:10 UTC
+++ This bug was initially created as a clone of Bug #1123587 +++

Description of problem:

Openshift overwrites data/postgresql.conf file resetting all changes made to that file, whenever the database service is restarted, that is, when pushing changes or manually restarting the service via rhc.

Setting up datestyle and locale variables in the Locale and Formatting area is needed to run some applications correctly.

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


How reproducible:

Steps to Reproduce:
1. Create an application with a postgresql database. 
2. Modify datestyle and locale vars in data/postgresql.conf.
3. Restart the application or the database service.

Actual results:

Overwriting of data/postgresql.conf file

Expected results:

No overwriting of data/postgresql.conf or making those values configurable via environment value so that the regenerated conf file will contain the desired value. 

Additional info:

A related bug has been posted, referring the postgresql.conf file overwritting but focused on solving other variable set up at https://bugzilla.redhat.com/show_bug.cgi?id=1121727

A question has been opened on Stackoverflow: 

--- Additional comment from Michal Fojtik on 2014-07-28 05:00:16 EDT ---

Thanks for reporting this!

I don't think customizing the data/postgresql.conf is something we want to support or encourage users to do. If you want to set the local vars, we should allow this via the specialized env variables, like:


I'm going to fix this and I will update the bug with the actual variable name.

--- Additional comment from Michal Fojtik on 2014-07-28 05:41:21 EDT ---


--- Additional comment from openshift-github-bot on 2014-07-28 06:31:19 EDT ---

Commit pushed to master at https://github.com/openshift/origin-server

Bug 1123587 - Added OPENSHIFT_POSTGRESQL_LOCALE environment variable

Comment 1 Brenton Leanhardt 2014-08-01 12:48:56 UTC

Comment 2 Jason DeTiberus 2014-10-08 02:15:02 UTC

Comment 3 Gaoyun Pei 2014-10-08 06:31:26 UTC
Verify this bug with openshift-origin-cartridge-postgresql-1.29.2-1.git.147.ef6cd67.el6op.noarch

1. Create a php app with postgresql-9.2 embedded, check its default settings in 

datestyle = 'iso, mdy'
lc_messages = 'en_US.utf8'
lc_monetary = 'en_US.utf8'
lc_numeric = 'en_US.utf8'
lc_time = 'en_US.utf8'
default_text_search_config = 'pg_catalog.english'

2. Set env vars to modify datestyle and locale vars

rhc env-set OPENSHIFT_POSTGRESQL_LOCALE="zh_CN.utf8" -a app1
Setting environment variable(s) ... done

rhc env-set OPENSHIFT_POSTGRESQL_DATESTYLE="iso, dmy" -a app1
Setting environment variable(s) ... done

3. Restart the postgres cartridge
[root@dhcp-129-188 pei]# rhc cartridge restart postgresql-9 -a app1
Using postgresql-9.2 (PostgreSQL 9.2) for 'postgresql-9'
Restarting postgresql-9.2 ... done

4. Check postgresql/data/postgresql.conf again. The env vars setting by user was taking effect

datestyle = 'iso, dmy'
lc_messages = 'zh_CN.utf8'
lc_monetary = 'zh_CN.utf8'
lc_numeric = 'zh_CN.utf8'
lc_time = 'zh_CN.utf8'

The two env vars also work well with scalable app and postgresql-8.4 cartridge.

Comment 5 errata-xmlrpc 2014-11-03 19:54:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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