`juju run-action --wait` returns 0 even when action status=failed

Bug #1775208 reported by Nobuto Murata
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

$ juju version
2.3.8-xenial-amd64

Expected result is non-zero status code when an action failed since "--wait" is supposed to be sync command instead of async without --wait.

How to reproduce:

$ juju deploy --series xenial ceilometer
$ juju run-action --wait ceilometer/0 ceilometer-upgrade --debug
15:11:45 INFO juju.cmd supercommand.go:56 running juju [2.3.8 gc go1.10]
15:11:45 DEBUG juju.cmd supercommand.go:57 args: []string{"/snap/juju/4423/bin/juju", "run-action", "-m", "default", "--wait", "ceilometer/0", "ceilometer-upgrade", "--debug"}
15:11:45 INFO juju.juju api.go:67 connecting to API addresses: [192.168.151.101:17070 192.168.152.101:17070]
15:11:45 DEBUG juju.api apiclient.go:843 successfully dialed "wss://192.168.151.101:17070/model/15652e5e-877f-44ac-8f32-ba698bb49989/api"
15:11:45 INFO juju.api apiclient.go:597 connection established to "wss://192.168.151.101:17070/model/15652e5e-877f-44ac-8f32-ba698bb49989/api"
unit-ceilometer-0:
  id: e75efec6-47bc-4e3b-8bae-7eb8f6ce6d18
  message: The identity-service and or metric-service relations are not complete.
    ceilometer-upgrade cannot be run until they are ready.
  status: failed <<<<<<
  timing:
    completed: 2018-06-05 15:21:42 +0000 UTC
    enqueued: 2018-06-05 15:11:45 +0000 UTC
    started: 2018-06-05 15:21:36 +0000 UTC
  unit: ceilometer/0
15:21:43 DEBUG juju.api monitor.go:35 RPC connection died
15:21:43 INFO cmd supercommand.go:465 command finished

$ echo $?
0

^^^ zero even with status=failed

Revision history for this message
John A Meinel (jameinel) wrote :

I can certainly understand how this would be desirable. I think currently the exit code is only tied to whether we could successfully try to run the action, which was successfully requested, even though the action itself says that it failed.
I wouldn't expect people are currently depending on the return value of run action, so probably we can just change it.

Changed in juju:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: Wishlist → Low
tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.