Puppet: System Administration Automated

Support

Ticket #1120 (closed defect: worksforme)

Opened 9 months ago

Last modified 8 months ago

undefined method scope for nil::NilClass ??

Reported by: jtimberman Assigned to: community
Priority: normal Milestone:
Component: client Version: 0.24.2
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Attached Patches: None Complexity: Unknown

Description

I'm seeing the following error message when trying to run puppet on two of my clients. The configuration was not changed between upgrading from 0.24.1 to 0.24.2 on the clients yesterday.

$ sudo puppetd --test notice: Ignoring cache err: Could not retrieve catalog: undefined method `scope' for nil:NilClass at /var/lib/puppet/master/manifests/nodetype.pp:333 on node web1b warning: Not using cache on failed catalog

Client is 0.24.2, server is 0.24.2.

Change History

03/07/08 20:40:05 changed by jtimberman

Line 333 in nodetype.pp is a false-positive or misnomer. The offending line is actually prior to 333.

include sans::php::primary

If I change this to "sans::php" then it works, of course it misses the two resources we're using in sans::php::primary. Commenting out those resources and still using the sans::php::primary class doesn't seem to help either.

I also can't run a --trace for some reason - see bug 1119.

03/07/08 21:00:45 changed by jtimberman

Class statements:

http://pastie.caboo.se/162946

Looks like previously, 0.24.1 was parsing class primary inherits php as sans::php::primary inheriting sans::php, but in 0.24.2 it was trying to inherit php, which it didn't find within the class/module scope? I changed class primary inherits php to inherits sans::php and it seems to be fine now.

Leaving this open though, as the behaviour changed between versions with the same configuration.

03/12/08 19:29:46 changed by luke

  • status changed from new to closed.
  • resolution set to worksforme.

Seems to work fine for me. This code:

class outer::middle {
    notice "middle"
    class inner inherits middle {
        notice "inner"
    }
}   

include outer::middle::inner

results in this message:

notice: Scope(Class[outer::middle]): middle
notice: Scope(Class[outer::middle::inner]): inner

If you can provide a trimmed-down code snippet that I can run and that demonstrates the problem, please do so. Your example code is too complicated for me to try to apply on my system.