Bug 1108254 - Can not update user variables if reach user variables maximum value.
Summary: Can not update user variables if reach user variables maximum value.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Brenton Leanhardt
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 1073725
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-11 15:31 UTC by Johnny Liu
Modified: 2019-12-16 04:30 UTC (History)
10 users (show)

Fixed In Version: rubygem-openshift-origin-node-1.32.3.1-1
Doc Type: Bug Fix
Doc Text:
Due to a bug in the node runtime, if a user hit the maximum number of environment variables set, they would no longer be able to update the variables. This bug fix improves error handling, and users can now update environment variables in this scenario. After applying this update, the ruby193-mcollective service must be restarted.
Clone Of: 1073725
: 1266239 (view as bug list)
Environment:
Last Closed: 2014-12-10 13:24:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1979 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.2.2 bug fix and enhancement update 2014-12-10 18:23:46 UTC

Description Johnny Liu 2014-06-11 15:31:04 UTC
+++ This bug was initially created as a clone of Bug #1073725 +++

Description of problem:
Can not update user variables if user have setted maximum user variables

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



How reproducible:
always

Steps to Reproduce:
1.create a app with perl cartridge
#rhc app create perlapp perl
2.set env to a app with 50 variables
#for i in `seq 1 50`;do  rhc env set NAME$i=NAME$i -a perlapp --confirm ;done 
3.update a variable
#rhc env set NAME1=Name



Actual results:
Setting environment variable(s) ... 
User Variables maximum of 50 exceeded

Expected results:
update successfully

Additional info:
# vim /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.21.5/lib/openshift-origin-node/model/application_container_ext/environment.rb 
<--snip-->
def user_var_add(variables, gears = [])
          directory = PathUtils.join(@container_dir, '.env', 'user_vars')
          FileUtils.mkpath(directory) unless File.directory?(directory)

          if (Dir.entries(directory).size - 2 + variables.size) > USER_VARIABLE_MAX_COUNT
            return 255, "CLIENT_ERROR: User Variables maximum of #{USER_VARIABLE_MAX_COUNT} exceeded\n"
          end

Comment 2 Zamir SUN 2014-09-15 15:37:26 UTC
Upstream pull request:
https://github.com/openshift/origin-server/pull/5813

Comment 3 Luke Meyer 2014-09-16 13:55:02 UTC
If accepted upstream soon, the change should automatically make it into OSE 2.2. It does not appear urgent enough to cherry-pick to 2.1.

Comment 6 Yanping Zhang 2014-11-25 07:39:43 UTC
Verified on http://etherpad.corp.redhat.com/puddle-2-2-2014-11-24
Steps to verify:
1.Create app with php cartridge.
#rhc app create php1 php-5.4
2.Set 50 env variables for php1
# for i in `seq 1 50`;do rhc env set VAR$i=v$i -a php1 --confirm;done
3.Update one env variable of php1.
# rhc env set VAR1=test -a php1
4.Check env variables of php1.
Actual results:
3.# rhc env set VAR1=test -a php1
Setting environment variable(s) ... done
4.Env VAR1 was updated succesfully
# rhc env list -a php1
VAR1=test
VAR10=v10
VAR11=v11
VAR12=v12
VAR13=v13
VAR14=v14
VAR15=v15
VAR16=v16
VAR17=v17
VAR18=v18
VAR19=v19
<--snip-->

Comment 8 errata-xmlrpc 2014-12-10 13:24:20 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.

https://rhn.redhat.com/errata/RHBA-2014-1979.html


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