GithubHelp home page GithubHelp logo

Comments (39)

juniorsysadmin avatar juniorsysadmin commented on July 20, 2024

puppetlabs-apt version?

from puppet-nodejs.

mwillbanks avatar mwillbanks commented on July 20, 2024

@juniorsysadmin latest actually... i'll post some more as there is something very odd, if it comes from puppetmaster it fails, if local puppet agent it's fine. It's absolutely one of the most odd issues i've seen thus far.

from puppet-nodejs.

ffrank avatar ffrank commented on July 20, 2024

Can we see the stack trace anyway? :)

from puppet-nodejs.

mwillbanks avatar mwillbanks commented on July 20, 2024

@ffrank would love to provide one if i could actually get one. puppetmaster with trace set to on as well as log level to debug provides no stack trace; if it did I likely would have submitted a PR vs. this ticket.

from puppet-nodejs.

mwillbanks avatar mwillbanks commented on July 20, 2024

Alright, cleared this up...

Rebooted puppetmaster box, basically clean installed and everything is happy once again. Sorry for the noise.

from puppet-nodejs.

ffrank avatar ffrank commented on July 20, 2024

Alright.

So was this a 4xx error reported by the master to the agent? In such cases, I think I would try puppet master --trace --compile.

from puppet-nodejs.

jpmorris avatar jpmorris commented on July 20, 2024

Same problem here. Running puppet, vagrant, librarian-puppet.

Puppetfile:

#!/usr/bin/env ruby
forge "https://forgeapi.puppetlabs.com"
mod 'puppetlabs/apt'
mod 'puppet-community/puppet-nodejs',
    :git => '[email protected]:puppet-community/puppet-nodejs.git',
    :ref => '1.1.0'

install with librarian-puppet install

manifest/site.pp:

include nodejs

Vagrantfile:

VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    config.vm.provision "puppet" do |puppet|
        puppet.manifests_path = "manifests"
        puppet.manifest_file  = "site.pp"
        puppet.module_path = ['modules']
        puppet.options = "--verbose --debug --hiera_config /vagrant/hiera.yaml"
    end

    config.vm.hostname = "vagrant.edward.local"
    config.vm.network "forwarded_port", guest: 8080, host: 8042
    config.vm.synced_folder "webroot/", "/vagrant/webroot/", :owner => "www-data"
end

Vagrant up (after vagrant destroy) gives me the error: "Error: undefined method `ref' for nil:NilClass on node vagrant.edward.local". I would provide a stack trace if I knew how. Apt version is 2.1.0 (according to metadata.json). Sorry I did what I could from bothering you all, but I've been waiting for several version trying to fix this to no avail.

from puppet-nodejs.

juniorsysadmin avatar juniorsysadmin commented on July 20, 2024

I just tested with Puppet 4 on an Ubuntu 14.04 agent:
puppetserver-2.1.1, puppet-agent-1.2.1
puppet-nodejs (v1.1.0)
puppetlabs-apt (v2.1.0)
puppetlabs-stdlib (v4.6.0)

with

node 'ubuntutrusty.domain' {
  class { 'apt':
    update => {
      frequency => 'always',
    },
  }
  class { '::nodejs': }
}

and got no issue. Will see if I can do a 3.8 agent test against a 3.8 master later.

from puppet-nodejs.

jpmorris avatar jpmorris commented on July 20, 2024

Ok I moved to 4.2 (installed the gem was using 3.7 from apt-get), but still same error. All my versions match up with yours (though not sure how to check puppetserver and agent versions). I found out how to get you a stacktrace:

