Bug 839151 - The cartridge hostname is wrong for scalable app in multi node env
The cartridge hostname is wrong for scalable app in multi node env
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Master (Show other bugs)
2.x
Unspecified Unspecified
high Severity low
: ---
: ---
Assigned To: Abhishek Gupta
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-11 02:16 EDT by Rony Gong
Modified: 2015-05-14 20:51 EDT (History)
3 users (show)

See Also:
Fixed In Version: devenv_1886
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-13 19:43:13 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 Rony Gong 2012-07-11 02:16:42 EDT
Description of problem:



Version-Release number of selected component (if applicable):
devenv_1884

How reproducible:


Steps to Reproduce:
1.setup multi node env and create district
2.create scalable app(jbossas), jboss gear and haproxy gear not created in same instance
3.use rest api to get gears informations
4.for jbossas gear, I get gear git_url is:
 <git-url>ssh://4d84e1e0dc874ad99e0963d9d77e8362@jbosstest-qgong3.dev.rhcloud.com/~/git/jbosstest.git/</git-url>

5. I think the hostname of jbosstest-qgong3.dev.rhcloud.com is wrong, 
since jboss gear and haproxy gear are in different instance, so their host name shouldn't be same.


  
Actual results:
[root@localhost rony]# curl -k -X GET -H 'Accept: application/xml' --user qgong2@redhat.com:111111 https://ec2-184-72-77-16.compute-1.amazonaws.com/broker/rest/domains/qgong3/applications/jbosstest/gears
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
  </supported-api-versions>
  <data>
    <gear>
      <git-url>ssh://bb6a965599874ccfb501c2f2be3390e5@jbosstest-qgong3.dev.rhcloud.com/~/git/jbosstest.git/</git-url>
      <uuid>bb6a965599874ccfb501c2f2be3390e5</uuid>
      <components>
        <component>
          <proxy-host>jbosstest-qgong3.dev.rhcloud.com</proxy-host>
          <internal-port>8080</internal-port>
          <proxy-port>38041</proxy-port>
          <name>jbossas-7</name>
        </component>
        <component>
          <proxy-host nil="true"></proxy-host>
          <internal-port nil="true"></internal-port>
          <proxy-port nil="true"></proxy-port>
          <name>haproxy-1.4</name>
        </component>
      </components>
    </gear>
    <gear>
      <git-url>ssh://4d84e1e0dc874ad99e0963d9d77e8362@jbosstest-qgong3.dev.rhcloud.com/~/git/jbosstest.git/</git-url>
      <uuid>4d84e1e0dc874ad99e0963d9d77e8362</uuid>
      <components>
        <component>
          <proxy-host>4d84e1e0dc-qgong3.dev.rhcloud.com</proxy-host>
          <internal-port>8080</internal-port>
          <proxy-port>38046</proxy-port>
          <name>jbossas-7</name>
        </component>
      </components>
    </gear>
  </data>
  <version>1.0</version>
  <type>gears</type>
  <status>ok</status>
  <messages/>
</response>


[root@localhost rony]# ssh 4d84e1e0dc874ad99e0963d9d77e8362@jbosstest-qgong3.dev.rhcloud.com
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).


Expected results:
the jboss gear git-url should be:
<git-url>ssh://4d84e1e0dc874ad99e0963d9d77e8362@4d84e1e0dc-qgong3.dev.rhcloud.com/~/git/jbosstest.git/</git-url>


Additional info:
Comment 1 Rony Gong 2012-07-11 03:06:42 EDT
if embed mysql or mongodb this error sometimes happened for mysql and mongodb, so up the priority.

