Bug 998905 - [origin_broker_86] User env variable is actually not created even if it returns created message from RESTAPI if the variable length >256
[origin_broker_86] User env variable is actually not created even if it retu...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Master (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Ravi Sankar
libra bugs
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-20 06:28 EDT by weiwei jiang
Modified: 2016-10-30 18:53 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-29 08:53:41 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)

  None (edit)
Description weiwei jiang 2013-08-20 06:28:59 EDT
Description of problem:
when add a variable with variable name have more than 256 chars, it will pass, and no warning message output

Version-Release number of selected component (if applicable):
devenv_3678
rhc_build from devenv_3677

How reproducible:
always

Steps to Reproduce:
1. Create a app
2. Set a variable with its name have more than 255 chars
3. check the variable if it is added

Actual results:
Setting environment variable(s) ... done
rhc env list not contain the variable

Expected results:
It should FAIL  and output messages to tell user variable name is out of limit

Additional info:
Comment 1 Fabiano Franz 2013-08-20 12:05:41 EDT
Checked this with curl, no error is being returned:

curl -k --user user:pass https://host/broker/rest/applications/<id>/environment-variables -X POST -d environment_variables[][name]='1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' -d environment_variables[][value]='BAR'
Comment 2 Ravi Sankar 2013-08-20 14:02:07 EDT
Invalid testcase. Environment var limit is 512 bytes and not 256 bytes.
Comment 3 zhaozhanqi 2013-08-20 22:14:05 EDT
(In reply to Fabiano Franz from comment #1)
> Checked this with curl, no error is being returned:
> 
> curl -k --user user:pass
> https://host/broker/rest/applications/<id>/environment-variables -X POST -d
> environment_variables[][name]='1111111111111111111111111111111111111111111111
> 11111111111111111111111111111111111111111111111111111111111111111111111111111
> 11111111111111111111111111111111111111111111111111111111111111111111111111111
> 11111111111111111111111111111111111111111111111111111111111' -d
> environment_variables[][value]='BAR'

Tested this issue again, if the env variable name >256 chars, the result returned from restapi will be created.But cannot find in env list.
Comment 4 Ravi Sankar 2013-08-21 13:57:20 EDT
Fixed in https://github.com/openshift/origin-server/pull/3452
Comment 5 Ravi Sankar 2013-08-21 17:12:21 EDT
I misunderstood the issue before. Environment variable value limit is 512 bytes.
Summary of the new changes:
Added environment variable name limitations:
 - Limit length to 128 bytes.
 - Allow letters, digits and underscore but can't begin with digit
Allow '=' or ' ' in the environment variable value.
Comment 6 openshift-github-bot 2013-08-21 20:22:13 EDT
Commit pushed to master at https://github.com/openshift/li

https://github.com/openshift/li/commit/fb602f72e86d6926f92b9d6ec8509affda4f648a
Merge pull request #1845 from pravisankar/dev/ravi/bug998905

Merged by openshift-bot
Comment 7 openshift-github-bot 2013-08-21 20:22:16 EDT
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/f271a2628b8e31fe523d94de8c4b4d98d5352245
Merge pull request #3452 from pravisankar/dev/ravi/bug998905

Merged by openshift-bot
Comment 8 weiwei jiang 2013-08-21 23:03:53 EDT
Test on devenv_3683 and as follow:
1.for i in `seq 64`; do echo -n "asdf" >> file; done
2. rhc env set `cat file`=asdf -a php
   Setting environment variable(s) ... done
3. rhc env list -a php
    no output 
And then I found that variable name contains <=255 chars, it will be added 

And if variable name contains >255 chars, It will pass but will be not added (env list)
Comment 9 Ravi Sankar 2013-08-21 23:28:03 EDT
Need to test the fix on devenv_3684
Comment 11 weiwei jiang 2013-08-22 02:27:07 EDT
Test on devenv_3684 and result is :
1.for i in `seq 64`; do echo -n "asdf" >> file; done
2. rhc env set `cat file`=asdf -a php
   Setting environment variable(s) ... done
3. rhc env list -a php
    no output 
When variable name contains <=255 chars, it will be added 

And if variable name contains >255 chars, It will pass but will be not added (env list)
Comment 12 weiwei jiang 2013-08-22 03:30:49 EDT
Test on devenv_3685 and result is:

Setting environment variable(s) ... 
name
'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
exceeds maximum size of 128b

so verified this, thx

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