Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am receiving the following error when trying to use the latest puppetlabs-apache module from github (https://github.com/puppetlabs/puppetlabs-apache):

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter identifier at /etc/puppet/environments/development/modules/apache/manifests/mod.pp:40 on node cacti.mydomain.com Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping runn

My node config looks like:

node 'cacti.eye.fi' inherits 'base' {
  include apache
  include mysql::server
  include yumrepos::epel

  package { 'cacti':
    ensure => 'latest',
  }
}

mod.pp contents:

define apache::mod (
  $package = undef
) {
  $mod = $name
  include apache::params
  #include apache #This creates duplicate resources in rspec-puppet
  $mod_packages = $apache::params::mod_packages
  $mod_package = $mod_packages[$mod] # 2.6 compatibility hack
  if $package {
    $package_REAL = $package
  } elsif "$mod_package" {
    $package_REAL = $mod_package
  }
  $mod_libs = $apache::params::mod_libs
  $mod_lib = $mod_libs[$mod] # 2.6 compatibility hack
  if "${mod_lib}" {
    $lib = $mod_lib
  }

  $mod_identifiers = $apache::params::mod_identifiers
  $mod_identifier = $mod_identifiers[$mod]
  if "${mod_identifier}" {
    $identifier = $mod_identifier
  }

  if $package_REAL {
    package { $package_REAL:
      ensure   => present,
      require  => Package['httpd'],
      before   => A2mod[$mod],
    }
  }

  a2mod { $mod:
    ensure     => present,
    lib        => $lib,
    identifier => $identifier,
    require    => Package['httpd'],
    notify     => Service['httpd'],
  }
}

I have verified that the /var/lib/puppet/lib/puppet/type/a2mod.rb type has the identifier parameter and it is the same MD5 as the server:

Puppet::Type.newtype(:a2mod) do
    @doc = "Manage Apache 2 modules"

ensurable

newparam :name do
   desc "The name of the module to be managed"

   isnamevar

end

newparam :lib do
  desc "The name of the .so library to be loaded"

  defaultto { "mod_#{@resource[:name]}.so" }
end

newparam :identifier do
  desc "Module identifier string used by LoadModule. Default: module-name_module"

  # http://httpd.apache.org/docs/2.2/mod/module-dict.html#ModuleIdentifier

  defaultto { "#{@resource[:name]}_module" }
end

autorequire(:package) { catalog.resource(:package, 'httpd')}

end

I am using Puppet 3.0.2 on both agent and master. Any idea what may cause this?

share|improve this question
    
I'd also paste the relevant part of your node config so we can see how you're calling the apache module. –  kashani Nov 14 '12 at 19:35
    
Good idea. Added those relevant sections. –  Andy Shinn Nov 14 '12 at 22:01
    
Also, paste the contents of this file /etc/puppet/environments/apache_update/modules/apache/manifests/mod.pp –  robbyt Nov 24 '12 at 18:44
    
Thanks, I have simplified my test and updated with the relevant mod.pp and a2mod.rb –  Andy Shinn Feb 1 '13 at 1:48
    
What OSes are you using? –  slm Feb 3 '13 at 2:49

2 Answers 2

up vote 1 down vote accepted

I think I finally tracked down a couple Puppet bugs which appear to be the cause of this. It is related to my use of multiple environments for testing and updating (which I didn't mention in the original problem since I didn't think it was relevant).

The first bug which showed up in a Google search after removing 'identifier' from my search term:

http://projects.puppetlabs.com/issues/17814

Then, this bug links to another which sounds like it is directly related:

http://projects.puppetlabs.com/issues/12173

I am also following http://projects.puppetlabs.com/issues/17210 and it could be related. I am following these bugs. I can confirm that after I actually merged my code to the main environment, it did start working (since the Puppet master now saw the code changes).

share|improve this answer

Seems that the problem is in your identifier declaration, you can try adding an else fail to see if that's the issue:

if "${mod_identifier}" {
  $identifier = $mod_identifier
}
else {
  fail('No identifier found'),
}
share|improve this answer
    
I've verified that once I move my commits to my master branch (to get the code in the primary environment path on the aster) it starts working fine. It looks to be directly related to to the bug. –  Andy Shinn Feb 10 '13 at 1:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.