Bug 1073725 - 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 CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ---
: ---
Assignee: Jhon Honce
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1108254
TreeView+ depends on / blocked
 
Reported: 2014-03-07 03:04 UTC by Ma xiaoqiang
Modified: 2016-03-02 21:11 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1108254 (view as bug list)
Environment:
Last Closed: 2015-02-18 16:50:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


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