Bug 1123587 - Openshift overwrites data/postgresql.conf during restart, destroying Locale and Formatting configuration
Summary: Openshift overwrites data/postgresql.conf during restart, destroying Locale a...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Michal Fojtik
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1123850
TreeView+ depends on / blocked
 
Reported: 2014-07-26 22:43 UTC by Jurgen
Modified: 2015-05-15 00:44 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1123850 (view as bug list)
Environment:
Last Closed: 2015-02-18 16:50:28 UTC


Attachments (Terms of Use)

Description Jurgen 2014-07-26 22:43:56 UTC
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):

Unknown

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: 
http://stackoverflow.com/questions/24955590/how-to-change-postgresql-conf-default-values-on-openshift

Comment 1 Michal Fojtik 2014-07-28 09:00:16 UTC
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:

OPENSHIFT_POSTGRESQL_LOCALE="es_BO.utf8"

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

Comment 2 Michal Fojtik 2014-07-28 09:41:21 UTC
https://github.com/openshift/origin-server/pull/5664

Comment 3 openshift-github-bot 2014-07-28 10:31:19 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/0cdd022f6316d7597f54620d2805f23b8e866315
Bug 1123587 - Added OPENSHIFT_POSTGRESQL_LOCALE environment variable

Comment 4 Jurgen 2014-07-28 14:05:03 UTC
Thank for the quick response.

I see that now i can configure local vars via env variables, but the datestyle is missing, would you please allow to change this var too, this variable is important to run some applications with other date styles like mine, for example i need to change: datestyle = 'iso, mdy' to datestyle = 'iso, dmy' or my application won't work.

Comment 5 chunchen 2014-07-29 06:06:57 UTC
Checked on devenv_5020, the local vars can be configured via env variable, but the datestyle var still can be overwritten when restarting, so assign it back.

For configuring local vars teting results:
1. Create an app with postgresql
rhc app create cas jbossas-7 postgresql-9 --no-git

2. Set the env var
rhc env-set OPENSHIFT_POSTGRESQL_LOCALE="zh_CN.utf8" -a cas

3. SSH into the app and check the local vars in ~/postgresqldata/postgresql.conf

Results:
the values take effect at step 2.

Comment 6 chunchen 2014-07-30 03:49:12 UTC
I have made a mistake in the testing results steps in Comment 5, the mistake is i have restarted the postgresql between step 2 and step 3, but missed pasting the restarted step, sorry for any confused and please refer to the below total testing steps:

For configuring local vars teting results:
1. Create an app with postgresql
rhc app create cas jbossas-7 postgresql-9 --no-git

2. Set the env var for postgresql
rhc env-set OPENSHIFT_POSTGRESQL_LOCALE="zh_CN.utf8" -a cas

3. Restart postgresql database
rhc cartridge restart postgresql-9 -a cas

4. SSH into the app and check the local vars in ~/postgresqldata/postgresql.conf

Results:
the values take effect at step 2.

Comment 7 Michal Fojtik 2014-08-01 12:10:39 UTC
Should be fixed here:

https://github.com/openshift/origin-server/pull/5682

There is a new ENV variable: OPENSHIFT_POSTGRESQL_DATESTYLE as the format is not the same as locale.

Comment 8 openshift-github-bot 2014-08-01 13:16:45 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/d73cdebe4d5af47431991ca94e8481af2740c790
Bug 1123587 - Added OPENSHIFT_POSTGRESQL_DATESTYLE env var

Comment 9 chunchen 2014-08-04 02:07:55 UTC
Checked on devenv_5039, the OPENSHIFT_POSTGRESQL_DATESTYLE var settings have taken effect for postgresql 9.2, but not for postgresql-8.4; from the PR, the changed codes only for postgresql 9.2, please help to have a look.

Comment 10 Michal Fojtik 2014-08-04 12:23:13 UTC
Chunchen: Good catch! I'm sorry about that, I completely overseen the 8.2 configuration file. PR: https://github.com/openshift/origin-server/pull/5687

Comment 11 openshift-github-bot 2014-08-04 13:16:29 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/91f2cffaed7a508764c009fc587c8e5b43061767
Bug 1123587 - Updated postgresql-8.2 to support OPENSHIFT_POSTGRESQL_DATESTYLE

Comment 12 chunchen 2014-08-05 02:05:42 UTC
It's fixed, verified on devenv_5041, the OPENSHIFT_POSTGRESQL_DATESTYLE var also takes effect for postgresql-8.4 for now, so mark it as VERIFIED.

Comment 13 Jason DeTiberus 2014-10-08 02:14:45 UTC
Looks like this shipped with Sprint 50, any reason it isn't Closed?


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