Ask Your Question

Puppet (err): Failed to apply catalog: undefined method `downcase' for #<Array:0x0000000005713838>

asked 2018-05-02 13:59:32 -0600

theCrazyRussian gravatar image

updated 2018-05-02 16:36:51 -0600

NOTE: I am very new to Puppet and have only been accomplishing very simple tasks but not actually managing the puppet system. I since upgraded a test server environment to Microsoft's Windows Server Desktop 2016, and I have been simply adjusting files to get the Puppet code to apply (fixing facts and custom facts generated by in-house code). I have searched high and low for a solution, and I can only guess at the issue here:

  • It is a ruby issue?? Maybe..

I know.. very, very weak assessment. But, I am confused as to what is happening. Here is my file tree which I know is wrong in some respects, but I'm just trying to get Puppet to work at this point.

|   \---<product>  
|       |   environment.conf  
|       |     
|       +---configuration  
|       |-------namelessserver.yaml  
|       |-------common.yaml  
|       |-------baseserver.yaml  
|       |-------wicked_cool_server.yaml  
|       |-------versions.yaml  
|       |         
|       \---modules  
|           +---apps  
|           |   \---iis  
|           |       \---manifests  
|           |               -------init.pp  
|           |

Externals contains puppet forge items which is listed under the modules directory:

  • Powershell
  • windowsfeature
  • ie_esc
  • iis

Here's my OS and Puppet version. I know.. Windows (insert pitchfork mafia here)

image description

So, what is happening?

I run puppet:

puppet apply --test --summarize --debug --logdest %PUPPET_DIR%\puppet.log C:\ProgramData\PuppetLabs\puppet\etc\manifests\ >> %PUPPET_DIR%\puppetstatus.txt

And, the only error I get is:

2018-05-02 12:01:17 -0500 Puppet (err): Failed to apply catalog: undefined method `downcase' for #<array:0x0000000005713838>

EDIT 05/02/2018 1539_CST WindowsFeature:

It seems that inside of my iis/manifests/init.pp, I was calling a windows feature "IIS" to be installed. In previous versions, (I'm assuming this as I did not create this module) it seems that having the "name" parameter with an array of items would work. However, in this version it crashes and gives this ambiguous error message. Yes, there was an array (two in fact, for different windows features), but I'm unsure if this is an error on my part (lack of knowledge), or a defect. Should the windowsfeature give me a file that it was complaining about?

I was able to verify this by commenting out my resources (windowsfeature) and re-run puppet which completed unsuccessfully (I had powershell scripts that need IIS installed first). Then added one of my resources back and got the same error. I'm not sure this worked completely as my test vm is still running puppet as I type. I feel that it would have broken already if it was bad code.

edit within an edit 05/02/2018 1622_CST Here's a code example of what was happening in: iis/manifests/init.pp

windowsfeature { 'IIS':
name => [

So in short: Is this a defect? or Is this just a lack of keeping up with the current release and changes that come with puppetforge items? I'm leaning towards a lack of maintaining an updated puppetforge item instead ... (more)

edit retag flag offensive close merge delete



downcase is a method that is defined String objects, but that error indicates it was called on an Array. Likely the Puppet manifests produced a catalog that has an Array where a String should have been. Adding the --trace flag will cause a backtrace to be printed that may have more clues.

csharpsteen gravatar imagecsharpsteen ( 2018-05-02 14:29:01 -0600 )edit

Okay! I'll be back with the results. Thanks!

theCrazyRussian gravatar imagetheCrazyRussian ( 2018-05-02 14:33:59 -0600 )edit

That line of code is part of the resource prefetching system, so the data it's processing is actually coming from your system, not the code you've written. Can you post the output of `puppet resource windowsfeature` here?

binford2k gravatar imagebinford2k ( 2018-05-02 15:39:45 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-05-02 16:22:06 -0600

theCrazyRussian gravatar image

windowsfeature "Name" parameter needed to be Removed

So, I blame myself for this. The windowsfeature resource needed an array of items to be passed properly as an Array. This array would contain the names of the features to be "installed".

windowsfeature { $anArray: ensure => present }

So, the problem seems to be resolved. All of my items for the resource in question were successfully applied. If I had read the documentation slower I would have figured this out!!! ..... I think.
I appreciate all the comments and help along the way! Thanks!

edit flag offensive delete link more


I think a better approach is to install all the subfeatures and managementtools, but I'm not sure.

theCrazyRussian gravatar imagetheCrazyRussian ( 2018-05-02 16:35:38 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-05-02 13:59:32 -0600

Seen: 142 times

Last updated: May 02