The Puppet Labs Issue Tracker has Moved:

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using See the following page for information on filing tickets with JIRA:

Bug #18399

Empty resource collectors can break long relationship chains

Added by Martin Collins over 3 years ago. Updated over 2 years ago.

Status:UnreviewedStart date:
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Affected Puppet version: Branch:

We've Moved!

Ticket tracking is now hosted in JIRA:

This ticket is now tracked at:



When using chained resources, with a collection within the string, if the collection is empty, the chain is broken and the resources either side do not depend on each other.



class test {
  $cr = ["1", "2"]

    command => "/bin/true"

    command => "/bin/true"

  test::test{$cr: }

    -> Exec<| tag == 'inter' |> 
      -> Exec["post"]


define test::test{
  exec{"echo $name":
    command => "/bin/echo $name",
    tag     => "inter"

Run as is:


If we comment out:

test::test{$cr: }

So it is empty, we get “empty_collection.jpg”, this:


To get the desired result and what I would have expected as the default, I have to manually add another relationship between “pre” and “post” to cater for the empty collection.

  -> Exec<| tag == 'inter' |> 
    -> Exec["post"]

  -> Exec["post"]

Resulting in:


Is this the intended behaviour? I would expect the workaround relationship to be implicit (Pre –> a collection that happens to be empty –> post), as I do not know how many tags of “inter” will be created (in my real use, this is pulled from hiera)

Thanks, Martin

non_empty_collection.jpg (24.5 KB) Martin Collins, 01/07/2013 09:35 am

empty_collection.jpg (8.69 KB) Martin Collins, 01/07/2013 09:35 am

workaround.jpg (11.4 KB) Martin Collins, 01/07/2013 09:35 am


#1 Updated by Adrien Thebo over 2 years ago

  • Project changed from Puppet Documentation to Puppet

#2 Updated by Nick Fagerlund over 2 years ago

Yo, that is completely wacky and is almost definitely not intended behavior. Thanks for spotting it. We’ve moved it to a puppet issue, and I’ve made a note in the docs on chaining arrows about it.

#3 Updated by Nick Fagerlund over 2 years ago

  • Subject changed from Chained resources with empty collections to Empty resource collectors can break long relationship chains

#4 Updated by Martin Collins over 2 years ago

Redmine Issue #18399 has been migrated to JIRA:

Also available in: Atom PDF