juju-run can not be invoked from within an action

Bug #1440445 reported by Marco Ceppi
10
This bug affects 2 people
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-machine-8
    series: trusty
    hardware: arch=amd64
services:
  cassandra:
    charm: local:trusty/cassandra-6
    exposed: false
    relations:
      cluster:
      - cassandra
      juju-info:
      - collectd
    units:
      cassandra/0:
        agent-state: started
        agent-version: 1.23-beta3.1
        machine: "8"
        open-ports:
        - 7199/tcp
        - 9160/tcp
        public-address: 10.0.3.76
        subordinates:
          collectd/6:
            upgrading-from: local:trusty/collectd-3
            agent-state: started
            agent-version: 1.23-beta3.1
            public-address: 10.0.3.76
  collectd:
    charm: local:trusty/collectd-3
    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/0-stress-2175131838902070841"

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: actions run
Curtis Hovey (sinzui)
tags: added: action run
tags: added: actions
removed: action
Changed in juju-core:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
William Reade (fwereade) wrote :

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.)

Changed in juju-core:
status: Triaged → Won't Fix
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.