==> default: Debug: Automatically imported apt::key from apt/key into production
==> default: Debug: Adding relationship from Anchor[apt_first] to Class[Apt::Update] with 'before'
==> default: Debug: Adding relationship from Class[Apt::Update] to Anchor[apt_last] with 'before'
==> default: Debug: Adding relationship from Anchor[::nodejs::begin] to             Class[Nodejs::Repo::Nodesource] with 'before'
==> default: Debug: Adding relationship from Class[Nodejs::Repo::Nodesource] to     Class[Nodejs::Install] with 'before'
==> default: Debug: Adding relationship from Class[Nodejs::Install] to Anchor[::nodejs::end] with     'before'
==> default: Debug: Adding relationship from Apt_key[Add key:     9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280 from Apt::Source nodesource] to     Anchor[apt_key 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280 present] with 'before'
==> default: Error: undefined method `ref' for nil:NilClass on node vagrant.edward.local
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:527:in `block in to_catalog'
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:515:in `each'
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:515:in `to_catalog'
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:402:in `to_resource'
==> default: /usr/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:23:in `compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:116:in `block (2 levels) in compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/profiler/none.rb:6:in `profile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/profiler.rb:31:in `profile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:114:in `block in compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util.rb:161:in `block in benchmark'
==> default: /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util.rb:160:in `benchmark'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:113:in `compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:46:in `find'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:201:in `find'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:204:in `main'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:146:in `run_command'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block (2 levels) in run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:470:in `plugin_hook'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block in run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util.rb:478:in `exit_on_fail'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:137:in `run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:91:in `execute'
==> default: /usr/bin/puppet:4:in `<main>'
==> default: Error: undefined method `ref' for nil:NilClass on node vagrant.edward.local
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:527:in `block in to_catalog'
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:515:in `each'
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:515:in `to_catalog'
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:402:in `to_resource'
==> default: /usr/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:23:in `compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:116:in `block (2 levels) in compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/profiler/none.rb:6:in `profile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/profiler.rb:31:in `profile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:114:in `block in compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util.rb:161:in `block in benchmark'
==> default: /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util.rb:160:in `benchmark'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:113:in `compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:46:in `find'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:201:in `find'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:204:in `main'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:146:in `run_command'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block (2 levels) in run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:470:in `plugin_hook'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block in run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util.rb:478:in `exit_on_fail'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:137:in `run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:91:in `execute'
==> default: /usr/bin/puppet:4:in `<main>'

from puppet-nodejs.

juniorsysadmin avatar juniorsysadmin commented on July 20, 2024

The mention of Ruby 1.9.1 does not sound good for Puppet 3 or 4. See https://docs.puppetlabs.com/guides/platforms.html

from puppet-nodejs.

jpmorris avatar jpmorris commented on July 20, 2024

I installed ruby 2.1 inside the VM (via PPA) on ubuntu and I get a smilar error:

==> default: Debug: Adding relationship from Apt_key[Add key: 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280 from Apt::Source nodesource] to Anchor[apt_key 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280 present] with 'before'
==> default: Error: undefined method `ref' for nil:NilClass on node vagrant.edward.local
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:527:in `block in to_catalog'
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:515:in `each'
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:515:in `to_catalog'
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:402:in `to_resource'
==> default: /usr/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:23:in `compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:116:in `block (2 levels) in compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/profiler/none.rb:6:in `profile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/profiler.rb:31:in `profile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:114:in `block in compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util.rb:161:in `block in benchmark'
==> default: /usr/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util.rb:160:in `benchmark'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:113:in `compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:46:in `find'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:201:in `find'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:204:in `main'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:146:in `run_command'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block (2 levels) in run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:470:in `plugin_hook'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block in run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util.rb:478:in `exit_on_fail'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:137:in `run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:91:in `execute'
==> default: /usr/bin/puppet:4:in `<main>'
==> default: Error: undefined method `ref' for nil:NilClass on node vagrant.edward.local
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:527:in `block in to_catalog'
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:515:in `each'
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:515:in `to_catalog'
==> default: /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:402:in `to_resource'
==> default: /usr/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:23:in `compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:116:in `block (2 levels) in compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/profiler/none.rb:6:in `profile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/profiler.rb:31:in `profile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:114:in `block in compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util.rb:161:in `block in benchmark'
==> default: /usr/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util.rb:160:in `benchmark'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:113:in `compile'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:46:in `find'
==> default: /usr/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:201:in `find'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:204:in `main'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:146:in `run_command'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block (2 levels) in run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:470:in `plugin_hook'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block in run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util.rb:478:in `exit_on_fail'
==> default: /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:137:in `run'
==> default: /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:91:in `execute'
==> default: /usr/bin/puppet:4:in `<main>

from puppet-nodejs.

ddepaoli3 avatar ddepaoli3 commented on July 20, 2024

Same error of @jpmorris, both with ruby 1.9 and 2.0.0. And with puppet-nodejs v0.8.0 and 1.0
Other info: puppet 3.4.3, ubuntu 14.04 64 bit. I don't install the module, I include it inside another project.

from puppet-nodejs.

ffrank avatar ffrank commented on July 20, 2024

Reopening, thanks for the info. Will try and look into it "soon".

from puppet-nodejs.

hco avatar hco commented on July 20, 2024

I can reproduce this, and it somehow seems to be related to "contain" in my setup.

from puppet-nodejs.

masterzen avatar masterzen commented on July 20, 2024

Just hit this issue too (with puppet 3.5.1).

The generated catalog is malformed: a relationship edge points to nil, the edge source is nodejs::repo::nodesource.

This apparently comes from the contain method that is called in nodejs::repo::nodesource (in my case to the nodejs::repo::nodesource::apt class). Commenting the contain call works (but then there's no containment).

from puppet-nodejs.

ffrank avatar ffrank commented on July 20, 2024

Do we have enough evidence to open a Puppet bug for this?

from puppet-nodejs.

juniorsysadmin avatar juniorsysadmin commented on July 20, 2024

Do we have enough evidence to open a Puppet bug for this?

Could this be due to the fact that contain '::nodejs::repo::nodesource::apt'is enclosed with single quotes rather than contain ::nodejs::repo::nodesource::apt ? I seem to remember some Puppet quirks with quoting and the use of include, and since contain has include-like behviour, maybe it was affected as well.

As an aside I can't remember the reason for using both class and a contain in nodesource.pp.

from puppet-nodejs.

ryangraham avatar ryangraham commented on July 20, 2024

I just ran into this on trusty with puppet 3.4.3. So I downgraded to puppetlabs-nodejs 0.7.1.

from puppet-nodejs.

fr05t1k avatar fr05t1k commented on July 20, 2024

I got the same problem on 0.8

puppet 3.4.3
puppetlabs-apt at v1.8.0
ruby ruby 2.0.0p645 (2015-04-13 revision 50299) [x86_64-linux-gnu]

Part of stacktrace:

Debug: importing '/etc/puppet/modules/nodejs/manifests/install.pp' in environment production
Debug: Automatically imported nodejs::install from nodejs/install into production
Debug: importing '/etc/puppet/modules/nodejs/manifests/repo/nodesource.pp' in environment production
Debug: Automatically imported nodejs::repo::nodesource from nodejs/repo/nodesource into production
Debug: importing '/etc/puppet/modules/nodejs/manifests/repo/nodesource/apt.pp' in environment production
Debug: Automatically imported nodejs::repo::nodesource::apt from nodejs/repo/nodesource/apt into production
Debug: importing '/etc/puppet/modules/apt/manifests/source.pp' in environment production
Debug: Automatically imported apt::source from apt/source into production
Debug: Scope(Apt::Source[nodesource]): Retrieving template apt/_header.erb
Debug: template[/etc/puppet/modules/apt/templates/_header.erb]: Bound template variables for /etc/puppet/modules/apt/templates/_header.erb in 0.00 seconds
Debug: template[/etc/puppet/modules/apt/templates/_header.erb]: Interpolated template /etc/puppet/modules/apt/templates/_header.erb in 0.00 seconds
Debug: Scope(Apt::Source[nodesource]): Retrieving template apt/source.list.erb
Debug: template[/etc/puppet/modules/apt/templates/source.list.erb]: Bound template variables for /etc/puppet/modules/apt/templates/source.list.erb in 0.00 seconds
Debug: template[/etc/puppet/modules/apt/templates/source.list.erb]: Interpolated template /etc/puppet/modules/apt/templates/source.list.erb in 0.00 seconds
Debug: importing '/etc/puppet/modules/apt/manifests/key.pp' in environment production
Debug: Automatically imported apt::key from apt/key into production
Debug: Adding relationship from Anchor[::nodejs::begin] to Class[Nodejs::Repo::Nodesource] with 'before'
Debug: Adding relationship from Class[Nodejs::Repo::Nodesource] to Class[Nodejs::Install] with 'before'
Debug: Adding relationship from Class[Nodejs::Install] to Anchor[::nodejs::end] with 'before'
Debug: Adding relationship from Apt_key[Add key: 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280 from Apt::Source nodesource] to Anchor[apt_key 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280 present] with 'before'
Error: undefined method `ref' for nil:NilClass on node puppet-debug.int
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:527:in `block in to_catalog'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:515:in `each'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:515:in `to_catalog'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:402:in `to_resource'
/usr/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:23:in `compile'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:116:in `block (2 levels) in compile'
/usr/lib/ruby/vendor_ruby/puppet/util/profiler/none.rb:6:in `profile'
/usr/lib/ruby/vendor_ruby/puppet/util/profiler.rb:31:in `profile'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:114:in `block in compile'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:161:in `block in benchmark'
/usr/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:160:in `benchmark'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:113:in `compile'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:46:in `find'
/usr/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:201:in `find'
/usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:204:in `main'
/usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:146:in `run_command'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block (2 levels) in run'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:470:in `plugin_hook'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block in run'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:478:in `exit_on_fail'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:137:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:91:in `execute'
/usr/bin/puppet:4:in `<main>'
Error: undefined method `ref' for nil:NilClass on node puppet-debug.int
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:527:in `block in to_catalog'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:515:in `each'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:515:in `to_catalog'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:402:in `to_resource'
/usr/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:23:in `compile'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:116:in `block (2 levels) in compile'
/usr/lib/ruby/vendor_ruby/puppet/util/profiler/none.rb:6:in `profile'
/usr/lib/ruby/vendor_ruby/puppet/util/profiler.rb:31:in `profile'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:114:in `block in compile'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:161:in `block in benchmark'
/usr/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:160:in `benchmark'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:113:in `compile'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:46:in `find'
/usr/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:201:in `find'
/usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:204:in `main'
/usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:146:in `run_command'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block (2 levels) in run'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:470:in `plugin_hook'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block in run'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:478:in `exit_on_fail'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:137:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:91:in `execute'
/usr/bin/puppet:4:in `<main>'

from puppet-nodejs.

werkins avatar werkins commented on July 20, 2024

I had the same problem with a debian wheezy running inside a vagrant box. Relevant versions:

puppet 3.4.3
ruby 1.9.3p194
puppetlabs-apt (2.1.1)
puppet-nodejs (1.2.0)

Tried @juniorsysadmin tip (removing the ' to the contains line) doesn't work either.

from puppet-nodejs.

sysadmin1139 avatar sysadmin1139 commented on July 20, 2024

I've been chasing this one all day and only found this issue. Looks like I'm hitting the same problem. We're running puppet 3.6.2, and nodejs version 0.8.0. I also tried the master-branch here and hit the same problem. This can be reproduced through a pretty simple method

FACTER_factname=things puppet apply --environment=test --modulepath [..] --hiera-config [..] --noop -e 'include nodejs'

And we hit the problem. Our stack-strace:

Error: undefined method `ref' for nil:NilClass on node hal.my.example.com
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:525:in `to_catalog'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:513:in `each'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:513:in `to_catalog'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:400:in `to_resource'
/usr/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:23:in `compile'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:95:in `compile'
/usr/lib/ruby/vendor_ruby/puppet/util/profiler/none.rb:6:in `profile'
/usr/lib/ruby/vendor_ruby/puppet/util/profiler.rb:43:in `profile'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:93:in `compile'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:161:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:160:in `benchmark'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:92:in `compile'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:52:in `find'
/usr/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:201:in `find'
/usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:214:in `main'
/usr/lib/ruby/vendor_ruby/puppet/context.rb:51:in `override'
/usr/lib/ruby/vendor_ruby/puppet.rb:233:in `override'
/usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:190:in `main'
/usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:151:in `run_command'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:372:in `run'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:479:in `plugin_hook'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:372:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:479:in `exit_on_fail'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:372:in `run'
/usr/lib/ruby/vendor_ruby/puppet/context.rb:51:in `override'
/usr/lib/ruby/vendor_ruby/puppet.rb:233:in `override'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:362:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:137:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:91:in `execute'
/usr/bin/puppet:4
Error: undefined method `ref' for nil:NilClass on node hal.my.example.com
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:525:in `to_catalog'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:513:in `each'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:513:in `to_catalog'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:400:in `to_resource'
/usr/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:23:in `compile'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:95:in `compile'
/usr/lib/ruby/vendor_ruby/puppet/util/profiler/none.rb:6:in `profile'
/usr/lib/ruby/vendor_ruby/puppet/util/profiler.rb:43:in `profile'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:93:in `compile'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:161:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:160:in `benchmark'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:92:in `compile'
/usr/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:52:in `find'
/usr/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:201:in `find'
/usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:214:in `main'
/usr/lib/ruby/vendor_ruby/puppet/context.rb:51:in `override'
/usr/lib/ruby/vendor_ruby/puppet.rb:233:in `override'
/usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:190:in `main'
/usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:151:in `run_command'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:372:in `run'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:479:in `plugin_hook'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:372:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:479:in `exit_on_fail'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:372:in `run'
/usr/lib/ruby/vendor_ruby/puppet/context.rb:51:in `override'
/usr/lib/ruby/vendor_ruby/puppet.rb:233:in `override'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:362:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:137:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:91:in `execute'
/usr/bin/puppet:4

