user resource on darwin throws "undefined method `each' for nil:NilClass"

90 views
Skip to first unread message

Peter K

unread,
Aug 31, 2018, 2:23:03 PM8/31/18
to Puppet Users
I'm getting this error when I try and create a user on osx:
'''Error: Failed to apply catalog: undefined method `each' for nil:NilClass'''

My code looks like this:

'''  class fakeadmin2 {
  user { 'fakeadmin2':
    name    => 'fakeadmin2',
    ensure  => 'present',
    uid       => '504',
    gid       => '501',
    home   => '/Users/fakeadmin2',
  }
}'''

ubuntu server package: puppetserver    2.8.0-1puppetlabs1

puppet master 4.10.9
puppet agent version 4.10.9


Any help with how to debug this would be helpful too.
thx

Peter K

unread,
Aug 31, 2018, 2:24:09 PM8/31/18
to Puppet Users
The puppet agent is on a mac with 10.13.4.

Henrik Lindberg

unread,
Aug 31, 2018, 2:48:52 PM8/31/18
to puppet...@googlegroups.com
A stack trace is required to have any guess at what is going wrong. (Run
puppet apply with --trace)

Also check here (https://puppet.com/docs/puppet/4.10/release_notes.html)
for release notes for versions newer that 4.10.9 (think we are up to 12
now).


- henrik

> thx
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/7114fc76-ba6e-4ecf-a4b9-efe12f5c297b%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/7114fc76-ba6e-4ecf-a4b9-efe12f5c297b%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Martin Alfke

unread,
Sep 1, 2018, 7:07:11 AM9/1/18
to puppet...@googlegroups.com
Hi Peter,

please check the locale setting and set it to en_US.UTF-8

export LANG=en_US.UTF.8

Best,
Martin
> To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/pmc2e2%24tdg%241%40blaine.gmane.org.

Peter K

unread,
Sep 4, 2018, 9:11:47 PM9/4/18
to Puppet Users
Thank you Henrik. That was useful. I"ll keep that in my bag of tricks.
-peter

Peter K

unread,
Sep 4, 2018, 9:13:50 PM9/4/18
to Puppet Users
Martin, that was definitely the answer.
Now do you have any idea how to export that variable for the user that runs the puppet service...on a mac?
thx,
-peter
>> To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com <mailto:puppet-users+unsub...@googlegroups.com>.

Martin Alfke

unread,
Sep 8, 2018, 10:40:59 AM9/8/18
to puppet...@googlegroups.com
Hi Peter,

maybe the following is possible:

Identify the home directory and the shell of the user:
grep <user> /etc/passwd

if the user has a bash, add a .bashrc
add export LANG=en_US.UTF-8 to the file.

hth,
Martin
> >> To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com <mailto:puppet-users...@googlegroups.com>.
> >> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/7114fc76-ba6e-4ecf-a4b9-efe12f5c297b%40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/7114fc76-ba6e-4ecf-a4b9-efe12f5c297b%40googlegroups.com?utm_medium=email&utm_source=footer>.
> >> For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> >
> > Visit my Blog "Puppet on the Edge"
> > http://puppet-on-the-edge.blogspot.se/
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/pmc2e2%24tdg%241%40blaine.gmane.org.
> > For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/68a68332-1f6e-4d16-9f33-32ef3216b0f7%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages