Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

Detail: undefined method `each_with_index' for nil:NilClass #53

Closed
betorvs opened this issue Sep 29, 2015 · 10 comments
Closed

Detail: undefined method `each_with_index' for nil:NilClass #53

betorvs opened this issue Sep 29, 2015 · 10 comments

Comments

@betorvs
Copy link

betorvs commented Sep 29, 2015

Hi, I'm trying use this class, but I receive this error:

Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, Failed to parse template uchiwa/etc/sensu/uchiwa.json.erb:
  Filepath: /etc/puppetlabs/code/modules/uchiwa/templates/etc/sensu/uchiwa.json.erb
  Line: 4
  Detail: undefined method `each_with_index' for nil:NilClass
 at /etc/puppetlabs/code/modules/uchiwa/manifests/config.pp:8:16 on node sensu-server-1
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

My profile is:

$uchiwa_api_config = [{
  host      => 'sensu-server',
  ssl       => false,
  insecure  => false,
  port      => '4567',
  user      => 'sensu',
  pass      => 'sensu',
  path      => '/',
  timeout   => '5'
}]

class { "uchiwa":
  sensu_api_endpoints => $uchiwa_api_config,
  install_repo => false,
  host => '0.0.0.0',
  port => '3000',
  refresh => '5',
  }

Why's this error happen?
It's a fresh puppetserver installation.

@somic
Copy link
Contributor

somic commented Sep 29, 2015

What version of puppet are you using?

I could be wrong but looks like some sort of variable scope issue - for some reason your puppet didn't assign array from $uchiwa_api_config to @sensu_api_endpoints on https://github.com/somic/puppet-uchiwa/blob/master/templates/etc/sensu/uchiwa.json.erb#L4

I just created a test for this situation and it passes on our puppet 3.8

@betorvs
Copy link
Author

betorvs commented Sep 29, 2015

Hi, @somic thanks for your answer.
My version is 4.2.
I have imported other classes from puppetforge (without support for puppet 4.2) and works well. But 'yeld/uchiwa' I have this problem.
Any idea? suggestion?

@somic
Copy link
Contributor

somic commented Sep 29, 2015

Hm, 4.2 is new. I don't know if anyone ever tested this module on 4.2 or tried to make it work there.

Let's see if we get more opinions here but at this point my guess would be that this module doesn't work in puppet 4.2 yet.

@somic
Copy link
Contributor

somic commented Sep 29, 2015

#54

@lauraglasu
Copy link

While using the 0.3.0 version of the module, with parser set to future in a puppet 3.8.1 installation puppet complained a lot about all sorts of params not being of the right type (string, ...). Gave the values for the default params with additional quotes as required and then got the same error as the one reported here. Using the same installation and module version but without the future parser issues don't appear anymore.

@solarkennedy
Copy link
Contributor

I've release 1.0.0, hopefully this contains all the fixes required for this issue?

@queeno
Copy link
Contributor

queeno commented Dec 7, 2015

Earlier this morning I tested this module from master using Puppet 4.2.2 and worked fine (except for an issue with the sensu apt repo key, which I have fixed in #62).

I expect v1.0.0 should work great with Puppet 4.2.2.

@solarkennedy
Copy link
Contributor

ty @queeno. I did a quick release of 1.0.1 to get that Apt key fix. (looks like they changed it on 2015-08-31)

@solarkennedy
Copy link
Contributor

@betorvs can you try updating and closing the issue if you are good to go?

@betorvs
Copy link
Author

betorvs commented Dec 7, 2015

Hi @solarkennedy , I tested here and works well.
Thanks.

@betorvs betorvs closed this as completed Dec 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants