Juju doesn't appear to set up a complete environment while running the installation scripts and hooks

Bug #816621 reported by Juan L. Negron
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloudfoundry
New
Undecided
Unassigned
pyjuju
Incomplete
Undecided
Unassigned

Bug Description

While working on a charm, I noticed that the install scripts and hooks work as predicted but, when I run them via juju, some packages fail to install.

The install script: http://pastebin.ubuntu.com/652634/
The above install script works fine when in a shell but, fails ( package: cloudfoundry-server ).
The formula.log: http://pastebin.ubuntu.com/652635/

This is blocking cloudfoundry-server from completion. Please help

-Juan

Revision history for this message
Kapil Thangavelu (hazmat) wrote :

2011-07-26 03:39:59,434: hook.output@ERROR: <internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- eventmachine (LoadError)
 from <internal:lib/rubygems/custom_require>:29:in `require'
 from bin/vcap:25:in `<main>'

ensemble runs the hooks as root and in a hook specified shell/interpreter. it looks like a missing dependency that you might have installed locally which is not a fresh install (eventmachine).

Revision history for this message
Clint Byrum (clint-fewbar) wrote : Re: [Bug 816621] [NEW] Ensemble doesn't appear to set up a complete environment while running the installation scripts and hooks

Excerpts from Juan L. Negron's message of Tue Jul 26 19:55:35 UTC 2011:
> Public bug reported:
>
> While working on a formula, I noticed that the install scripts and hooks
> work as predicted but, when I run them via ensemble, some packages fail
> to install.
>
> The install script: http://pastebin.ubuntu.com/652634/
> The above install script works fine when in a shell but, fails ( package: cloudfoundry-server ).
> The formula.log: http://pastebin.ubuntu.com/652635/
>
> This is blocking cloudfoundry-server from completion. Please help

My guess is that there's a missing dependency in the cloudfoundry-server package:

        #install bundler gem - should be packaged
        gem install bundler

Gems are pretty unpredictible.. seems like it had an error:

2011-07-26 03:39:51,193: hook.output@ERROR: ERROR: While executing gem ... (TypeError)
        can't convert nil into String

There are a bunch of bugs where gem depends on files in our home directory
or having the terminal available. I'd suggest packaging bundler with
gem2deb (available in oneiric, builds and works fine on natty too)

I took a stab at it just now, and the generated package works fine except
needs to add rubygems as a dependency.

Revision history for this message
Juan L. Negron (negronjl) wrote :

The problem I have with that assessment is that, if I run the install script
manually, it all works. That's why I included the install script.

Try it out and you'll see that it runs fine when run from a shell but, it
dies when ensemble runs it.

i have also checked the dependencies...

Thanks,

Juan Negron <email address hidden>
System Integration Engineer
Corporate Services
Canonical USA
Mobile: +1 (408) 634-0292
GPG : 0A62 BC70 5CBC B4DD F3E6 8A27 A6B1 F3F0 E6B5 F5A3

On Tue, Jul 26, 2011 at 3:11 PM, Clint Byrum <email address hidden> wrote:

> Excerpts from Juan L. Negron's message of Tue Jul 26 19:55:35 UTC 2011:
> > Public bug reported:
> >
> > While working on a formula, I noticed that the install scripts and hooks
> > work as predicted but, when I run them via ensemble, some packages fail
> > to install.
> >
> > The install script: http://pastebin.ubuntu.com/652634/
> > The above install script works fine when in a shell but, fails ( package:
> cloudfoundry-server ).
> > The formula.log: http://pastebin.ubuntu.com/652635/
> >
> > This is blocking cloudfoundry-server from completion. Please help
>
> My guess is that there's a missing dependency in the cloudfoundry-server
> package:
>
> #install bundler gem - should be packaged
> gem install bundler
>
> Gems are pretty unpredictible.. seems like it had an error:
>
> 2011-07-26 03:39:51,193: hook.output@ERROR: ERROR: While executing gem
> ... (TypeError)
> can't convert nil into String
>
> There are a bunch of bugs where gem depends on files in our home directory
> or having the terminal available. I'd suggest packaging bundler with
> gem2deb (available in oneiric, builds and works fine on natty too)
>
> I took a stab at it just now, and the generated package works fine except
> needs to add rubygems as a dependency.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/816621
>
> Title:
> Ensemble doesn't appear to set up a complete environment while running
> the installation scripts and hooks
>
> Status in CloudFoundry:
> New
> Status in Ensemble:
> New
>
> Bug description:
> While working on a formula, I noticed that the install scripts and
> hooks work as predicted but, when I run them via ensemble, some
> packages fail to install.
>
> The install script: http://pastebin.ubuntu.com/652634/
> The above install script works fine when in a shell but, fails ( package:
> cloudfoundry-server ).
> The formula.log: http://pastebin.ubuntu.com/652635/
>
> This is blocking cloudfoundry-server from completion. Please help
>
> -Juan
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/cloudfoundry/+bug/816621/+subscriptions
>
>

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Excerpts from Juan L. Negron's message of Wed Jul 27 01:40:12 UTC 2011:
> The problem I have with that assessment is that, if I run the install script
> manually, it all works. That's why I included the install script.
>
> Try it out and you'll see that it runs fine when run from a shell but, it
> dies when ensemble runs it.
>
> i have also checked the dependencies...
>

