Bug 1000167 - Cannot edit my.cnf file
Cannot edit my.cnf file
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Dan McPherson
libra bugs
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-22 16:43 EDT by anand
Modified: 2015-12-17 03:09 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-19 12:47:51 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)
Error Screenshot (139.39 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-08-22 16:43 EDT, anand
no flags Details

  None (edit)
Description anand 2013-08-22 16:43:32 EDT
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-22 20:05:51 EDT
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 01:25:05 EDT
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 08:35:07 EDT
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 12:25:58 EDT
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 17:13:51 EDT
(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-03 23:53:52 EDT
(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 12:46:56 EDT
FAQ has been updated.
Comment 8 TPR 2013-09-04 13:17:56 EDT
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 13:18:50 EDT
(In reply to Dan McPherson from comment #7)
> FAQ has been updated.

Thanks!
Comment 10 Hiro Asari 2013-09-04 16:17:02 EDT
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 15:46:08 EDT
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 17:14:47 EDT
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 18:19:40 EDT
Excellent, when will this be in effect?
Comment 15 Qiushui Zhang 2013-09-06 06:01:03 EDT
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 10:32:42 EDT
(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 02:04:32 EDT
(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 13:22:31 EDT
Good solution, congrats!
Can't wait to see this online.
Thanks again!

Regards.
Comment 19 anand 2013-09-16 19:26:22 EDT
Is this fix online now?
Comment 20 Dan McPherson 2013-09-16 21:16:02 EDT
Not yet.  It's due out Wed 9/18 as of now
Comment 21 anand 2013-09-18 17:06:29 EDT
How do I see and change these variables? Please clarify
Comment 22 Dan McPherson 2013-09-19 11:54:08 EDT
(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 13:33:43 EDT
This works. Appreciate your support and turnaround on this issue.
Comment 24 KonstantinAn 2013-09-20 15:44:04 EDT
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 16:32:32 EDT
@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 03:09:21 EST
@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.

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