Bug 1021462 - Fail to create one scalable app include multi cartridge by RESTAPI and add variable
Summary: Fail to create one scalable app include multi cartridge by RESTAPI and add va...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Jhon Honce
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1067257
TreeView+ depends on / blocked
 
Reported: 2013-10-21 10:59 UTC by Nan Wei
Modified: 2015-05-14 23:30 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1067257 (view as bug list)
Environment:
Last Closed: 2014-01-24 03:25:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Nan Wei 2013-10-21 10:59:05 UTC
Description of problem:
When creating one app include multi cartridge and add variable by RESTAPI, sync user variable failed to cartridge gear, some error messages as follow: 
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>unprocessable_entity</status>
  <type nil="true"></type>
  <data>
    <datum nil="true"></datum>
  </data>
  <messages>
    <message>
      <severity>error</severity>
      <text>Sync for d0064e3e3a3c11e3944d22000a8a3129@ip-10-138-49-41 user variables failed.
Failed to add the host to the list of known hosts (/var/lib/openshift/526503f4360eee6900000383/.ssh/known_hosts).
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]</text>
      <exit-code>127</exit-code>
      <field nil="true"></field>
      <index nil="true"></index>
    </message>
  </messages>
Version-Release number of selected component (if applicable):
devenv_3921
Client version: rhc 1.16.0
How reproducible:
100%
Steps to Reproduce:
1. Create one app include multi cartridge by RESTAPI and add variable
curl -k -H 'Accept: application/xml' --nwei $user:$pass https://instance/broker/rest/domains/$domain/applications -XPOST -d name=app -d cartridges[]='python-2.7' -d cartridges[]='mysql-5.1' -d scale=true -d environment_variables[][name]=foo -d environment_variables[][value]=123 -d environment_variables[][name]=BAR -d environment_variables[][value]=abc

Actual results:
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>unprocessable_entity</status>
  <type nil="true"></type>
  <data>
    <datum nil="true"></datum>
  </data>
  <messages>
    <message>
      <severity>error</severity>
      <text>Sync for d0064e3e3a3c11e3944d22000a8a3129@ip-10-138-49-41 user variables failed.
Failed to add the host to the list of known hosts (/var/lib/openshift/526503f4360eee6900000383/.ssh/known_hosts).
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]</text>
      <exit-code>127</exit-code>
      <field nil="true"></field>
      <index nil="true"></index>
    </message>
  </messages>
Expected results:
App create successfully and no error messages
Additional info:

Comment 1 Abhishek Gupta 2013-10-21 23:53:41 UTC
Fixed with --> https://github.com/openshift/origin-server/pull/3939

Comment 2 openshift-github-bot 2013-10-22 02:52:31 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/fcae2c3d7778d645758352fcdc6a006d95c29e96
Fix for bug 1020440, 1021041, 1021462, 1021467, and a typo

Comment 3 Abhishek Gupta 2013-10-22 17:01:55 UTC
The ssh keys were not being copied over to the new gear in case of a scalable app being created with multiple gears. This issue has been fixed on the broker side. 

However, the user environment variables can still not be synced and the known_hosts file is empty on the gears. The ssh keys for both gears are present in the authorized_keys file on both gears.

Moving this bug to the runtime team to take a closer look.

Comment 4 openshift-github-bot 2013-10-23 02:41:11 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/8cc56a94dea5b77861299cad4d6bb61179c62848
Bug 1021462 - Pushing user variables failing if haproxy not installed

* Use same ssh settings as haproxy/bin/ssh
  -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=$OPENSHIFT_HOMEDIR/.openshift_ssh/known_hosts
  -F $OPENSHIFT_HOMEDIR/.openshift_ssh/config -i $OPENSHIFT_APP_SSH_KEY

Comment 5 Nan Wei 2013-10-23 09:33:41 UTC
devenv_3934

1.make sure to exist a user and his domain.
2.curl -k -H 'Accept: application/xml' --user nwei:redhat https://ec2-67-202-44-73.compute-1.amazonaws.com/broker/rest/domains/nweit/applications -X POST -d name=app -d cartridges[]='python-2.7' -d cartridges[]='mysql-5.1' -d scale=true -d environment_variables[][name]=foo -d environment_variables[][value]=123 -d environment_variables[][name]=BAR -d environment_variables[][value]=abc

Actual results:
App create successfully and no error messages.

Status: Verified → qa_ack

Comment 7 Rajat Chopra 2013-10-23 21:25:47 UTC
The workaround for this bug is that an app should be created, then cartridge added and then user variables added. 

Doing it all together exposes the issue. The ideal way of doing it all together will be fine after we deploy with the bug fix.

Comment 9 XiuJuan Wang 2013-10-24 08:32:26 UTC
STG

[root@dhcp-10-143 .openshift]# curl -k -H 'Accept:application/xml' --user "xiuwang+1:redhat" https://stg.openshift.redhat.com/broker/rest/domains/wxj/applications -X POST -d name=py27 -d cartridge[]='python-2.7' -d cartridge[]='mysql-5.1' -d scale=true -d environment_variables[][name]=abc -d environment_variables[][value]=123 -d environment_variables[][name]=edf -d environment_variables[][value]=234

Actual results:
App create successfully and no error messages.

[root@dhcp-10-143 .openshift]# rhc env list py27  -l xiuwang+1
abc=123
edf=234

had verified on the STG


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