Bug 965804 - Client messages from the node not returned to the client on app destroy
Client messages from the node not returned to the client on app destroy
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Clayton Coleman
libra bugs
:
Depends On:
Blocks: 970664
  Show dependency treegraph
 
Reported: 2013-05-21 14:55 EDT by Dan Mace
Modified: 2015-05-14 22:22 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 970664 (view as bug list)
Environment:
Last Closed: 2013-06-24 10:49:18 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 Dan Mace 2013-05-21 14:55:05 EDT
Description of problem:

Client messages returned from the node to the broker via 'CLIENT_MESSAGE' output is not passed through to the rhc client during 'app-destroy' operations.


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


How reproducible:

Create an an application with a cartridge which produces output during deconfigure. Delete the application. Observe the lack of client output.


Steps to Reproduce:
1. Create a jenkins application.
2. Create a PHP application with the jenkins-client cartridge embedded.
3. Destroy the PHP application.

Actual results:

MCollective output:

I, [2013-05-21T12:25:22.141050 #11009]  INFO -- : openshift.rb:43:in `cartridge_do_action' cartridge_do_action call / action: cartridge_do, agent=openshift, data={:cartridge=>"openshift-origin-node",
 :action=>"app-destroy",
 :args=>
  {"--with-app-uuid"=>"519b9fb7142fd82aca000001",
   "--with-app-name"=>"phpjenk",
   "--with-container-uuid"=>"519b9fb7142fd82aca000001",
   "--with-container-name"=>"phpjenk",
   "--with-namespace"=>"dmace280",
   "--with-request-id"=>"b4f2e3e6ae237d5f12bcdf4b397a72ad",
   "--cart-name"=>"openshift-origin-node"},
 :process_results=>true}

I, [2013-05-21T12:25:22.141444 #11009]  INFO -- : openshift.rb:44:in `cartridge_do_action' cartridge_do_action validation = openshift-origin-node app-destroy {"--with-app-uuid"=>"519b9fb7142fd82aca000001", "--with-app-name"=>"phpjenk", "--with-container-uuid"=>"519b9fb7142fd82aca000001", "--with-container-name"=>"phpjenk", "--with-namespace"=>"dmace280", "--with-request-id"=>"b4f2e3e6ae237d5f12bcdf4b397a72ad", "--cart-name"=>"openshift-origin-node"}
I, [2013-05-21T12:25:22.141735 #11009]  INFO -- : openshift.rb:83:in `execute_action' Executing action [app-destroy] using method oo_app_destroy with args [{"--with-app-uuid"=>"519b9fb7142fd82aca000001", "--with-app-name"=>"phpjenk", "--with-container-uuid"=>"519b9fb7142fd82aca000001", "--with-container-name"=>"phpjenk", "--with-namespace"=>"dmace280", "--with-request-id"=>"b4f2e3e6ae237d5f12bcdf4b397a72ad", "--cart-name"=>"openshift-origin-node"}]
I, [2013-05-21T12:25:26.344834 #11009]  INFO -- : openshift.rb:92:in `execute_action' Finished executing action [app-destroy] (0)
I, [2013-05-21T12:25:26.345089 #11009]  INFO -- : openshift.rb:63:in `cartridge_do_action' cartridge_do_action reply (0):
------
CLIENT_RESULT: The corresponding job 'phpjenk-build' in Jenkins has been disabled.
CLIENT_RESULT: You can re-enable or delete as desired.
CLIENT_RESULT: Job URL: https://jenkins-dmace280.dev.rhcloud.com/job/phpjenk-build/
CLIENT_RESULT: Jenkins client 1.4 has been removed from: phpjenk

------)

Client output:

$ rhc app-delete phpjenk -pp --confirm
Deleting application 'phpjenk' ... deleted


Expected results:

Client output:

$ rhc app-delete phpjenk -pp --confirm
Deleting application 'phpjenk' ... deleted

The corresponding job 'phpjenk-build' in Jenkins has been disabled.
You can re-enable or delete as desired.
Job URL: https://jenkins-dmace280.dev.rhcloud.com/job/phpjenk-build/
Jenkins client 1.4 has been removed from: phpjenk

Additional info:
Comment 1 Lili Nader 2013-05-22 19:44:52 EDT
This is not a new bug.  This has been broken for a while.  Can we live it for one more sprint. I would like to put in a more comprehensive fix.
Comment 3 zhaozhanqi 2013-06-04 23:08:20 EDT
Tested this issue on devenv_3319, it still could be reproduced.

steps: 

 1) create jenkins server app
 2) create php cartridge app and with jenkins embedded.
 3) delete the php app
 
  actual result:
  
 [zqzhao@dhcp-13-222 myshell]$ rhc app delete zqphp --confirm
   Deleting application 'zqphp' ... deleted

   expect result:

   [zqzhao@dhcp-13-222 myshell]$ rhc app delete zqphp --confirm
   Deleting application 'zqphp' ... deleted

  The corresponding job 'zqphp-build' in Jenkins has been disabled.
 You can re-enable or delete as desired.
Job URL:https://zqjenkins-zqd.dev.rhcloud.com/job/zqphp-build/
Jenkins client 1.4 has been removed from: zqphp
Comment 4 Lili Nader 2013-06-05 13:57:41 EDT
I am guessing the rhc client tools are still using REST API 1.4 or earlier.  In order to get the response from node on app delete the client tools need to switch to 1.5 (current) version.
Comment 5 zhaozhanqi 2013-06-07 02:40:13 EDT
The following is testing on devenv_3329 .
destroy one app with jenkins embedded use rest api:

the result also have not we expect:

The corresponding job 'zqphp-build' in Jenkins has been disabled.
 You can re-enable or delete as desired.
Job URL:https://zqjenkins-zqd.dev.rhcloud.com/job/zqphp-build/
Jenkins client 1.4 has been removed from: zqphp



[zqzhao@dhcp-13-222 myshell]$ curl -k -H 'Accept: application/xml' --user zzhao@redhat.com:redhat https://ec2-23-22-66-250.compute-1.amazonaws.com/broker/rest/domains/zqd/applications/zqphp -X DELETE
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>ok</status>
  <type nil="true"></type>
  <data>
    <datum nil="true"></datum>
  </data>
  <messages>
    <message>
      <severity>info</severity>
      <text>Application zqphp is deleted.</text>
      <exit-code nil="true"></exit-code>
      <field nil="true"></field>
    </message>
  </messages>
  <version>1.5</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-versions>
  <errors/>
</response>
Comment 6 Clayton Coleman 2013-06-12 15:44:10 EDT
That comment is to the REST API - we're handling 1.5 in a different pull.
Comment 7 Lili Nader 2013-06-18 01:57:58 EDT
After this pull request merges

https://github.com/openshift/origin-server/pull/2875

The rest api will return the correct result from destroying apps with jenkins client cartridge (shown below).  However, the client tools still do not show this message.  Assigning to CLI team to fix the last piece to make this work.

{
  "api_version": 1.5,
  "data": null,
  "errors": {
    
  },
  "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Application happ is deleted."
    },
    {
      "exit_code": 0,
      "field": null,
      "severity": "result",
      "text": "The corresponding job 'happ-build' in Jenkins has been disabled.\nYou can re-enable or delete as desired.\nJob URL: https://app-lnader.dev.rhcloud.com/job/happ-build/\nJenkins client 1.4 has been removed from: happ\n"
    }
  ],
  "status": "ok",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5
  ],
  "type": null,
  "version": "1.5"
}
Comment 9 Clayton Coleman 2013-06-18 15:21:33 EDT
RHC changes are in https://github.com/openshift/rhc/pull/407
Comment 10 openshift-github-bot 2013-06-18 21:27:39 EDT
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/403b65d87b3315a68824c502eb2948d1c32d2132
Bug 965804 - Display results when a cartridge or application is removed

Upgrade client to 1.5.  Older servers will NOT retrieve results.
Comment 11 Wei Sun 2013-06-19 02:31:47 EDT
Verified on INT(devenv_3382),rhc is build from devenv_3383.

Result:
1.client
[sunwei@dhcp-8-229 ~]$ rhc app-delete jb
This is a non-reversible action! Your application code and data will be permanently deleted if you continue!

Are you sure you want to delete the application 'jb'? (yes|no): yes

Deleting application 'jb' ... deleted

Application jb is deleted.
The corresponding job 'jb-build' in Jenkins has been disabled.
You can re-enable or delete as desired.
Job URL: https://jks-wsun1int.int.rhcloud.com/job/jb-build/
Jenkins client 1.4 has been removed from: jb

2.RESTAPI
 <messages>
    <message>
      <severity>info</severity>
      <text>Application jbs is deleted.</text>
      <exit-code>0</exit-code>
      <field nil="true"></field>
    </message>
    <message>
      <severity>result</severity>
      <text>The corresponding job 'jbs-build' in Jenkins has been disabled.
You can re-enable or delete as desired.
Job URL: https://jks-wsun1int.int.rhcloud.com/job/jbs-build/
Jenkins client 1.4 has been removed from: jbs
</text>
      <exit-code>0</exit-code>
      <field nil="true"></field>
    </message>
 </messages>

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