I totally understand that. I'm suggesting that gem is really unreliable
without a tty and/or login shell. I reported a bug in rubygems where it
assumed you would have a certain file in ~ or fail hard. That one is
fixed (and only involved gem build), but I'm sure there are others.

Ensemble isn't the only tool to install without a terminal or shell,
in fact I believe some of the GUI package managers use pipes rather than
pseudo terminals to capture the output.

As annoying as this is (I'd be annoyed were I in your shoes), this seems
like a bug in the postinst of the package, not necessarily Ensemble
(even if though it *is* confusing that it works manually).

Can you try installing the package with < /dev/null ?

Revision history for this message
Juan L. Negron (negronjl) wrote :

We worked around the issue by packaging bundler ( the gem in question ).

Thanks,

Juan Negron <email address hidden>
System Integration Engineer
Corporate Services
Canonical USA
Mobile: +1 (408) 634-0292
GPG : 0A62 BC70 5CBC B4DD F3E6 8A27 A6B1 F3F0 E6B5 F5A3

On Tue, Jul 26, 2011 at 9:29 PM, Clint Byrum <email address hidden> wrote:

> Excerpts from Juan L. Negron's message of Wed Jul 27 01:40:12 UTC 2011:
> > The problem I have with that assessment is that, if I run the install
> script
> > manually, it all works. That's why I included the install script.
> >
> > Try it out and you'll see that it runs fine when run from a shell but, it
> > dies when ensemble runs it.
> >
> > i have also checked the dependencies...
> >
>
> I totally understand that. I'm suggesting that gem is really unreliable
> without a tty and/or login shell. I reported a bug in rubygems where it
> assumed you would have a certain file in ~ or fail hard. That one is
> fixed (and only involved gem build), but I'm sure there are others.
>
> Ensemble isn't the only tool to install without a terminal or shell,
> in fact I believe some of the GUI package managers use pipes rather than
> pseudo terminals to capture the output.
>
> As annoying as this is (I'd be annoyed were I in your shoes), this seems
> like a bug in the postinst of the package, not necessarily Ensemble
> (even if though it *is* confusing that it works manually).
>
> Can you try installing the package with < /dev/null ?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/816621
>
> Title:
> Ensemble doesn't appear to set up a complete environment while running
> the installation scripts and hooks
>
> Status in CloudFoundry:
> New
> Status in Ensemble:
> New
>
> Bug description:
> While working on a formula, I noticed that the install scripts and
> hooks work as predicted but, when I run them via ensemble, some
> packages fail to install.
>
> The install script: http://pastebin.ubuntu.com/652634/
> The above install script works fine when in a shell but, fails ( package:
> cloudfoundry-server ).
> The formula.log: http://pastebin.ubuntu.com/652635/
>
> This is blocking cloudfoundry-server from completion. Please help
>
> -Juan
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/cloudfoundry/+bug/816621/+subscriptions
>
>

Marc Cluet (lynxman)
summary: - Ensemble doesn't appear to set up a complete environment while running
- the installation scripts and hooks
+ Juju doesn't appear to set up a complete environment while running the
+ installation scripts and hooks
description: updated
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Do we have any other examples anymore where install hooks fail that succeed when running inside debug-hooks or any other interactive shell?

I think we should probably close this bug if not.. it seems to me it was unique to the gem install problems of bundler.

Changed in juju:
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.