Description of problem: 'rhc cartridge reload X -a Y' either bombs spectacularly, or displays 'X reloaded' even when it shouldn't. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Create a jbossas-7 app 2. Sync origin-server repo with https://github.com/BanzaiMan/origin-server/tree/dev/hasari/rhc_cartridge_reload_bug (near devenv_3450) 3. stop postgresql cart, then reload. Actual results: $ bx bin/rhc cartridge reload postgresql-9.2 -a j7 RESULT: postgresql-9.2 reloaded Expected results: $ bx bin/rhc cartridge reload postgresql-9.2 -a j7 RESULT: 'reload' is valid only when the database is running (or something similar) Additional info: As of this writing, 'cartridge reload' does not consider the action's result: https://github.com/openshift/rhc/blob/93edcae96c3b135a0aedaf1b8f8d17064a419f40/lib/rhc/commands/cartridge.rb#L183-L186
Once https://bugzilla.redhat.com/show_bug.cgi?id=981774 is fixed, there is no reason to sync up with https://github.com/BanzaiMan/origin-server/tree/dev/hasari/rhc_cartridge_reload_bug, but use the master from openshift/origin-server.
Fixed in https://github.com/openshift/rhc/pull/421
Commit pushed to master at https://github.com/openshift/rhc https://github.com/openshift/rhc/commit/50e0ab953bdc12a4d359df6579538f35dad8fa4a Bug 981780 - Filter broker results more effectively, and display results on cartridge actions
This only shows CLIENT_RESULT, right? Everything else—CLIENT_MESSAGE, CLIENT_ERROR and others—are not getting displayed by CLI, only in the platform-trace.log. We can use CLIENT_RESULT, I guess, but this seems semantically incorrect in some cases.
https://github.com/openshift/origin-server/pull/3020 shows this problem with the postgresql cartridge. see https://gist.github.com/BanzaiMan/b916cd695e2b7dc31db4 for logs.
https://github.com/openshift/origin-server/pull/3020 was updated to use client_result for now. That should be good enough for this ticket.
verified on devenv_3481 rhc-1.11.4 Reload psql( postgresql-8.4/postgresql-9.2) can show the message "'reload' is valid only when the database is running" after stop psql cartridge steps to verified: 1. rhc app create -a jboss7 jbossas-7 postgresql-8.4 2. rhc cartridge stop -a jboss7 -c postgresql-8.4 3. rhc cartridge reload -a jboss7 -c postgresql-8.4 [root@localhost ~]# rhc cartridge stop -a jboss7 -c postgresql-8.4 Stopping postgresql-8.4 ... done [root@localhost ~]# rhc cartridge reload -a jboss7 -c postgresql-8.4 Reloading postgresql-8.4 ... done 'reload' is valid only when the database is running [root@localhost ~]# cstop -a jboss7n -c postgresql-9.2 Stopping postgresql-9.2 ... done [root@localhost ~]# creload -a jboss7n -c postgresql-9.2 Reloading postgresql-9.2 ... done 'reload' is valid only when the database is running move to verified.
sorry for my careless,retest on devenv-stage_404,got below result [root@localhost ~]# rhc cartridge reload -a jboss7 -c postgresql-8.4 Reloading postgresql-8.4 ... done 'reload' is valid only when the database is running if 'reload' is valid only when the database is running, then the message "Reloading postgresql-8.4 ... done" should not show. it is conflicting.
https://github.com/openshift/rhc/blob/e640a8724147604b2b8e57306c438f4926a3a919/lib/rhc/commands/cartridge.rb#L322-L325 Currently, CLI's `cartridge` command assumes that all subcommands succeed, and there is no way for the runtime to communicate the error condition. Additionally, postgresql's reload requiring the cartridge being down is something of an anomaly, so it is not a good idea to deal with this special case on the client side. One thing we can do is to exit with a nonzero status after using "client_error" to set the message. However, the message doesn't show up nicely on the client side; something is trimming the trailing white spaces, so that the message looks weird. (I haven't figured out what is doing this.) $ bx bin/rhc cartridge reload postgresql-9.2 -a rack Reloading postgresql-9.2 ... 'reload' is valid only when the database is running.Unable to complete the requested operation due to: Failed to correctly execute all parallel operations. Reference ID: fb879a215759f75654f6c879d61cd16c
The broker issues highlighted in comment 9 should be fixed with --> https://github.com/openshift/origin-server/pull/3708
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/c2e9b8176b527c27caaf63a9a76177fa9bddbd58 Bug 981780 - Fail reload if database is not running
Checked on devenv_3833, issue has been fixed. [bmeng@localhost devtest]$ rhc cartridge-reload postgres -a php1 Using postgresql-9.2 (PostgreSQL Database 9.2) for 'postgres' Reloading postgresql-9.2 ... 'reload' is valid only when the database is running