@masterzen's analysis is spookily close to my own. Whatever problem it's running into, it isn't giving a usual puppet dependency fail.

from puppet-nodejs.

sysadmin1139 avatar sysadmin1139 commented on July 20, 2024

After much hammering, this looks to be a manifestation of this:

https://tickets.puppetlabs.com/browse/PUP-1597

Which is fixed in the 3.7.0 codebase. Upgrading my local puppet to a 3.7 version caused things to start working again.

from puppet-nodejs.

ffrank avatar ffrank commented on July 20, 2024

Thanks for the feedback!

It's weird that the OP hit this failure with Puppet 3.8.1. A regression perhaps?

@sysadmin1139 are you in a position to test a 3.8.1 master?

It would appear that @igalic might know what's what.

from puppet-nodejs.

igalic avatar igalic commented on July 20, 2024

weird.

even weirder, in $bigCo we're always running latest stable puppet, and are not hitting this. (our roles and profiles and private modules are filled with contain)


we also have spec tests that should be catching that…

from puppet-nodejs.

sysadmin1139 avatar sysadmin1139 commented on July 20, 2024

@ffrank We're deployed on 3.8.2 at the moment, and it's working fine. When we discovered we had to update past where we were, we bit the bullet and went to 'latest 3.x'. And we're still running the 0.8.0 code. It could be that the newer 1.2.0 rev makes the bug more visible?

