Bug 1073725

Summary: Can not update user variables if reach user variables maximum value.
Product: OpenShift Online Reporter: Ma xiaoqiang <xiama>
Component: ContainersAssignee: Jhon Honce <jhonce>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: high    
Version: 2.xCC: brett, lxia, nicholas_schuetz, sztsian, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1108254 (view as bug list) Environment:
Last Closed: 2015-02-18 16:50:05 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:    
Bug Blocks: 1108254    

Description Ma xiaoqiang 2014-03-07 03:04:18 UTC
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 1 Liang Xia 2014-07-03 06:34:54 UTC
Reproduced on devenv_4936.

Still met the error:
  User Variables maximum of 50 exceeded
when update existing user variable values after setting 50 user variables.

Any plan to fix this?

Comment 2 Brett 2014-09-07 20:36:39 UTC
+1. This is a really annoying problem and seems like an artificial restriction with little benefit.

Comment 3 Zamir SUN 2014-09-15 15:34:20 UTC
Thanks for the clear clear bug analysis.
PR: https://github.com/openshift/origin-server/pull/5813

Comment 4 Ma xiaoqiang 2014-11-06 06:14:55 UTC
Check on devenv_5281, the code is not merged, wait for the next verion.

Comment 5 Ma xiaoqiang 2014-11-07 05:18:56 UTC
check on devene_5286

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 -a perlapp

In the step 3, update the value successfully.