Bug 1000167

Summary: Cannot edit my.cnf file
Product: OpenShift Online Reporter: anand
Component: ContainersAssignee: Dan McPherson <dmcphers>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 2.xCC: anand, dmcphers, hasari, james01, jialiu, konsanag, lmeyer, qiuzhang, tpr, valentas.narkevicius, xtian
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-19 16:47:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Error Screenshot none

Description anand 2013-08-22 20:43:32 UTC
Created attachment 789362 [details]
Error Screenshot

Description of problem:
Used to be able to edit  ~/mysql/conf/my.cnf file. However cannot do it now and get an error "Permission Denied"

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

How reproducible:


Steps to Reproduce:
1. SSH to the MY SQL gear
2. edit the file using the file path  ~/mysql/conf/my.cnf
3. Add the parameter lower_case_table_names = 1 under section [mysqld]

Actual results:
"Permission Denied"

Expected results:
Should be able to edit and save the file

Additional info:

Comment 1 Dan McPherson 2013-08-23 00:05:51 UTC
You could previously edit the file but it would be replaced on every upgrade of the mysql cartridge.  So the current implementation that doesn't let you edit is as intended.  But it's a reasonable request to get access to the config.  I'll leave this bug as a request for an editable my.cnf feature.

Comment 2 James 2013-08-29 05:25:05 UTC
Can the Severity be changed back to high?

I'm using Silverstripe CMS which uses massive sort queries so i need to increase sort_buffer_size from 64k to 128k.  Without doing this i get error throughout the site.  I need to be able to edit my.cnf for proper functioning of my php site.

I need to be able to edit this file.

Comment 3 Dan McPherson 2013-08-29 12:35:07 UTC
The severity is currently appropriate as the lack of editability is as designed.  We might be able to change the sort_buffer_size globally though as a short term fix until we can add the ability to let you change these settings consistently without being overridden time the cartridge is updated.  Would that at least allow your app to function?

Comment 4 anand 2013-08-29 16:25:58 UTC
Even I have the same issue. Without changing the parameter lower_case_table_names = 1, I am not able to use my application at all. Currently it is a showstopper for me. Please suggest how I can address this.

