Jira (PUP-11074) Add catalog edge only if parent resource has a container

17 views
Skip to first unread message

Gabriel Nagy (Jira)

unread,
May 28, 2021, 1:27:28 PM5/28/21
to puppe...@googlegroups.com
Gabriel Nagy created an issue
 
Puppet / Bug PUP-11074
Add catalog edge only if parent resource has a container
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/05/27 7:33 AM
Priority: Normal Normal
Reporter: Gabriel Nagy

Puppet Version: 7.7.0/6.23.0
Puppet Server Version: n/a
OS Name/Version: n/a

Managing resources with generators behaves differently with puppet resource and puppet apply.

When running with puppet apply, the parent resource is always contained by something like Class[Main], so adding an edge between that and our generated resource works.

When running with puppet resource, the parent resource is not contained by anything (container_of(parent_resource) returns nil), which adds an edge with a nil vertex to the catalog. This in turn causes the run to fail with a NilClass exception when performing pre-run checks in the Transaction class, as the catalog now contains a nil vertex.

Desired Behavior:

Running the following does not error:

> touch /tmp/asd
> puppet resource tidy /tmp/asd age=0 --trace

Actual Behavior:

Running the above example gives the following error:

Error: Could not run: undefined method `pre_run_check' for nil:NilClass
/root/puppet/lib/puppet/transaction.rb:82:in `block in perform_pre_run_checks'
/root/puppet/lib/puppet/transaction.rb:78:in `each'
/root/puppet/lib/puppet/transaction.rb:78:in `perform_pre_run_checks'
/root/puppet/lib/puppet/transaction.rb:104:in `evaluate'
/root/puppet/lib/puppet/resource/catalog.rb:240:in `block (2 levels) in apply'
[snip]

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Ciprian Badescu (Jira)

unread,
May 31, 2021, 3:29:04 AM5/31/21
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Jun 1, 2021, 10:31:03 AM6/1/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jun 2, 2021, 4:57:01 AM6/2/21
to puppe...@googlegroups.com

Gabriel Nagy (Jira)

unread,
Jun 2, 2021, 11:07:02 AM6/2/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 3, 2021, 12:20:02 PM6/3/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.8.0
Fix Version/s: PUP 6.23.0

Gabriel Nagy (Jira)

unread,
Jun 8, 2021, 4:18:04 AM6/8/21
to puppe...@googlegroups.com

Gabriel Nagy (Jira)

unread,
Jun 8, 2021, 8:38:04 AM6/8/21
to puppe...@googlegroups.com
Gabriel Nagy updated an issue
 
Change By: Gabriel Nagy
Release Notes: Bug Fix
Release Notes Summary: Due to the presence of a nil vertex in the catalog, managing resources that call the `generate` method (such as `tidy`) would fail when using the `puppet resource` subcommand. This has been fixed by ensuring that nil vertices are never added to the catalog.

Christine Yoon (Jira)

unread,
Jun 21, 2021, 10:22:02 AM6/21/21
to puppe...@googlegroups.com

Christine Yoon (Jira)

unread,
Jun 21, 2021, 3:59:01 PM6/21/21
to puppe...@googlegroups.com
Christine Yoon updated an issue
Change By: Christine Yoon
Labels: doc_reviewed docs-reviewed
Reply all
Reply to author
Forward
0 new messages