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:
Fixed with --> https://github.com/openshift/origin-server/pull/3939
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
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.
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
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
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.
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