Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1108254

Summary: Can not update user variables if reach user variables maximum value.
Product: OpenShift Container Platform Reporter: Johnny Liu <jialiu>
Component: ContainersAssignee: Brenton Leanhardt <bleanhar>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.1.0CC: adellape, erich, jokerman, libra-onpremise-devel, lmeyer, mmccomas, sztsian, xiama, xtian, yanpzhan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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.
Story Points: ---
Clone Of: 1073725
: 1266239 (view as bug list) Environment:
Last Closed: 2014-12-10 13:24:20 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:
Bug Depends On: 1073725    
Bug Blocks:    

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