1

I am getting a syntax error when running puppet, although I cant figure out why:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at 'String'; expected ')' at /etc/puppet/modules/riak/manifests/init.pp:17

Here is the init.pp file:

# == Class: riak
#
# Deploy and manage Riak.
#
# === Parameters
#
# [*$package_name*]
# [*$service_name*]
# [*$manage_package*]
# [*$manage_repo*]
# [*$version*]
# [*$ulimits_nofile_soft*]
# [*$ulimits_nofile_hard*]


class riak ( 
  String[1] $package_name       = $::riak::params::package_name,
  String[1] $service_name       = $::riak::params::service_name,
  Boolean $manage_package       = $::riak::params::manage_package,
  Boolean $manage_repo          = $::riak::params::manage_repo,
  String[1] $version            = $::riak::params::version,
  Integer $ulimits_nofile_soft  = $::riak::params::ulimits_nofile_soft,
  Integer $ulimits_nofile_hard  = $::riak::params::ulimits_nofile_hard,
  Hash[String, Variant[String, Boolean, Integer]] $settings = {},
)
inherits ::riak::params {
  if $manage_repo and $manage_package {
    include ::riak::repository
  }
  if $manage_package {
    include ::riak::install
    Package[$::riak::package_name] ~> File[$::riak::params::riak_conf]
  }
  class { '::riak::config': } ~>
  class { '::riak::service': } ->
  Class['::riak']
}

Any ideas where the Syntax error is coming from?

4

The data type declaration is new to puppet 4; are you perhaps attempting to use this on a puppet 3.x or earlier puppet master?

  • i am using puppet versions 3.8.1 on Ubuntu 12.04 Agent, and 3.6.1 on Ubuntu 14.10 Master. Should I upgrade? thanks – Edwin Reed-Sanchez Aug 2 '15 at 18:10
  • I don't know that I can recommend an upgrade (it's not a simple upgrade, having just gone though it), but it's either that or rewrite the module to not use Puppet 4 syntax. Also, it is worth noting that puppetlabs recommend your master be the same or newer than your agents (or they used to; I haven't seen it written down for a while). – Craig Miskell Aug 3 '15 at 7:58
  • Master needs to be same or newer version. Puppet 4 masters generally won't work with Puppet 3 agents, although the latest versions of puppetserver have renewed support for Puppet 3 agents. – Felix Frank Aug 3 '15 at 13:57
  • I was able to enable future parser, and that solved some of the problems. I have new errors now. – Edwin Reed-Sanchez Aug 5 '15 at 3:09
0

I think you should delete the last "," in your param declaration for something like that :

class riak ( 
  String[1] $package_name       = $::riak::params::package_name,
  String[1] $service_name       = $::riak::params::service_name,
  Boolean $manage_package       = $::riak::params::manage_package,
  Boolean $manage_repo          = $::riak::params::manage_repo,
  String[1] $version            = $::riak::params::version,
  Integer $ulimits_nofile_soft  = $::riak::params::ulimits_nofile_soft,
  Integer $ulimits_nofile_hard  = $::riak::params::ulimits_nofile_hard,
  Hash[String, Variant[String, Boolean, Integer]] $settings = {}
)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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