from puppet-nodejs.

adamsea avatar adamsea commented on July 20, 2024

I'm experiencing this as well, tried Puppet 3.8.2 and 3.8.3 and module versions 1.2.0 and 0.8.0. Trace is identical to the others (save for the node name).

from puppet-nodejs.

aisouard avatar aisouard commented on July 20, 2024

Here is a workaround if you need to retrieve the package from nodesource :

class { '::nodejs':
  repo_url_suffix => 'node_0.12',
  manage_package_repo => false,
  npm_package_ensure => 'present',
  require => Exec['nodesource']
}

from puppet-nodejs.

igalic avatar igalic commented on July 20, 2024

@aisouard i've edited your comment because the recommendation you're making is not something i would want to stand for in public.

from puppet-nodejs.

aisouard avatar aisouard commented on July 20, 2024

@igalic Whoops, sorry. I will be more careful about that next time.

A safer workaround would be telling people to provide their own nodejs package instead of manually retrieving the package from apt.

from puppet-nodejs.

igalic avatar igalic commented on July 20, 2024

anyway, i'm currently using this module to install node 4.x from apt with puppet 4.2.2.

it works for me.

what am i doing wrong?

from puppet-nodejs.

ffrank avatar ffrank commented on July 20, 2024

Failing to reproduce this with puppet apply version 3.8.1 and 4.2.3.

