juju-run can not be invoked from within an action
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
Given the following topology:
environment: local
machines:
"8":
agent-state: started
agent-version: 1.23-beta3.1
dns-name: 10.0.3.76
instance-id: marco-local-
series: trusty
hardware: arch=amd64
services:
cassandra:
charm: local:trusty/
exposed: false
relations:
cluster:
- cassandra
juju-info:
- collectd
units:
cassandra/0:
machine: "8"
open-ports:
- 7199/tcp
- 9160/tcp
collectd:
charm: local:trusty/
exposed: false
relations:
benchmark:
- cassandra
- pts
collector:
- cabs
profiler:
- collectd
subordinate-to:
- cassandra
- pts
When issuing the following command
juju-run collectd/6 "relation-ids profiler --format=json"
from an action within the cassandra charm, juju yields the following error:
error: juju-run cannot be called from within a hook, have context "cassandra/
I have a need to execute juju-run against a subordinate in my environment but can not do it from an action. This restriction seems to be scoped to "hooks" but does not take into consideration actions and other items which /may/ be hooks but operate differently from the hooks. Actions are an extension of the user as such actions scoped hooks should be able to execute juju-run. In this example they need to be able to execute juju-run.
tags: | added: action run |
tags: |
added: actions removed: action |
Changed in juju-core: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in juju-core: | |
status: | Triaged → Won't Fix |
The reason you can't do that is because it would deadlock: you can't start running another hook/action/ whatever context until the currently-executing one gives up the machine lock. What are you trying to accomplish here?
(For the same reason, running actions across relations is... uh, tricky, at best.)