Error during bootstrap


#1

I’ve not had much time to really investigate this error since I’m just
finishing up my AMIs but has anyone seen anything like this when
creating users as part of the base role at bootstrap?

If I log in immediately after and run chef-client, everything works
fine. It only happens at bootstrap as part of the base role I created.

Thanks!
John E. Vincent


#2

Yes! and it’s been driving me crazy!

I’ve never been able to reproduce by logging on to the server and it occurs
even when I execute chef-client twice, though when i at the end of my
bootstrap do a /etc/init.d/chef-client start everything works normally.

I haven’t gone too far in investigating because the bootstrap still ends up
working with the init.d start of chef-client but I may look again tonight
now that I know someone else is experiencing it.

From: “John E. Vincent (lusis)” lusis.org+chef-list@gmail.com
Reply-To: "lusis.org+chef-list@gmail.com" lusis.org+chef-list@gmail.com
Date: Wed, 8 Dec 2010 16:15:35 -0600
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Error during bootstrap

I’ve not had much time to really investigate this error since I’m just
finishing up my AMIs but has anyone seen anything like this when
creating users as part of the base role at bootstrap?

https://gist.github.com/734009

If I log in immediately after and run chef-client, everything works
fine. It only happens at bootstrap as part of the base role I created.

Thanks!
John E. Vincent
http://about.me/lusis


#3

your error is on line 35:
ec2-184-73-57-106.compute-1.amazonaws.com groupadd -g ‘504’ auser
returned 127, expected 0

-s

On Wed, Dec 8, 2010 at 6:32 PM, Leinartas, Michael
MICHAEL.LEINARTAS@orbitz.com wrote:

Yes! and it’s been driving me crazy!

I’ve never been able to reproduce by logging on to the server and it occurs
even when I execute chef-client twice, though when i at the end of my
bootstrap do a /etc/init.d/chef-client start everything works normally.

I haven’t gone too far in investigating because the bootstrap still ends up
working with the init.d start of chef-client but I may look again tonight
now that I know someone else is experiencing it.

From: “John E. Vincent (lusis)” lusis.org+chef-list@gmail.com
Reply-To: "lusis.org+chef-list@gmail.com" lusis.org+chef-list@gmail.com
Date: Wed, 8 Dec 2010 16:15:35 -0600
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Error during bootstrap

I’ve not had much time to really investigate this error since I’m just
finishing up my AMIs but has anyone seen anything like this when
creating users as part of the base role at bootstrap?

https://gist.github.com/734009

If I log in immediately after and run chef-client, everything works
fine. It only happens at bootstrap as part of the base role I created.

Thanks!
John E. Vincent
http://about.me/lusis


#4

I just realized that same return code is something I’ve seen in Nagios
before too when executing plugins. In fact, it’s a similar MO - runs
fine from an interactive session but doesn’t from an automated
session.

It’s generally something to do with the environment that the script is
running under or a permissions error.

And I think I found it:

[root@domU ~]# export PATH=/usr/bin
[root@domU ~]# groupadd -g 504 testgroup
-bash: groupadd: command not found
[root@domU ~]# echo $?
127

It looks like chef-client isn’t importing the path environment
variables. Maybe it should be calling groupadd with the full path?
This is on a CentOS ec2 bootstrap.

Can’t tell at this point if it’s a bug with Chef or with
net-ssh-multi. Still investigating.

On Wed, Dec 8, 2010 at 6:34 PM, Sean OMeara someara@gmail.com wrote:

your error is on line 35:
ec2-184-73-57-106.compute-1.amazonaws.com groupadd -g ‘504’ auser
returned 127, expected 0

-s

On Wed, Dec 8, 2010 at 6:32 PM, Leinartas, Michael
MICHAEL.LEINARTAS@orbitz.com wrote:

Yes! and it’s been driving me crazy!

I’ve never been able to reproduce by logging on to the server and it occurs
even when I execute chef-client twice, though when i at the end of my
bootstrap do a /etc/init.d/chef-client start everything works normally.

I haven’t gone too far in investigating because the bootstrap still ends up
working with the init.d start of chef-client but I may look again tonight
now that I know someone else is experiencing it.

From: “John E. Vincent (lusis)” lusis.org+chef-list@gmail.com
Reply-To: "lusis.org+chef-list@gmail.com" lusis.org+chef-list@gmail.com
Date: Wed, 8 Dec 2010 16:15:35 -0600
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Error during bootstrap

I’ve not had much time to really investigate this error since I’m just
finishing up my AMIs but has anyone seen anything like this when
creating users as part of the base role at bootstrap?

https://gist.github.com/734009

If I log in immediately after and run chef-client, everything works
fine. It only happens at bootstrap as part of the base role I created.

Thanks!
John E. Vincent
http://about.me/lusis


#5

what centos5 ami are you using?

On Wed, Dec 8, 2010 at 10:01 PM, John E. Vincent (lusis)
lusis.org+chef-list@gmail.com wrote:

I just realized that same return code is something I’ve seen in Nagios
before too when executing plugins. In fact, it’s a similar MO - runs
fine from an interactive session but doesn’t from an automated
session.

It’s generally something to do with the environment that the script is
running under or a permissions error.

And I think I found it:

[root@domU ~]# export PATH=/usr/bin
[root@domU ~]# groupadd -g 504 testgroup
-bash: groupadd: command not found
[root@domU ~]# echo $?
127

It looks like chef-client isn’t importing the path environment
variables. Maybe it should be calling groupadd with the full path?
This is on a CentOS ec2 bootstrap.

Can’t tell at this point if it’s a bug with Chef or with
net-ssh-multi. Still investigating.

On Wed, Dec 8, 2010 at 6:34 PM, Sean OMeara someara@gmail.com wrote:

your error is on line 35:
ec2-184-73-57-106.compute-1.amazonaws.com groupadd -g ‘504’ auser
returned 127, expected 0

-s

On Wed, Dec 8, 2010 at 6:32 PM, Leinartas, Michael
MICHAEL.LEINARTAS@orbitz.com wrote:

Yes! and it’s been driving me crazy!

I’ve never been able to reproduce by logging on to the server and it occurs
even when I execute chef-client twice, though when i at the end of my
bootstrap do a /etc/init.d/chef-client start everything works normally.

I haven’t gone too far in investigating because the bootstrap still ends up
working with the init.d start of chef-client but I may look again tonight
now that I know someone else is experiencing it.

From: “John E. Vincent (lusis)” lusis.org+chef-list@gmail.com
Reply-To: "lusis.org+chef-list@gmail.com" lusis.org+chef-list@gmail.com
Date: Wed, 8 Dec 2010 16:15:35 -0600
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Error during bootstrap

I’ve not had much time to really investigate this error since I’m just
finishing up my AMIs but has anyone seen anything like this when
creating users as part of the base role at bootstrap?

https://gist.github.com/734009

If I log in immediately after and run chef-client, everything works
fine. It only happens at bootstrap as part of the base role I created.

Thanks!
John E. Vincent
http://about.me/lusis


#6

It’s a custom one that’s been really stripped down and the
centos5-gems bootstrap template. I just did another test after
modifying the template and was able to fix it.

I added:

export PATH=$PATH:/usr/sbin on the line before the bootstrap
chef-client call. This is one of those Redhat-isms. /sbin/ and
/usr/sbin are NOT in the system-wide path by default. They’re only
available to root so it feels like the issue is that the login scripts
are being ignored by net-ssh-multi possibly because it’s not running
with a tty?

On Wed, Dec 8, 2010 at 10:11 PM, Sean OMeara someara@gmail.com wrote:

what centos5 ami are you using?

On Wed, Dec 8, 2010 at 10:01 PM, John E. Vincent (lusis)
lusis.org+chef-list@gmail.com wrote:

I just realized that same return code is something I’ve seen in Nagios
before too when executing plugins. In fact, it’s a similar MO - runs
fine from an interactive session but doesn’t from an automated
session.

It’s generally something to do with the environment that the script is
running under or a permissions error.

And I think I found it:

[root@domU ~]# export PATH=/usr/bin
[root@domU ~]# groupadd -g 504 testgroup
-bash: groupadd: command not found
[root@domU ~]# echo $?
127

It looks like chef-client isn’t importing the path environment
variables. Maybe it should be calling groupadd with the full path?
This is on a CentOS ec2 bootstrap.

Can’t tell at this point if it’s a bug with Chef or with
net-ssh-multi. Still investigating.

On Wed, Dec 8, 2010 at 6:34 PM, Sean OMeara someara@gmail.com wrote:

your error is on line 35:
ec2-184-73-57-106.compute-1.amazonaws.com groupadd -g ‘504’ auser
returned 127, expected 0

-s

On Wed, Dec 8, 2010 at 6:32 PM, Leinartas, Michael
MICHAEL.LEINARTAS@orbitz.com wrote:

Yes! and it’s been driving me crazy!

I’ve never been able to reproduce by logging on to the server and it occurs
even when I execute chef-client twice, though when i at the end of my
bootstrap do a /etc/init.d/chef-client start everything works normally.

I haven’t gone too far in investigating because the bootstrap still ends up
working with the init.d start of chef-client but I may look again tonight
now that I know someone else is experiencing it.

From: “John E. Vincent (lusis)” lusis.org+chef-list@gmail.com
Reply-To: "lusis.org+chef-list@gmail.com" lusis.org+chef-list@gmail.com
Date: Wed, 8 Dec 2010 16:15:35 -0600
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Error during bootstrap

I’ve not had much time to really investigate this error since I’m just
finishing up my AMIs but has anyone seen anything like this when
creating users as part of the base role at bootstrap?

https://gist.github.com/734009

If I log in immediately after and run chef-client, everything works
fine. It only happens at bootstrap as part of the base role I created.

Thanks!
John E. Vincent
http://about.me/lusis


#7

probably. You’ll be glad to know it works fine on fedora/rhel6.

On Wed, Dec 8, 2010 at 10:19 PM, John E. Vincent (lusis)
lusis.org+chef-list@gmail.com wrote:

It’s a custom one that’s been really stripped down and the
centos5-gems bootstrap template. I just did another test after
modifying the template and was able to fix it.

I added:

export PATH=$PATH:/usr/sbin on the line before the bootstrap
chef-client call. This is one of those Redhat-isms. /sbin/ and
/usr/sbin are NOT in the system-wide path by default. They’re only
available to root so it feels like the issue is that the login scripts
are being ignored by net-ssh-multi possibly because it’s not running
with a tty?

On Wed, Dec 8, 2010 at 10:11 PM, Sean OMeara someara@gmail.com wrote:

what centos5 ami are you using?

On Wed, Dec 8, 2010 at 10:01 PM, John E. Vincent (lusis)
lusis.org+chef-list@gmail.com wrote:

I just realized that same return code is something I’ve seen in Nagios
before too when executing plugins. In fact, it’s a similar MO - runs
fine from an interactive session but doesn’t from an automated
session.

It’s generally something to do with the environment that the script is
running under or a permissions error.

And I think I found it:

[root@domU ~]# export PATH=/usr/bin
[root@domU ~]# groupadd -g 504 testgroup
-bash: groupadd: command not found
[root@domU ~]# echo $?
127

It looks like chef-client isn’t importing the path environment
variables. Maybe it should be calling groupadd with the full path?
This is on a CentOS ec2 bootstrap.

Can’t tell at this point if it’s a bug with Chef or with
net-ssh-multi. Still investigating.

On Wed, Dec 8, 2010 at 6:34 PM, Sean OMeara someara@gmail.com wrote:

your error is on line 35:
ec2-184-73-57-106.compute-1.amazonaws.com groupadd -g ‘504’ auser
returned 127, expected 0

-s

On Wed, Dec 8, 2010 at 6:32 PM, Leinartas, Michael
MICHAEL.LEINARTAS@orbitz.com wrote:

Yes! and it’s been driving me crazy!

I’ve never been able to reproduce by logging on to the server and it occurs
even when I execute chef-client twice, though when i at the end of my
bootstrap do a /etc/init.d/chef-client start everything works normally.

I haven’t gone too far in investigating because the bootstrap still ends up
working with the init.d start of chef-client but I may look again tonight
now that I know someone else is experiencing it.

From: “John E. Vincent (lusis)” lusis.org+chef-list@gmail.com
Reply-To: "lusis.org+chef-list@gmail.com" lusis.org+chef-list@gmail.com
Date: Wed, 8 Dec 2010 16:15:35 -0600
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Error during bootstrap

I’ve not had much time to really investigate this error since I’m just
finishing up my AMIs but has anyone seen anything like this when
creating users as part of the base role at bootstrap?

https://gist.github.com/734009

If I log in immediately after and run chef-client, everything works
fine. It only happens at bootstrap as part of the base role I created.

Thanks!
John E. Vincent
http://about.me/lusis


#8

Well that’s good to know allthough I won’t be running with 6 until
CentOS catches up. Either way, the bootstrap template is for version 5
so I added the export line and made a pull request :wink:

On Wed, Dec 8, 2010 at 11:13 PM, Sean OMeara someara@gmail.com wrote:

probably. You’ll be glad to know it works fine on fedora/rhel6.

On Wed, Dec 8, 2010 at 10:19 PM, John E. Vincent (lusis)
lusis.org+chef-list@gmail.com wrote:

It’s a custom one that’s been really stripped down and the
centos5-gems bootstrap template. I just did another test after
modifying the template and was able to fix it.

I added:

export PATH=$PATH:/usr/sbin on the line before the bootstrap
chef-client call. This is one of those Redhat-isms. /sbin/ and
/usr/sbin are NOT in the system-wide path by default. They’re only
available to root so it feels like the issue is that the login scripts
are being ignored by net-ssh-multi possibly because it’s not running
with a tty?

On Wed, Dec 8, 2010 at 10:11 PM, Sean OMeara someara@gmail.com wrote:

what centos5 ami are you using?

On Wed, Dec 8, 2010 at 10:01 PM, John E. Vincent (lusis)
lusis.org+chef-list@gmail.com wrote:

I just realized that same return code is something I’ve seen in Nagios
before too when executing plugins. In fact, it’s a similar MO - runs
fine from an interactive session but doesn’t from an automated
session.

It’s generally something to do with the environment that the script is
running under or a permissions error.

And I think I found it:

[root@domU ~]# export PATH=/usr/bin
[root@domU ~]# groupadd -g 504 testgroup
-bash: groupadd: command not found
[root@domU ~]# echo $?
127

It looks like chef-client isn’t importing the path environment
variables. Maybe it should be calling groupadd with the full path?
This is on a CentOS ec2 bootstrap.

Can’t tell at this point if it’s a bug with Chef or with
net-ssh-multi. Still investigating.

On Wed, Dec 8, 2010 at 6:34 PM, Sean OMeara someara@gmail.com wrote:

your error is on line 35:
ec2-184-73-57-106.compute-1.amazonaws.com groupadd -g ‘504’ auser
returned 127, expected 0

-s

On Wed, Dec 8, 2010 at 6:32 PM, Leinartas, Michael
MICHAEL.LEINARTAS@orbitz.com wrote:

Yes! and it’s been driving me crazy!

I’ve never been able to reproduce by logging on to the server and it occurs
even when I execute chef-client twice, though when i at the end of my
bootstrap do a /etc/init.d/chef-client start everything works normally.

I haven’t gone too far in investigating because the bootstrap still ends up
working with the init.d start of chef-client but I may look again tonight
now that I know someone else is experiencing it.

From: “John E. Vincent (lusis)” lusis.org+chef-list@gmail.com
Reply-To: "lusis.org+chef-list@gmail.com" lusis.org+chef-list@gmail.com
Date: Wed, 8 Dec 2010 16:15:35 -0600
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Error during bootstrap

I’ve not had much time to really investigate this error since I’m just
finishing up my AMIs but has anyone seen anything like this when
creating users as part of the base role at bootstrap?

https://gist.github.com/734009

If I log in immediately after and run chef-client, everything works
fine. It only happens at bootstrap as part of the base role I created.

Thanks!
John E. Vincent
http://about.me/lusis


#9

Yup, worked for me though i did it by changing the ‘bash -c’ to 'bash -lc’
to make it a login shell.

Thanks, this has made me happy.

From: “John E. Vincent (lusis)” lusis.org+chef-list@gmail.com
Reply-To: "lusis.org+chef-list@gmail.com" lusis.org+chef-list@gmail.com
Date: Wed, 8 Dec 2010 23:08:25 -0600
To: Sean OMeara someara@gmail.com
Cc: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Re: Re: Re: Re: Error during bootstrap

Well that’s good to know allthough I won’t be running with 6 until
CentOS catches up. Either way, the bootstrap template is for version 5
so I added the export line and made a pull request :wink:

On Wed, Dec 8, 2010 at 11:13 PM, Sean OMeara someara@gmail.com wrote:

probably. You’ll be glad to know it works fine on fedora/rhel6.

On Wed, Dec 8, 2010 at 10:19 PM, John E. Vincent (lusis)
lusis.org+chef-list@gmail.com wrote:

It’s a custom one that’s been really stripped down and the
centos5-gems bootstrap template. I just did another test after
modifying the template and was able to fix it.

I added:

export PATH=$PATH:/usr/sbin on the line before the bootstrap
chef-client call. This is one of those Redhat-isms. /sbin/ and
/usr/sbin are NOT in the system-wide path by default. They’re only
available to root so it feels like the issue is that the login scripts
are being ignored by net-ssh-multi possibly because it’s not running
with a tty?

On Wed, Dec 8, 2010 at 10:11 PM, Sean OMeara someara@gmail.com wrote:

what centos5 ami are you using?

On Wed, Dec 8, 2010 at 10:01 PM, John E. Vincent (lusis)
lusis.org+chef-list@gmail.com wrote:

I just realized that same return code is something I’ve seen in Nagios
before too when executing plugins. In fact, it’s a similar MO - runs
fine from an interactive session but doesn’t from an automated
session.

It’s generally something to do with the environment that the script is
running under or a permissions error.

And I think I found it:

[root@domU ~]# export PATH=/usr/bin
[root@domU ~]# groupadd -g 504 testgroup
-bash: groupadd: command not found
[root@domU ~]# echo $?
127

It looks like chef-client isn’t importing the path environment
variables. Maybe it should be calling groupadd with the full path?
This is on a CentOS ec2 bootstrap.

Can’t tell at this point if it’s a bug with Chef or with
net-ssh-multi. Still investigating.

On Wed, Dec 8, 2010 at 6:34 PM, Sean OMeara someara@gmail.com wrote:

your error is on line 35:
ec2-184-73-57-106.compute-1.amazonaws.com groupadd -g ‘504’ auser
returned 127, expected 0

-s

On Wed, Dec 8, 2010 at 6:32 PM, Leinartas, Michael
MICHAEL.LEINARTAS@orbitz.com wrote:

Yes! and it’s been driving me crazy!

I’ve never been able to reproduce by logging on to the server and it
occurs
even when I execute chef-client twice, though when i at the end of my
bootstrap do a /etc/init.d/chef-client start everything works normally.

I haven’t gone too far in investigating because the bootstrap still ends
up
working with the init.d start of chef-client but I may look again
tonight
now that I know someone else is experiencing it.

From: “John E. Vincent (lusis)” lusis.org+chef-list@gmail.com
Reply-To: "lusis.org+chef-list@gmail.com"
lusis.org+chef-list@gmail.com
Date: Wed, 8 Dec 2010 16:15:35 -0600
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Error during bootstrap

I’ve not had much time to really investigate this error since I’m just
finishing up my AMIs but has anyone seen anything like this when
creating users as part of the base role at bootstrap?

https://gist.github.com/734009

If I log in immediately after and run chef-client, everything works
fine. It only happens at bootstrap as part of the base role I created.

Thanks!
John E. Vincent
http://about.me/lusis