Will try it through puppet master later - the more exciting Puppet bugs are invisible to apply, sadly.

from puppet-nodejs.

ffrank avatar ffrank commented on July 20, 2024

I just managed to reproduced with puppet 3.4.3 and 3.5.1.

Everyone who saw this with newer master versions, could you make extra sure that the binary from the installed package is really really running? Think rebooting the master machine etc.

from puppet-nodejs.

JamesWiley avatar JamesWiley commented on July 20, 2024

I am able to reproduce this with puppet 3.6.2 with puppet provisioning my vagrant CentOS 7 box

from puppet-nodejs.

igalic avatar igalic commented on July 20, 2024

@JamesWiley, @ffrank contain was only really fixed in 3.7.0

from puppet-nodejs.

juniorsysadmin avatar juniorsysadmin commented on July 20, 2024

Closing as a result of merging #178 . Will re-open if pain persists.

from puppet-nodejs.

linuxbandit avatar linuxbandit commented on July 20, 2024

I believe this is still an issue

I encounter the error when I vagrant up the machine for the first time and puppet runs the provisioner. My code was working through

class { 'nodejs':
    # TODO: The following setting installs nodejs from apt, which is not very
    #       recent. However, installing from NodeSource currently fails due to a
    #       bug in puppet-nodejs. See
    #       https://github.com/puppet-community/puppet-nodejs/issues/149
    #       Try to update puppet-nodejs once the bug is fixed.
    manage_package_repo       => false,
    nodejs_dev_package_ensure => 'present',
    npm_package_ensure        => 'present',
    legacy_debian_symlinks    => true,
  }

However commenting out the 4 lines gives me the error.

I would like to provide more information but I am not really expert at puppet, so if you'd like to guide me I can be more of help. For instance, it may just be that I did not update puppet, or the module... If it is not done automagically by vagrant, then how to? Sorry but my teammate who was taking care of puppet is busy and I am not as skilled as he is!

from puppet-nodejs.

linuxbandit avatar linuxbandit commented on July 20, 2024

Of course I spent all this time googling and found out that no, probably puppet isn't automatically the last version!
With this script I managed to update puppet to (I think) the latest available for trusty64 boxes, and after removing the 4 lines mentioned above, it works.

However npm is not the latest version, anybody knows why?

from puppet-nodejs.

igalic avatar igalic commented on July 20, 2024

@serviceman npm, when installed from nodesource's repository, comes with the version bundled with nodejs. we do not explicitly install the latest version with this module.
you can do this yourself with:

package { 'npm':
  ensure   => 'latest',
  provider => 'npm',
}

and if you're lucky, this won't conflict with anything in the module _

from puppet-nodejs.

petems avatar petems commented on July 20, 2024

Yeah, you're gonna come up against #160 unless you're using Puppet > 4

from puppet-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.