Comment 5 James 2013-08-29 21:13:51 UTC
(In reply to Dan McPherson from comment #3)
>change the sort_buffer_size globally though as a short term fix

Hi Dan, yes that certainly would.  It would be great if that can be done.  That is the only change I make to my.cnf.

On a side note, maybe a future feature would be to be able to have our own .cnf within the app git structure that can override when doing a git push?

Thanks for the quick reply.

Comment 6 TPR 2013-09-04 03:53:52 UTC
(In reply to Dan McPherson from comment #1)
> config.  I'll leave this bug as a request for an editable my.cnf feature.

If it's not a bug of high severity, then you should remove that from the site:
https://www.openshift.com/faq/can-i-modify-mysqls-configuration-file-if-so-how

Also, my application does not even start without "lower_case_table_names = 1" because of another red hat sponsored product: hibernate.

Regards.

Comment 7 Dan McPherson 2013-09-04 16:46:56 UTC
FAQ has been updated.

Comment 8 TPR 2013-09-04 17:17:56 UTC
Dear MySql Gear Developers,

I was thinking about this my.cnf file problem and I may have had a possible solution:

Assuming that a data folder is copied when updating a gear (if it´s not this wouldn´t work), what if you configure the mysql server to read lastly a blank editable my.cfg file in the data folder?

Regards.

Comment 9 TPR 2013-09-04 17:18:50 UTC
(In reply to Dan McPherson from comment #7)
> FAQ has been updated.

Thanks!

Comment 10 Hiro Asari 2013-09-04 20:17:02 UTC
We will be tracking progress for providing a general solution for configuring DB cartridges with this Trello https://trello.com/c/kuZecQIv/269-provide-a-convenient-means-of-configuring-db-parameters-mysql-mongodb-postgresql

Comment 11 Dan McPherson 2013-09-05 19:46:08 UTC
FYI: We are talking about a fix here that allows user defined environment vars to set various settings in my.cnf and similar for postgresql.

Comment 12 Dan McPherson 2013-09-05 21:14:47 UTC
The following has been added to the top of my.cnf

# WARNING: Changes to this file will be lost on every restart/upgrade.  Configurable values can be set with environment variables through rhc env set...
#
# Ex: rhc env set OPENSHIFT_MYSQL_LOWER_CASE_TABLE_NAMES=1 -a myapp && rhc cartridge restart -c mysql-5.1 -a myapp
#
# Configurable Values:
# lower_case_table_names -> OPENSHIFT_MYSQL_LOWER_CASE_TABLE_NAMES


We will be adding to the list of configurable params in the future but this should handle the use case of this bug.  Note that sort_buffer_size was increased to 128K for all users.


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

Comment 13 James 2013-09-05 22:19:40 UTC
Excellent, when will this be in effect?

Comment 15 Qiushui Zhang 2013-09-06 10:01:03 UTC
Tested on devenv_3752.
The warning messages are added.
sort_buffer_size updated to 128.

Mark it as verified.

Comment 16 Dan McPherson 2013-09-06 14:32:42 UTC
(In reply to James from comment #13)
> Excellent, when will this be in effect?

It's in origin now and will make it to online the next release which is scheduled for the 16th.

Comment 17 James 2013-09-07 06:04:32 UTC
(In reply to Dan McPherson from comment #16)
> It's in origin now and will make it to online the next release which is
> scheduled for the 16th.

Great. Thanks for the heads up. Love your work!

Comment 18 TPR 2013-09-11 17:22:31 UTC
Good solution, congrats!
Can't wait to see this online.
Thanks again!

Regards.

Comment 19 anand 2013-09-16 23:26:22 UTC
Is this fix online now?

Comment 20 Dan McPherson 2013-09-17 01:16:02 UTC
Not yet.  It's due out Wed 9/18 as of now

Comment 21 anand 2013-09-18 21:06:29 UTC
How do I see and change these variables? Please clarify

Comment 22 Dan McPherson 2013-09-19 15:54:08 UTC
(In reply to anand from comment #21)
> How do I see and change these variables? Please clarify

The top of my.cnf in your app has all the details.  But you should just need to run:

rhc env set OPENSHIFT_MYSQL_LOWER_CASE_TABLE_NAMES=1 -a <myapp> && rhc cartridge restart -c mysql-5.1 -a <myapp>

And I believe your app should be updated by now to be able to use this feature.

Comment 23 anand 2013-09-19 17:33:43 UTC
This works. Appreciate your support and turnaround on this issue.

Comment 24 KonstantinAn 2013-09-20 19:44:04 UTC
I would like to change character-set-server to utf8, before the upgrade I had placed character-set-server=utf8 along with some other variables (like skip-character-set-client-handshake) under [mysqld] in order to insert data to my DB with characters other than Latin like Russian or Greek, what can I do now that my.cnf is locked? is there any related environment variable or anything else that I can do?

Comment 25 Dan McPherson 2013-09-20 20:32:32 UTC
@KonstantinAn  Can you please open a new bug with your requests.  We should be able to add them for next release (~2 weeks away).

Comment 26 Valentas 2015-12-17 08:09:21 UTC
@Dan McPherson Hi, can you please increase the buffer size of mysql: in the my.cnf, sort_buffer_size to 256K. Because we can't use new silverstripe application version always getting this "Error: Out of sort memory, consider increasing server sort buffer size".

I think best solution is to add new parameter like others parameters in my.cnf.erb. Example: max_allowed_packet = <%= ENV['OPENSHIFT_MYSQL_MAX_ALLOWED_PACKET'] ? ENV['OPENSHIFT_MYSQL_MAX_ALLOWED_PACKET'] : '200M' %>

Best Regards.