Jira (PUP-9694) Ini_setting resource default statement fails on Puppet 6.4.1

12 views
Skip to first unread message

Ryan Coleman (JIRA)

unread,
May 7, 2019, 6:16:04 PM5/7/19
to puppe...@googlegroups.com
Ryan Coleman created an issue
 
Puppet / Bug PUP-9694
Ini_setting resource default statement fails on Puppet 6.4.1
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2019/05/07 3:15 PM
Priority: Normal Normal
Reporter: Ryan Coleman

Puppet Version: 6.4.1**
OS Name/Version: CentOS 7

I have a bit of Puppet code that includes a locally scoped Ini_setting resource default statement. https://gist.github.com/ryanycoleman/0a444e4dfdb568eb3080a9e038347e41

Desired Behavior:

The resource default statements for Ini_setting are honored, reducing lines of code in the manifest.

Actual Behavior:

[root@pe-lovejoy production]# /opt/puppetlabs/bin/puppet apply -e 'include profile::sssd_ldap' --modulepath=/etc/puppetlabs/code/environments/production/modules:/etc/puppetlabs/code/environments/production/site/
/opt/puppetlabs/puppet/cache/lib/puppet_x/chocolatey/chocolatey_version.rb:8: warning: already initialized constant PuppetX::Chocolatey::ChocolateyVersion::OLD_CHOCO_MESSAGE
/etc/puppetlabs/code/environments/production/modules/chocolatey/lib/puppet_x/chocolatey/chocolatey_version.rb:8: warning: previous definition of OLD_CHOCO_MESSAGE was here
Warning: Undefined variable '::datacenter';
(file & line not available)
Warning: This method is deprecated, please use the stdlib validate_legacy function,
with Pattern[]. There is further documentation for validate_legacy function in the README. at ["/etc/puppetlabs/code/environments/production/modules/sssd/manifests/init.pp", 125]:["unknown", 1]
(location: /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:28:in `deprecation')
Notice: Compiled catalog for pe-lovejoy.p9.puppet.net in environment production in 0.21 seconds
Error: Could not autoload puppet/type/ini_setting: Attempt to redefine entity 'http://puppet.com/2016.1/runtime/type/ini_setting'. Set at unknown location
Error: Could not autoload puppet/type/ini_setting: Attempt to redefine entity 'http://puppet.com/2016.1/runtime/type/ini_setting'. Set at unknown location

The last two lines being the most relevant to the problem I've encountered. I'm using puppetlabs-inifile (v3.0.0)

 

Removing the resource default statement and using its parameters explicitly in each ini_setting resource resolved the issue. Based on our documentation, I expected this to work: https://puppet.com/docs/puppet/6.4/lang_defaults.html

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

Ryan Coleman (JIRA)

unread,
May 7, 2019, 6:17:03 PM5/7/19
to puppe...@googlegroups.com
Ryan Coleman updated an issue
Change By: Ryan Coleman
*Puppet Version: 6.4.1 (via PE build 2019.2.0-rc1-10-gda2ce48) * **
*OS Name/Version: CentOS 7*

I have a bit of Puppet code that includes a locally scoped Ini_setting resource default statement.
[ https://gist.github.com/ryanycoleman/0a444e4dfdb568eb3080a9e038347e41 ]

*Desired Behavior:*


The resource default statements for Ini_setting are honored, reducing lines of code in the manifest.



*Actual Behavior:*
{quote}[root@pe-lovejoy production]# /opt/puppetlabs/bin/puppet apply -e 'include profile::sssd_ldap' --modulepath=/etc/puppetlabs/code/environments/production/modules:/etc/puppetlabs/code/environments/production/site/

/opt/puppetlabs/puppet/cache/lib/puppet_x/chocolatey/chocolatey_version.rb:8: warning: already initialized constant PuppetX::Chocolatey::ChocolateyVersion::OLD_CHOCO_MESSAGE
/etc/puppetlabs/code/environments/production/modules/chocolatey/lib/puppet_x/chocolatey/chocolatey_version.rb:8: warning: previous definition of OLD_CHOCO_MESSAGE was here
Warning: Undefined variable '::datacenter';
(file & line not available)
Warning: This method is deprecated, please use the stdlib validate_legacy function,
with Pattern[]. There is further documentation for validate_legacy function in the README. at ["/etc/puppetlabs/code/environments/production/modules/sssd/manifests/init.pp", 125]:["unknown", 1]
(location: /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:28:in `deprecation')
Notice: Compiled catalog for pe-lovejoy.p9.puppet.net in environment production in 0.21 seconds
Error: Could not autoload puppet/type/ini_setting: Attempt to redefine entity 'http://puppet.com/2016.1/runtime/type/ini_setting'. Set at unknown location
Error: Could not autoload puppet/type/ini_setting: Attempt to redefine entity 'http://puppet.com/2016.1/runtime/type/ini_setting'. Set at unknown location
{quote}

The last two lines being the most relevant to the problem I've encountered. I'm using puppetlabs-inifile (v3.0.0)

 

Removing the resource default statement and using its parameters explicitly in each ini_setting resource resolved the issue. Based on our documentation, I expected this to work:

Henrik Lindberg (JIRA)

unread,
May 7, 2019, 6:56:03 PM5/7/19
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug PUP-9694
 
Re: Ini_setting resource default statement fails on Puppet 6.4.1

Do you have any information if this is a recent breakage? I.e. did it work on earlier version in 6.x or 5.x?
If you have a stacktrace from that error it would be useful (primarily to determine if it is an error from a recursive load, or a sequence type definitions).

Does the problem go away if you use `puppet generate types` (to avoid loading the actual resource type implementation and possibly a provider for it).

Note to someone looking at this problem: Earlier, an error like this has been seen when using the Resource Ruby class. See this PR: https://github.com/puppetlabs/puppet/pull/7162/files (it may be unrelated).

Josh Cooper (JIRA)

unread,
May 8, 2019, 2:11:05 PM5/8/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9694

This may be a duplicate of PUP-9602. Do you have generated resource types in /etc/puppetlabs/code/environments/production/.resource_types? I assume yes, because code manager?

Ryan Coleman (JIRA)

unread,
May 8, 2019, 2:16:04 PM5/8/19
to puppe...@googlegroups.com
Ryan Coleman commented on Bug PUP-9694

Katie Lawhorn can confirm if I'm wrong but I believe it was working with PE Kearney which is Puppet 6.0.9 AFAIK. I didn't try to use `puppet generate types` and unfortunately won't have time soon to reproduce. Feel free to close/cant-reproduce if that's necessary.

Katie Lawhorn (JIRA)

unread,
May 8, 2019, 2:24:03 PM5/8/19
to puppe...@googlegroups.com
Katie Lawhorn commented on Bug PUP-9694

Henrik Lindberg Unfortunately I don't have any visibility into the version state that existed in PE Kearney when the class was originally applied and worked, that would have been in January and there have been dozens of updates since then, but when attempting to apply that class yesterday with Puppet 6.5.0 in PE Kearney for a sanity check, I had the same result. Josh Cooper There are generated resource types in the file you mention in PE Lovejoy, but I can't speak to what put them there. After Ryan discovered the workaround I proceeded with my setup steps, and current state in both pe-kearney and pe-lovjoy is we have all our classes successfully applied and code manager working. If anyone wants to poke around, you can ssh into both boxes w/ your ldap creds (pe-kearney.p9.puppet.net and pe-lovejoy.p9.puppet.net). 

Reply all
Reply to author
Forward
0 new messages