Bug 1045967 - Got "The server did not respond correctly." message when set customize environment variables on OSE2.0
Summary: Got "The server did not respond correctly." message when set customize enviro...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 2.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Brenton Leanhardt
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-23 04:39 UTC by weiwei jiang
Modified: 2017-03-08 17:36 UTC (History)
10 users (show)

Fixed In Version: rubygem-openshift-origin-controller-1.17.12-1.el6op
Doc Type: Bug Fix
Doc Text:
An upstream rhc client tools feature broke compatibility with OpenShift Enterprise and prohibited users from setting environment variables from the command line. The broker's controller RubyGem has been fixed to support the new functionality. The upstream rhc version 1.19.2 is now compatible with OpenShift Enterprise 2.0.2 and users are now able to set environment variables from the command line.
Clone Of:
Environment:
Last Closed: 2014-01-30 13:19:10 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0117 0 normal SHIPPED_LIVE OpenShift Enterprise 2.0.2 rubygem-openshift-origin-controller bug fix update 2014-01-30 18:18:28 UTC

Description weiwei jiang 2013-12-23 04:39:19 UTC
Description of problem:
When set customize environment ariables on OSE2.0, got "The server did not respond correctly." messages;And restapi can pass "curl -k -s -u wjiang https://10.4.59.194/broker/rest/application/52b7a4a12a165f6326000010/environment-variables -X POST -d name=key -d value=value"; But on the latest devenv(devenv_4167), the issue can not be reproduced.

Version-Release number of selected component (if applicable):
OSE2.0
rhc 1.19.2

How reproducible:
always

Steps to Reproduce:
1.Create a app 
2.Try to add some customize environment variables
3.

Actual results:
$ rhc env set= -a ttt
Setting environment variable(s) ... 
The server did not respond correctly. This may be an issue with the server configuration or with your connection to the server (such as a Web proxy or firewall).
Please verify that you can access the OpenShift server https://10.4.59.194/broker/rest/application/52b7a4a12a165f6326000010/environment-variables

And /var/log/openshift/broker/production.log:
2013-12-22 22:31:46.246 [INFO ] Started GET "/broker/rest/api" for 127.0.0.1 at 2013-12-22 22:31:46 -0500 (pid:6638)
2013-12-22 22:31:46.247 [INFO ] Processing by ApiController#show as JSON (pid:6638)
2013-12-22 22:31:46.254 [INFO ] Completed 200 OK in 6ms (Views: 3.4ms) (pid:6638)
2013-12-22 22:31:47.323 [INFO ] Started GET "/broker/rest/api" for 127.0.0.1 at 2013-12-22 22:31:47 -0500 (pid:6638)
2013-12-22 22:31:47.324 [INFO ] Processing by ApiController#show as JSON (pid:6638)
2013-12-22 22:31:47.331 [INFO ] Completed 200 OK in 6ms (Views: 3.8ms) (pid:6638)
2013-12-22 22:31:48.397 [INFO ] Started GET "/broker/rest/domains" for 127.0.0.1 at 2013-12-22 22:31:48 -0500 (pid:6638)
2013-12-22 22:31:48.398 [INFO ] Processing by DomainsController#index as JSON (pid:6638)
2013-12-22 22:31:48.416 [INFO ] Completed 200 OK in 17ms (Views: 6.7ms) (pid:6638)
2013-12-22 22:31:49.535 [INFO ] Started GET "/broker/rest/domains/amentra/applications/ttt" for 127.0.0.1 at 2013-12-22 22:31:49 -0500 (pid:6638)
2013-12-22 22:31:49.537 [INFO ] Processing by ApplicationsController#show as JSON (pid:6638)
2013-12-22 22:31:49.537 [INFO ] Parameters: {"domain_id"=>"amentra", "id"=>"ttt"} (pid:6638)
2013-12-22 22:31:49.564 [INFO ] Completed 200 OK in 27ms (Views: 8.4ms) (pid:6638)
2013-12-22 22:31:50.652 [INFO ] Started PATCH "/broker/rest/application/52b7acff2a165f0dfc00003e/environment-variables" for 127.0.0.1 at 2013-12-22 22:31:50 -0500 (pid:6638)
         

Expected results:
It should pass without any errors messages

Additional info:

Comment 1 weiwei jiang 2013-12-23 04:45:12 UTC
(In reply to weiwei jiang from comment #0)
> Description of problem:
> When set customize environment ariables on OSE2.0, got "The server did not
> respond correctly." messages;And restapi can pass "curl -k -s -u wjiang
> https://10.4.59.194/broker/rest/application/52b7a4a12a165f6326000010/
> environment-variables -X POST -d name=key -d value=value"; But on the latest
> devenv(devenv_4167), the issue can not be reproduced.
> 
> Version-Release number of selected component (if applicable):
> OSE2.0
> rhc 1.19.2
> 
> How reproducible:
> always
> 
> Steps to Reproduce:
> 1.Create a app 
> 2.Try to add some customize environment variables
> 3.
> 
> Actual results:
> $ rhc env set= -a ttt ========> invalid
rhc env set key=value -a ttt
> Setting environment variable(s) ... 
> The server did not respond correctly. This may be an issue with the server
> configuration or with your connection to the server (such as a Web proxy or
> firewall).
> Please verify that you can access the OpenShift server
> https://10.4.59.194/broker/rest/application/52b7a4a12a165f6326000010/
> environment-variables
> 
> And /var/log/openshift/broker/production.log:
> 2013-12-22 22:31:46.246 [INFO ] Started GET "/broker/rest/api" for 127.0.0.1
> at 2013-12-22 22:31:46 -0500 (pid:6638)
> 2013-12-22 22:31:46.247 [INFO ] Processing by ApiController#show as JSON
> (pid:6638)
> 2013-12-22 22:31:46.254 [INFO ] Completed 200 OK in 6ms (Views: 3.4ms)
> (pid:6638)
> 2013-12-22 22:31:47.323 [INFO ] Started GET "/broker/rest/api" for 127.0.0.1
> at 2013-12-22 22:31:47 -0500 (pid:6638)
> 2013-12-22 22:31:47.324 [INFO ] Processing by ApiController#show as JSON
> (pid:6638)
> 2013-12-22 22:31:47.331 [INFO ] Completed 200 OK in 6ms (Views: 3.8ms)
> (pid:6638)
> 2013-12-22 22:31:48.397 [INFO ] Started GET "/broker/rest/domains" for
> 127.0.0.1 at 2013-12-22 22:31:48 -0500 (pid:6638)
> 2013-12-22 22:31:48.398 [INFO ] Processing by DomainsController#index as
> JSON (pid:6638)
> 2013-12-22 22:31:48.416 [INFO ] Completed 200 OK in 17ms (Views: 6.7ms)
> (pid:6638)
> 2013-12-22 22:31:49.535 [INFO ] Started GET
> "/broker/rest/domains/amentra/applications/ttt" for 127.0.0.1 at 2013-12-22
> 22:31:49 -0500 (pid:6638)
> 2013-12-22 22:31:49.537 [INFO ] Processing by ApplicationsController#show as
> JSON (pid:6638)
> 2013-12-22 22:31:49.537 [INFO ] Parameters: {"domain_id"=>"amentra",
> "id"=>"ttt"} (pid:6638)
> 2013-12-22 22:31:49.564 [INFO ] Completed 200 OK in 27ms (Views: 8.4ms)
> (pid:6638)
> 2013-12-22 22:31:50.652 [INFO ] Started PATCH
> "/broker/rest/application/52b7acff2a165f0dfc00003e/environment-variables"
> for 127.0.0.1 at 2013-12-22 22:31:50 -0500 (pid:6638)
>          
> 
> Expected results:
> It should pass without any errors messages
> 
> Additional info:

Comment 2 weiwei jiang 2013-12-23 04:46:12 UTC
When unset a variable which RESTAPI added, also got this issue.

Comment 5 Fabiano Franz 2014-01-02 14:12:28 UTC
I could not reproduce this issue. Could you please check if it happens only with an invalid command like 'rhc env set= -a ttt' or also with a valid command like 'rhc env set key=value -a ttt'?


ffranz@ffranz$ rhc set-env FOO=BAR -a franzapp
Setting environment variable(s) ... done
ffranz@ffranz$ rhc set-env FOO2=BAR -a franzapp
Setting environment variable(s) ... done
ffranz@ffranz$ rhc list-env franzapp
FOO=BAR
FOO2=BAR
ffranz@ffranz$ rhc env set FOO3=BAR3 -a franzapp
Setting environment variable(s) ... done
ffranz@ffranz$ rhc list-env franzapp
FOO=BAR
FOO2=BAR
FOO3=BAR3
ffranz@ffranz$ rhc env set= -a franzapp
Setting environment variable(s) ... done
ffranz@ffranz$ rhc list-env franzapp
FOO=BAR
FOO2=BAR
FOO3=BAR3
set=
ffranz@ffranz$ rhc unset-env FOO3 -a franzapp
Removing environment variables is a destructive operation that may result in loss of data.
FOO3

Are you sure you wish to remove the environment variable(s) above from application 'franzapp'? (yes|no): y

Removing environment variable(s) ... removed

Comment 6 weiwei jiang 2014-01-03 02:19:33 UTC
Tried again and got follow result. So, maybe somethings different.

[wjiang@wjiang ~]$ rhc set-env key=value -a franzapp
Setting environment variable(s) ... 
The server did not respond correctly. This may be an issue with the server configuration or with your connection to the server (such as a Web proxy or firewall). Please
verify that you can access the OpenShift server https://10.4.59.194/broker/rest/application/52c571432a165f0ab8000017/environment-variables


[wjiang@wjiang ~]$ curl -k https://10.4.59.194/broker/rest/application/52c571432a165f0ab8000017/environment-variables -u wjiang:redhat
{"api_version":1.6,"data":[{"links":{"GET":{"href":"https://10.4.59.194/broker/rest/application/52c571432a165f0ab8000017/environment-variable/set","method":"GET","optional_params":[],"rel":"Get environment variable","required_params":[]},"UPDATE":{"href":"https://10.4.59.194/broker/rest/application/52c571432a165f0ab8000017/environment-variable/set","method":"PUT","optional_params":[],"rel":"Update environment variable","required_params":[{"description":"Value of the environment variable","invalid_options":[],"name":"value","type":"string","valid_options":[]}]},"DELETE":{"href":"https://10.4.59.194/broker/rest/application/52c571432a165f0ab8000017/environment-variable/set","method":"DELETE","optional_params":[],"rel":"Delete environment variable","required_params":[]}},"name":"set","value":""},{"links":{"GET":{"href":"https://10.4.59.194/broker/rest/application/52c571432a165f0ab8000017/environment-variable/FOO","method":"GET","optional_params":[],"rel":"Get environment variable","required_params":[]},"UPDATE":{"href":"https://10.4.59.194/broker/rest/application/52c571432a165f0ab8000017/environment-variable/FOO","method":"PUT","optional_params":[],"rel":"Update environment variable","required_params":[{"description":"Value of the environment variable","invalid_options":[],"name":"value","type":"string","valid_options":[]}]},"DELETE":{"href":"https://10.4.59.194/broker/rest/application/52c571432a165f0ab8000017/environment-variable/FOO","method":"DELETE","optional_params":[],"rel":"Delete environment variable","required_params":[]}},"name":"FOO","value":"BAR"},{"links":{"GET":{"href":"https://10.4.59.194/broker/rest/application/52c571432a165f0ab8000017/environment-variable/FOO2","method":"GET","optional_params":[],"rel":"Get environment variable","required_params":[]},"UPDATE":{"href":"https://10.4.59.194/broker/rest/application/52c571432a165f0ab8000017/environment-variable/FOO2","method":"PUT","optional_params":[],"rel":"Update environment variable","required_params":[{"description":"Value of the environment variable","invalid_options":[],"name":"value","type":"string","valid_options":[]}]},"DELETE":{"href":"https://10.4.59.194/broker/rest/application/52c571432a165f0ab8000017/environment-variable/FOO2","method":"DELETE","optional_params":[],"rel":"Delete environment variable","required_params":[]}},"name":"FOO2","value":"BAR"}],"messages":[{"exit_code":0,"field":null,"index":null,"severity":"info","text":"Listing environment variables for application franzapp"}],"status":"ok","supported_api_versions":[1.0,1.1,1.2,1.3,1.4,1.5,1.6],"type":"environment-variables","version":"1.6"}

Comment 7 Fabiano Franz 2014-01-15 20:50:55 UTC
Couldn't really reproduce this. Could you confirm it's not related to proxy (check your http_proxy and https_proxy env vars)? curl will not pass through it while rhc will always use the proxy defined in those env vars.

Comment 8 weiwei jiang 2014-01-16 04:40:31 UTC
Tried with Ose-2.0.2 with rhc-1.19.3 again, and still can reproduce, and found the issue is OSE-2.0.2 can not response PATCH method http request.

when I set a environment variable on ose-2.0.2 with rhc-1.19.3, found it is using PATCH method even the output display server can hold restapi 1.6
$ rhc env set key=value -a app -d 
DEBUG: Using config file /home/wjiang/.openshift/express.conf
DEBUG: Git config 'git config --get rhc.app-id' returned ''
DEBUG: Git config 'git config --get rhc.app-name' returned ''
DEBUG: Git config 'git config --get rhc.domain-name' returned ''
DEBUG: Authenticating with RHC::Auth::Token
DEBUG: Connecting to https://10.4.59.138/broker/rest/api
DEBUG: Getting all domains
DEBUG: Client supports API versions 1.1, 1.2, 1.3, 1.4, 1.5, 1.6
DEBUG: Using token authentication
DEBUG: Created new httpclient
DEBUG: Request GET https://10.4.59.138/broker/rest/api
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200 5957 ms
DEBUG: Server supports API versions 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6
DEBUG:    Using API version 1.6
DEBUG: Client API version 1.6 is not current. Refetching API
DEBUG: Using token authentication
DEBUG: Request GET https://10.4.59.138/broker/rest/api
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200 4154 ms
DEBUG: Using token authentication
DEBUG: Request GET https://10.4.59.138/broker/rest/domains
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200 1891 ms
DEBUG: Using token authentication
DEBUG: Request GET https://10.4.59.138/broker/rest/domains/wjiang/applications/app
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 200 2398 ms
Setting environment variable(s) ... DEBUG: Adding environment variable(s) [#<RHC::Rest::EnvironmentVariable:0x00000002b377a0 @attributes={"name"=>"key", "value"=>"value", "messages"=>[]}, @client=nil>] for app
DEBUG: Using token authentication
DEBUG: Request PATCH https://10.4.59.138/broker/rest/application/52d746d2ea28b97040000013/environment-variables
DEBUG: SSL Verification failed -- Using self signed cert
DEBUG:    code 500 1782 ms
DEBUG: Response did not include a message from server: invalid character at "<!DOCTYPE "

The server did not respond correctly. This may be an issue with the server configuration or with your connection to the server (such as a Web proxy or firewall).
Please verify that you can access the OpenShift server https://10.4.59.138/broker/rest/application/52d746d2ea28b97040000013/environment-variables


And when use restapi to do the same PATCH request
$ curl -k -u wjiang:redhat https://10.4.59.138/broker/rest/application/52d746d2ea28b97040000013/environment-variables --data-urlencode name=asdfsdfa --data-urlencode value=asdfsadfsaf -X PATCH
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
 root@localhost and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.15 (Red Hat) Server at 10.4.59.138 Port 80</address>
</body></html>

So, it show the server can not response the request which with PATCH method.

Comment 9 weiwei jiang 2014-01-16 04:54:49 UTC
And the same result with rhc-1.19.4

Comment 10 Jordan Liggitt 2014-01-17 19:12:10 UTC
Patch support was added to the broker in https://bugzilla.redhat.com/show_bug.cgi?id=1039760

Probably needs to be backported to OSE

Comment 11 Jordan Liggitt 2014-01-17 19:15:15 UTC
Broker needs to support env var API with PATCH HTTP method, since that is what is published in the API.

Upstream fix made in https://github.com/openshift/origin-server/commit/fe197de3

Comment 15 Gaoyun Pei 2014-01-28 03:08:11 UTC
verify this bug with rubygem-openshift-origin-controller-1.17.12-1.el6op

using PACTH method to add customize environment variables to app:
[root@broker ~]# curl -k -H 'Accept: application/xml' --user gpei:redhat https:/                                                                                        /broker.ose-0116.com/broker/rest/application/52e71c960ca8746a8b000017/environmen                                                                                        t-variables --data-urlencode name=asdfsdfa --data-urlencode value=asdfsadfsaf -X                                                                                         PATCH
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>created</status>
  <type>environment-variable</type>
  <data>
    <environment-variable>
      <name>asdfsdfa</name>
      <value>asdfsadfsaf</value>
      <links>
        <link>
          <rel>Get environment variable</rel>
          <method>GET</method>
          <href>https://broker.ose-0116.com/broker/rest/application/52e71c960ca8                                                                                        746a8b000017/environment-variable/asdfsdfa</href>
          <required-params/>
          <optional-params/>
        </link>
        <link>
          <rel>Update environment variable</rel>
          <method>PUT</method>
          <href>https://broker.ose-0116.com/broker/rest/application/52e71c960ca8                                                                                        746a8b000017/environment-variable/asdfsdfa</href>
          <required-params>
            <param>
              <name>value</name>
              <type>string</type>
              <description>Value of the environment variable</description>
              <valid-options/>
              <invalid-options/>
            </param>
          </required-params>
          <optional-params/>
        </link>
        <link>
          <rel>Delete environment variable</rel>
          <method>DELETE</method>
          <href>https://broker.ose-0116.com/broker/rest/application/52e71c960ca8                                                                                        746a8b000017/environment-variable/asdfsdfa</href>
          <required-params/>
          <optional-params/>
        </link>
      </links>
    </environment-variable>
  </data>
  <messages>
    <message>
      <severity>info</severity>
      <text>Added environment variable 'asdfsdfa' to application app1</text>
      <exit-code>0</exit-code>
      <field nil="true"></field>
      <index nil="true"></index>
    </message>
  </messages>
  <version>1.6</version>
  <api-version>1.6</api-version>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
    <supported-api-version>1.2</supported-api-version>
    <supported-api-version>1.3</supported-api-version>
    <supported-api-version>1.4</supported-api-version>
    <supported-api-version>1.5</supported-api-version>
    <supported-api-version>1.6</supported-api-version>
  </supported-api-versions>
</response>

Comment 16 Peter Ruan 2014-01-28 07:02:44 UTC
verified with puddle-2-0-3-2014-01-27

Comment 18 errata-xmlrpc 2014-01-30 13:19:10 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.

http://rhn.redhat.com/errata/RHBA-2014-0117.html


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