Bug #2050
LDAP user in multiple groups causes NoMethodError exception
| Status: | Closed | Start date: | 03/05/2009 | |
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | LDAP | |||
| Target version: | 0.24.8 | |||
| Affected Puppet version: | 0.24.7 | Branch: | ||
| Keywords: | ||||
| Votes: | 0 |
Description
I am using puppet 0.24.7 on Centos 5.2 and am attempting to set up users in LDAP via puppet. I am getting an error msg that says
err: Got an uncaught exception of type NoMethodError: undefined method `join' for :absent:Symbol
on the second run of puppetd. First time through I run
puppetd --test --tags users
and it works and sets up the users “opt-query” and “opt-arch” in my LDAP directory. If I then run the exact same command again then it fails with the error above. Here’s a simplified test case of what I have set up and it fails for me using this. It appears to be something to do with the multiple groups specified for the opt-arch user – do I have a mistake in the way I have this set up in the define?
define ldapuser
(
$uid,
$groups,
$home,
$shell
)
{
group {"$title":
gid => $uid,
provider => "ldap",
ensure => present
}
user {"$title":
comment => "$title",
ensure => present,
groups => [ "$groups" ],
gid => "$uid",
home => "$home",
managehome => "false",
provider => "ldap",
shell => "$shell",
uid => "$uid",
require => Group["$title"]
}
}
class users
{
ldapuser {"opt-query":
home => "/some/dir/here",
shell => "/sbin/nologin",
uid => "506",
groups => ["opt-query"]
}
ldapuser {"opt-arch":
home => "/some/dir/here",
shell => "/sbin/nologin",
uid => "507",
groups => [ "opt-query","opt-arch" ],
require => [ Ldapuser["opt-query"] ]
}
}
Running puppetd with —trace gives me the following stack trace:
puppetd --test --noop --tags users --trace info: Loading fact drbd info: Retrieving facts info: Loading fact drbd warning: Found multiple default providers for group: ldap, groupadd; using ldap warning: Found multiple default providers for user: ldap, useradd; using ldap info: Caching catalog at /var/lib/puppet/localconfig.yaml notice: Starting catalog run notice: //Node[basicnode]/users/Sysusersetup[apache]/Usersetup[apache]/User[apache]/groups: is dm-upload, should be dm-upload,opt-query (noop) notice: //Node[basicnode]/users/Ldapuser[opt-query]/User[opt-query]/gid: is 605, should be 605 (noop) notice: //Node[basicnode]/users/Ldapuser[opt-arch]/User[opt-arch]/gid: is 604, should be 604 (noop) /usr/lib/ruby/site_ruby/1.8/puppet/property/list.rb:13:in `is_to_s' /usr/lib/ruby/site_ruby/1.8/puppet/transaction/change.rb:49:in `go' /usr/lib/ruby/site_ruby/1.8/puppet/transaction/change.rb:72:in `forward' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:118:in `apply_changes' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:111:in `collect' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:111:in `apply_changes' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:83:in `apply' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:239:in `eval_resource' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:425:in `thinmark' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/1.8/benchmark.rb:307:in `realtime' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:424:in `thinmark' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:238:in `eval_resource' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:310:in `evaluate' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:425:in `thinmark' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/1.8/benchmark.rb:307:in `realtime' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:424:in `thinmark' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:309:in `evaluate' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:303:in `collect' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:303:in `evaluate' /usr/lib/ruby/site_ruby/1.8/puppet/node/catalog.rb:124:in `apply' /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:256:in `run' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:180:in `benchmark' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/1.8/benchmark.rb:307:in `realtime' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:179:in `benchmark' /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:255:in `run' /usr/lib/ruby/1.8/sync.rb:229:in `synchronize' /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:237:in `run' /usr/sbin/puppetd:417 /usr/lib/ruby/site_ruby/1.8/puppet/property/list.rb:13:in `is_to_s' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:124:in `apply_changes' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:111:in `collect' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:111:in `apply_changes' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:83:in `apply' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:239:in `eval_resource' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:425:in `thinmark' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/1.8/benchmark.rb:307:in `realtime' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:424:in `thinmark' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:238:in `eval_resource' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:310:in `evaluate' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:425:in `thinmark' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/1.8/benchmark.rb:307:in `realtime' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:424:in `thinmark' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:309:in `evaluate' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:303:in `collect' /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:303:in `evaluate' /usr/lib/ruby/site_ruby/1.8/puppet/node/catalog.rb:124:in `apply' /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:256:in `run' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:180:in `benchmark' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/1.8/benchmark.rb:307:in `realtime' /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:179:in `benchmark' /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:255:in `run' /usr/lib/ruby/1.8/sync.rb:229:in `synchronize' /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:237:in `run' /usr/sbin/puppetd:417 err: Got an uncaught exception of type NoMethodError: undefined method `join' for :absent:Symbol notice: Finished catalog run in 4.96 seconds
At this point, puppet is effectively broken until I manually remove those users and groups from the LDAP directory and then it will work for one iteration then break again :(
History
Updated by James Turnbull almost 3 years ago
- Status changed from Unreviewed to Accepted
- Target version set to 0.24.8
Updated by Trevor Hemsley almost 3 years ago
Probably not the correct fix since Ruby is not a language that I am familiar with but gets me past the error
—– /usr/lib/ruby/site_ruby/1.8/puppet/property/list.rb 2009-03-05 13:01:57.000000000 +0000 +++ /usr/lib/ruby/site_ruby/1.8/puppet/property/list.new 2009-03-05 13:02:55.000000000 +0000 @@ -10,7 +10,7 @@
end
def is_to_s(currentvalue)
currentvalue.join(delimiter)currentvalue.join(delimiter) if currentvalue.is_a?(Array) end def membership
Updated by Luke Kanies almost 3 years ago
Fixing markup.
Updated by Luke Kanies almost 3 years ago
- Assignee set to Luke Kanies
- 3 changed from Unknown to Easy
Updated by Luke Kanies almost 3 years ago
This is clearly a bug in Puppet, but your configs won’t work when I fix that bug. It looks like you’ve got an array of arrays here, because you’re specifying the groups as an array, and then you’re putting the groups into another array as a string:
groups => [ "opt-query","opt-arch" ], ... groups => [ "$groups" ],
Those conflict, and you should just have:
groups => [ "opt-query","opt-arch" ], ... groups => $groups,
Please try that.
Updated by Luke Kanies almost 3 years ago
Fixed in the tickets/0.24.x/2050 branch in my repo.
Updated by Luke Kanies almost 3 years ago
- Status changed from Accepted to Ready For Checkin
- Assignee changed from Luke Kanies to James Turnbull
Updated by James Turnbull almost 3 years ago
- Status changed from Ready For Checkin to Closed
Pushed in commit:a3bb201bd4c964ab4f68e00895b692d9d9585407 in branch 0.24.x
Updated by Trevor Hemsley almost 3 years ago
Yep, confirmed, fix works for me.
I’d changed my define to try to find a way around this bug and left it in the copy I posted here, have subsequently backed that out so thanks for the heads-up that it was still there.
Thanks.