Hide Forgot
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:
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'
Invalid testcase. Environment var limit is 512 bytes and not 256 bytes.
(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.
Fixed in https://github.com/openshift/origin-server/pull/3452
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.
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
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
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)
Need to test the fix on devenv_3684
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)
Test on devenv_3685 and result is: Setting environment variable(s) ... name 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' exceeds maximum size of 128b so verified this, thx