root@localhost rony]# curl -k -X GET -H 'Accept: application/xml' --user qgong2@redhat.com:111111 https://ec2-184-72-77-16.compute-1.amazonaws.com/broker/rest/domains/qgong3/applications/jbosstest/gears
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
  </supported-api-versions>
  <data>

    <gear>
      <git-url>ssh://bb6a965599874ccfb501c2f2be3390e5@jbosstest-qgong3.dev.rhcloud.com/~/git/jbosstest.git/</git-url>
      <uuid>bb6a965599874ccfb501c2f2be3390e5</uuid>
      <components>
        <component>
          <proxy-host>jbosstest-qgong3.dev.rhcloud.com</proxy-host>
          <internal-port>8080</internal-port>
          <proxy-port>38041</proxy-port>
          <name>jbossas-7</name>
        </component>
        <component>
          <proxy-host nil="true"></proxy-host>
          <internal-port nil="true"></internal-port>
          <proxy-port nil="true"></proxy-port>
          <name>haproxy-1.4</name>
        </component>
      </components>
    </gear>
    <gear>
      <git-url>ssh://4627be68bc8647588f5b796bee84a963@jbosstest-qgong3.dev.rhcloud.com/~/git/jbosstest.git/</git-url>
      <uuid>4627be68bc8647588f5b796bee84a963</uuid>
      <components>
        <component>
          <password>FxQrE4_j_lgk</password>
          <connection-url>mongodb://4627be68bc-qgong3.dev.rhcloud.com:38066/</connection-url>
          <database-name>jbosstest</database-name>
          <username>admin</username>
          <proxy-host>4627be68bc-qgong3.dev.rhcloud.com</proxy-host>
          <internal-port>27017</internal-port>
          <proxy-port>38066</proxy-port>
          <name>mongodb-2.0</name>
        </component>
      </components>
    </gear>
    <gear>
      <git-url>ssh://4d84e1e0dc874ad99e0963d9d77e8362@jbosstest-qgong3.dev.rhcloud.com/~/git/jbosstest.git/</git-url>
      <uuid>4d84e1e0dc874ad99e0963d9d77e8362</uuid>
      <components>
        <component>
          <proxy-host>4d84e1e0dc-qgong3.dev.rhcloud.com</proxy-host>
          <internal-port>8080</internal-port>
          <proxy-port>38046</proxy-port>
          <name>jbossas-7</name>
        </component>
      </components>
    </gear>
  </data>
  <version>1.0</version>
  <type>gears</type>
  <status>ok</status>
  <messages/>
</response>
Comment 2 Dan McPherson 2012-07-11 09:44:52 EDT
I am not sure why this was transferred to broker.  If there was a reason let me know.

But looking at the above it appears to be a rest api issue.  Namely with a scaled app the git url should only show up for the gear with haproxy.
Comment 3 Dan McPherson 2012-07-11 09:46:02 EDT
Or another option is if you do want the git url to show up for all gears it should be the same as the one with haproxy for all gears.
Comment 4 Abhishek Gupta 2012-07-11 13:31:50 EDT
The git url is also present in the application response object. Given that it is an application level thing, can we just get rid of it at the gear level? Do we expect any users to be using git_url from the gears rest api?

Short of that, I would say just make them all the same as the haproxy gear.
Comment 5 Abhishek Gupta 2012-07-11 14:50:31 EDT
I'm picking this one up. We've decided in the meeting to get rid of the git_url attribute from the /gears rest api.

Pull request coming shortly.
Comment 6 Abhishek Gupta 2012-07-11 17:25:49 EDT
https://github.com/openshift/crankcase/pull/223
Comment 7 Rony Gong 2012-07-12 05:47:13 EDT
Verified on devenv_stg_223, removed the git_url

[root@localhost rony]# curl -k -X GET -H 'Accept: application/xml' --user qgong@redhat.com:111111 https://ec2-107-22-43-0.compute-1.amazonaws.com/broker/rest/domains/qgong/applications/riq05w4ffk/gears
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>ok</status>
  <version>1.1</version>
  <data>
    <gear>
      <uuid>aa2d57168d7047bd99e6005b2e2ab4fe</uuid>
      <components>
        <component>
          <proxy-host>riq05w4ffk-qgong.dev.rhcloud.com</proxy-host>
          <name>python-2.6</name>
          <internal-port>8080</internal-port>
          <proxy-port>35546</proxy-port>
        </component>
        <component>
          <proxy-host nil="true"></proxy-host>
          <name>haproxy-1.4</name>
          <internal-port nil="true"></internal-port>
          <proxy-port nil="true"></proxy-port>
        </component>
      </components>
    </gear>
    <gear>
      <uuid>b70d8a3efbae403d9094b70ab14374db</uuid>
      <components>
        <component>
          <database-name>riq05w4ffk</database-name>
          <password>yf9ixRQVPe7y</password>
          <username>admin</username>
          <connection-url>mongodb://b70d8a3efb-qgong.dev.rhcloud.com:35551/</connection-url>
          <proxy-host>b70d8a3efb-qgong.dev.rhcloud.com</proxy-host>
          <name>mongodb-2.0</name>
          <internal-port>27017</internal-port>
          <proxy-port>35551</proxy-port>
        </component>
      </components>
    </gear>
    <gear>
      <uuid>86428379cd3d4afbade2dbfe674f7d6e</uuid>
      <components>
        <component>
          <proxy-host>86428379cd-qgong.dev.rhcloud.com</proxy-host>
          <name>python-2.6</name>
          <internal-port>8080</internal-port>
          <proxy-port>35541</proxy-port>
        </component>
      </components>
    </gear>
  </data>
  <type>gears</type>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
  </supported-api-versions>
  <messages/>
</response>

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