Jira (PUP-9996) Stdlib : ensure_resources function does not throw an error if dependent resource type is missing

0 views
Skip to first unread message

Patrick Grant (JIRA)

unread,
Sep 4, 2019, 10:40:05 AM9/4/19
to puppe...@googlegroups.com
Patrick Grant created an issue
 
Puppet / Bug PUP-9996
Stdlib : ensure_resources function does not throw an error if dependent resource type is missing
Issue Type: Bug Bug
Assignee: Unassigned
Attachments: 201910agenttest.txt, 201910applytest.txt, ensure_resources.txt
Created: 2019/09/04 7:39 AM
Priority: Normal Normal
Reporter: Patrick Grant

Basic Info
Module Version: puppetlabs-stdlib (v6.0.0)
Puppet Version: PE 2018, (5.5.14)
OS Name/Version: RHEL 7 agent

Replication...

Install the inifile module (puppetlabs-inifile (v3.1.0)) on a Master and use the following test code to apply a file to my test agent:

class ensurerestest{
 
ensure_resources ('ini_setting', {'sample' => {'ensure' => 'present', 'path' => '/tmp/foo.ini', 'section' => 'bar', 'setting' => 'baz', 'value' => 'quux'}})
 
}

Next, I run the code on my agent and it applies the file just fine:

[root@kpnk72tadahzkhg ~]# puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Info: Caching catalog for kpnk72tadahzkhg.delivery.puppetlabs.net
Info: Applying configuration version '1566905395'
Notice: /Stage[main]/Ensurerestest/Ini_setting[sample]/ensure: created
Notice: Applied catalog in 0.05 seconds

Next, uninstall the inifile module from your Master, and remove the /tmp/foo.ini file from the agent.

Do a puppet run and nothing happens. The file doesn't get recreated and it throws no error regarding the missing inifile resource type:

[root@kpnk72tadahzkhg ~]# puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Info: Caching catalog for kpnk72tadahzkhg.delivery.puppetlabs.net
Info: Applying configuration version '1566907718'
Notice: Applied catalog in 0.05 seconds

Desired Behavior: Agent tries to create the resource and an error should be thrown when the infile provider isn't found, something like the classic Evaluation Error: "Error while evaluating a Function Call, Unknown resource type: 'ini_setting'"

Actual Behavior: The agent just runs, the resource doesn't get created and no error is thrown about the missing resource type

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Patrick Grant (JIRA)

unread,
Sep 4, 2019, 10:46:03 AM9/4/19
to puppe...@googlegroups.com
Patrick Grant commented on Bug PUP-9996
 
Re: Stdlib : ensure_resources function does not throw an error if dependent resource type is missing

Tested on PE 2019.1.0, (Puppet 6.4.2) Following my documented replication steps I was able to recreate.

Following similar steps to TP's puppet apply replication, I could not. Both attempts are attached in 201910agenttest.txt 201910applytest.txt

Seems to be more of an issue with puppet apply vs puppet agent from these replications and having spoken to Thomas Honey i've cloned this to the puppet project

Patrick Grant (JIRA)

unread,
Sep 6, 2019, 8:19:04 AM9/6/19
to puppe...@googlegroups.com

Jarret Lavallee (JIRA)

unread,
Sep 12, 2019, 7:27:03 PM9/12/19
to puppe...@googlegroups.com

Jarret Lavallee (JIRA)

unread,
Sep 12, 2019, 7:49:02 PM9/12/19
to puppe...@googlegroups.com

Jarret Lavallee (JIRA)

unread,
Sep 12, 2019, 7:53:03 PM9/12/19
to puppe...@googlegroups.com
Jarret Lavallee commented on Bug PUP-9996
 
Re: Stdlib : ensure_resources function does not throw an error if dependent resource type is missing

Patrick Grant Does the replication require the module to have been installed at some point and then removed? Are you able to reproduce it if you restart puppetserver after removing the module? Can you reproduce it with code manager/environment isolation configured?

It seems like this could simply be due to Jruby caching the ruby types and would not be seen with environment isolation in place.

Patrick Grant (JIRA)

unread,
Sep 18, 2019, 12:55:03 PM9/18/19
to puppe...@googlegroups.com
Patrick Grant commented on Bug PUP-9996

Thanks Jarret, finally got another chance at a replication today and restarting the puppetserver solves this particular issue. As soon as I did, the correct error was presented, I will close the ticket.

Reply all
Reply to author
Forward
0 new messages