rodjek / librarian-puppet

http://librarian-puppet.com
MIT License
692 stars 209 forks source link

0.9.4 breaks with "Cannot bounce Puppetfile.lock!" #31

Closed amosshapira closed 10 years ago

amosshapira commented 12 years ago

After installing 0.9.4, it keeps failing with the following stack trace. Downgrading to 0.9.3 fixes the problem:

[Librarian] Bouncing Puppetfile.lock
[Librarian] lockfile_text: 
FORGE
  remote: http://forge.puppetlabs.com
  specs:
    puppetlabs/apache (0.4.0)
      puppetlabs/firewall (>= 0.0.4)
      puppetlabs/stdlib (>= 2.2.1)
    puppetlabs/firewall (0.0.4)
    puppetlabs/ruby (0.0.2)
    puppetlabs/stdlib (3.0.1)

FORGE
  remote: http://forge.puppetlabs.com
  specs:
    puppetlabs/apache (0.4.0)
      puppetlabs/firewall (>= 0.0.4)
      puppetlabs/stdlib (>= 2.2.1)
    puppetlabs/firewall (0.0.4)
    puppetlabs/ruby (0.0.2)
    puppetlabs/stdlib (3.0.1)

FORGE
  remote: http://forge.puppetlabs.com
  specs:
    puppetlabs/apache (0.4.0)
      puppetlabs/firewall (>= 0.0.4)
      puppetlabs/stdlib (>= 2.2.1)
    puppetlabs/firewall (0.0.4)
    puppetlabs/ruby (0.0.2)
    puppetlabs/stdlib (3.0.1)

FORGE
  remote: http://forge.puppetlabs.com
  specs:
    puppetlabs/apache (0.4.0)
      puppetlabs/firewall (>= 0.0.4)
      puppetlabs/stdlib (>= 2.2.1)
    puppetlabs/firewall (0.0.4)
    puppetlabs/ruby (0.0.2)
    puppetlabs/stdlib (3.0.1)

GIT
  remote: git://github.com/puppetlabs/puppetlabs-apache.git
  ref: master
  sha: 6f4be236f60ccf3f8d9d7f4e99eafa4ab56caa87
  specs:
    apache (0.4.0)
      puppetlabs/firewall (>= 0.0.4)
      puppetlabs/stdlib (>= 2.2.1)

GIT
  remote: git://github.com/puppetlabs/puppetlabs-passenger.git
  ref: master
  sha: f734c861bcb2bd01d201423baf0e3e8dd1ef65ab
  specs:
    passenger (0.0.4)
      puppetlabs/apache (>= 0.0.3)
      puppetlabs/ruby (>= 0.0.1)

GIT
  remote: git://github.com/puppetlabs/puppetlabs-stdlib.git
  ref: master
  sha: 6961179007dce76d7fb9bd1fc361273acb4129a7
  specs:
    stdlib (3.0.1)

GIT
  remote: git@bitbucket.org:ashapira/puppet-module-opsview.git
  ref: master
  sha: 8916bf1053d790f1becc2721351108890f109a7f
  specs:
    opsview (0.3.0)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-autofs.git
  ref: master
  sha: 259bb66394d3f386ce2ee7093818a765084bd3c2
  specs:
    autofs (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-nfs.git
  ref: master
  sha: a04268be275e687e5499e055964fd4dd98aeba43
  specs:
    nfs (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-ntpd.git
  ref: master
  sha: b24f216b04b74cbfa68f706c7bdd206696a314bc
  specs:
    ntpd (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-resolv.git
  ref: master
  sha: 65c53afb306026cba53196948f79a0058fa6a589
  specs:
    resolv (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-resolver.git
  ref: master
  sha: 6ec5f2f97f2926ed6fb6c126f1765e4a0c579ef7
  specs:
    resolver (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-serial.git
  ref: master
  sha: 76108b1ccc3e127dafc72788865646848df39dcb
  specs:
    serial (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-ssh.git
  ref: master
  sha: 5e33f31bf06acf59bf185f03eb0896ed59bfed39
  specs:
    ssh (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-sssd.git
  ref: master
  sha: 654538aa741276837d19bcf599652976de49cc93
  specs:
    sssd (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-sudo.git
  ref: master
  sha: dc067c455ac92b407de44415ec8ae591de663be0
  specs:
    sudo (0.0.1)

DEPENDENCIES
  apache (>= 0)
  autofs (>= 0)
  nfs (>= 0)
  ntpd (>= 0)
  opsview (>= 0)
  passenger (>= 0)
  resolv (>= 0)
  resolver (>= 0)
  serial (>= 0)
  ssh (>= 0)
  sssd (>= 0)
  stdlib (>= 0)
  sudo (>= 0)

[Librarian] bounced_lockfile_text: 
FORGE
  remote: http://forge.puppetlabs.com
  specs:
    puppetlabs/apache (0.4.0)
      puppetlabs/firewall (>= 0.0.4)
      puppetlabs/stdlib (>= 2.2.1)
    puppetlabs/firewall (0.0.4)
    puppetlabs/ruby (0.0.2)
    puppetlabs/stdlib (3.0.1)

GIT
  remote: git://github.com/puppetlabs/puppetlabs-apache.git
  ref: master
  sha: 6f4be236f60ccf3f8d9d7f4e99eafa4ab56caa87
  specs:
    apache (0.4.0)
      puppetlabs/firewall (>= 0.0.4)
      puppetlabs/stdlib (>= 2.2.1)

GIT
  remote: git://github.com/puppetlabs/puppetlabs-passenger.git
  ref: master
  sha: f734c861bcb2bd01d201423baf0e3e8dd1ef65ab
  specs:
    passenger (0.0.4)
      puppetlabs/apache (>= 0.0.3)
      puppetlabs/ruby (>= 0.0.1)

GIT
  remote: git://github.com/puppetlabs/puppetlabs-stdlib.git
  ref: master
  sha: 6961179007dce76d7fb9bd1fc361273acb4129a7
  specs:
    stdlib (3.0.1)

GIT
  remote: git@bitbucket.org:ashapira/puppet-module-opsview.git
  ref: master
  sha: 8916bf1053d790f1becc2721351108890f109a7f
  specs:
    opsview (0.3.0)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-autofs.git
  ref: master
  sha: 259bb66394d3f386ce2ee7093818a765084bd3c2
  specs:
    autofs (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-nfs.git
  ref: master
  sha: a04268be275e687e5499e055964fd4dd98aeba43
  specs:
    nfs (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-ntpd.git
  ref: master
  sha: b24f216b04b74cbfa68f706c7bdd206696a314bc
  specs:
    ntpd (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-resolv.git
  ref: master
  sha: 65c53afb306026cba53196948f79a0058fa6a589
  specs:
    resolv (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-resolver.git
  ref: master
  sha: 6ec5f2f97f2926ed6fb6c126f1765e4a0c579ef7
  specs:
    resolver (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-serial.git
  ref: master
  sha: 76108b1ccc3e127dafc72788865646848df39dcb
  specs:
    serial (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-ssh.git
  ref: master
  sha: 5e33f31bf06acf59bf185f03eb0896ed59bfed39
  specs:
    ssh (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-sssd.git
  ref: master
  sha: 654538aa741276837d19bcf599652976de49cc93
  specs:
    sssd (0.0.1)

GIT
  remote: git@bitbucket.org:infrastructure/puppet-module-sudo.git
  ref: master
  sha: dc067c455ac92b407de44415ec8ae591de663be0
  specs:
    sudo (0.0.1)

DEPENDENCIES
  apache (>= 0)
  autofs (>= 0)
  nfs (>= 0)
  ntpd (>= 0)
  opsview (>= 0)
  passenger (>= 0)
  resolv (>= 0)
  resolver (>= 0)
  serial (>= 0)
  ssh (>= 0)
  sssd (>= 0)
  stdlib (>= 0)
  sudo (>= 0)

Cannot bounce Puppetfile.lock!
/usr/lib/ruby/gems/1.8/gems/librarian-puppet-0.9.4/vendor/librarian/lib/librarian/action/resolve.rb:35:in `run'
/usr/lib/ruby/gems/1.8/gems/librarian-puppet-0.9.4/vendor/librarian/lib/librarian/cli.rb:161:in `resolve!'
/usr/lib/ruby/gems/1.8/gems/librarian-puppet-0.9.4/lib/librarian/puppet/cli.rb:63:in `install'
/usr/lib/ruby/gems/1.8/gems/thor-0.16.0/lib/thor/task.rb:27:in `send'
/usr/lib/ruby/gems/1.8/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
/usr/lib/ruby/gems/1.8/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/thor-0.16.0/lib/thor.rb:275:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
/usr/lib/ruby/gems/1.8/gems/librarian-puppet-0.9.4/vendor/librarian/lib/librarian/cli.rb:29:in `bin!'
/usr/lib/ruby/gems/1.8/gems/librarian-puppet-0.9.4/bin/librarian-puppet:9
/usr/bin/librarian-puppet:19:in `load'
/usr/bin/librarian-puppet:19

The diff between the lockfile_text and the bounced_lockfile_text is:

--- /tmp/old    2012-09-07 11:32:35.259971612 +1000
+++ /tmp/new    2012-09-07 11:32:50.731971574 +1000
@@ -8,36 +8,6 @@
     puppetlabs/ruby (0.0.2)
     puppetlabs/stdlib (3.0.1)

-FORGE
-  remote: http://forge.puppetlabs.com
-  specs:
-    puppetlabs/apache (0.4.0)
-      puppetlabs/firewall (>= 0.0.4)
-      puppetlabs/stdlib (>= 2.2.1)
-    puppetlabs/firewall (0.0.4)
-    puppetlabs/ruby (0.0.2)
-    puppetlabs/stdlib (3.0.1)
-
-FORGE
-  remote: http://forge.puppetlabs.com
-  specs:
-    puppetlabs/apache (0.4.0)
-      puppetlabs/firewall (>= 0.0.4)
-      puppetlabs/stdlib (>= 2.2.1)
-    puppetlabs/firewall (0.0.4)
-    puppetlabs/ruby (0.0.2)
-    puppetlabs/stdlib (3.0.1)
-
-FORGE
-  remote: http://forge.puppetlabs.com
-  specs:
-    puppetlabs/apache (0.4.0)
-      puppetlabs/firewall (>= 0.0.4)
-      puppetlabs/stdlib (>= 2.2.1)
-    puppetlabs/firewall (0.0.4)
-    puppetlabs/ruby (0.0.2)
-    puppetlabs/stdlib (3.0.1)
-
 GIT
   remote: git://github.com/puppetlabs/puppetlabs-apache.git
   ref: master
jamezpolley commented 12 years ago

Instead of downgrading, I managed to make this go away by grooming the Modulefiles for all of my modules and bumping the version numbers, and re-arranging my Puppetfile so that the modules being installed from the Forge are listed at the top, and making a few other changes.

I have no idea which of these changes fixed the problem. I don't even know what the problem was, except that I'm guessing it's related to the multiple FORGE listings in your example above (my example also had multiple FORGE sections; once it started working, there was only one FORGE). A more descriptive error message would help figure this out.

amosshapira commented 12 years ago

Thanks James, I'll try that.

jamezpolley commented 12 years ago

Today, without changing our Puppetfile, we're back at the uselessly cryptic "Cannout bounce puppetfile.lock" message, and once again the output from librarian-puppet update --verbose shows that it's trying to define the forge twice.

I've downgraded to 0.9.3 as well

aussielunix commented 12 years ago

@jamezpolley @amosshapira can you post a copy of a Puppetfile that you are having trouble with ?

amosshapira commented 12 years ago
mod 'apache',
  :git => 'git://github.com/puppetlabs/puppetlabs-apache.git'

mod 'passenger',
  :git => 'git://github.com/puppetlabs/puppetlabs-passenger.git'

mod 'stdlib',
  :git => 'git://github.com/puppetlabs/puppetlabs-stdlib.git'

mod 'sssd',
  :git => 'git@bitbucket.org:infrastructure/puppet-module-sssd.git'

mod 'resolv',
  :git => 'git@bitbucket.org:infrastructure/puppet-module-resolv.git'

mod 'serial',
  :git => 'git@bitbucket.org:infrastructure/puppet-module-serial.git'

mod 'ntpd',
  :git => 'git@bitbucket.org:infrastructure/puppet-module-ntpd.git'

mod 'nfs',
  :git => 'git@bitbucket.org:infrastructure/puppet-module-nfs.git'

mod 'autofs',
  :git => 'git@bitbucket.org:infrastructure/puppet-module-autofs.git'

#mod 'opsview',
#  :git => 'git@bitbucket.org:infrastructure/puppet-module-opsview.git'

mod 'opsview',
  :git => 'git@bitbucket.org:ashapira/puppet-module-opsview.git'

mod 'sudo',
  :git => 'git@bitbucket.org:infrastructure/puppet-module-sudo.git'

mod 'resolver',
  :git => 'git@bitbucket.org:infrastructure/puppet-module-resolver.git'

mod 'ssh',
  :git => 'git@bitbucket.org:infrastructure/puppet-module-ssh.git'

mod 'manage_logs',
  :git => 'git@bitbucket.org:infrastructure/puppet-module-manage_logs.git'
aussielunix commented 12 years ago

Thanks.

eshamow commented 12 years ago

I am also seeing this issue with 0.9.4, resolvable by downgrading to 0.9.3. This happens with a very simple Puppetfile and happens whether or not I define a forge:

forge "http://forge.puppetlabs.com"

mod 'epel', :git => 'https://github.com/stahnma/puppet-module-epel.git'

mod 'firewall', :git => 'https://github.com/puppetlabs/puppetlabs-firewall.git'

mod 'jenkins', :git => 'https://github.com/rtyler/puppet-jenkins'

mod 'package_plug_plugins', :git => 'https://github.com/eshamow/eshamow-package_plus_plugins.git'

mod 'selinux', :git => 'https://github.com/jfryman/puppet-selinux.git'

mod 'vcsrepo', :git => 'https://github.com/puppetlabs/puppetlabs-vcsrepo.git'

mblair commented 12 years ago

According to git bisect, this is being caused by this commit:

https://github.com/rodjek/librarian-puppet/commit/5f29751c7423359a9397d9e942fd52f3a7585368

It only occurs (for me) with Puppetfiles that only have modules with git sources.

Here's my bisect script:

#!/usr/bin/env bash

set -o errexit
set -o xtrace

rm pkg/*.gem
rm -f Puppetfile Puppetfile.lock
rm -rf .librarian/ .tmp/
rm -rf modules
rake build
gem uninstall --executables librarian-puppet
gem install pkg/librarian-puppet*.gem
cat > Puppetfile <<EOF
forge "http://forge.puppetlabs.com"

mod "rtyler/jenkins", :git => "https://github.com/rtyler/puppet-jenkins"
EOF
librarian-puppet install
adrienthebo commented 12 years ago

I'm being affected by this bug as well with librarian-puppet version 0.9.4.

adrienthebo commented 12 years ago

This also affects 0.9.5, but not 0.9.2.

benjaminws commented 12 years ago

Seeing it in 0.9.5. I threw diffy into the mix and it looks like there's an extra FORGE section being outputted into the lockfile_text, causing the diff to fail.

https://gist.github.com/3829272

Aethylred commented 12 years ago

It looks like this may be due to a librarian trying to install a dependent module when you've already specified another version/variation/fork. I don't know how it's doing this when you're only using modules provided via git.

e.g. the puppetlabs/passenger module is dependent on puppetlabs/apache, but you're installing a fork.

Is there an option to disable loading dependencies?

jamezpolley commented 12 years ago

@Aethylred Even when you pull in modules via git, they can specify their own dependencies in their Modulefile.

I was seeing a case where I was pulling saz/sudo from git; but other modules just specified "saz/sudo" in their modulefile. If I use --verbose, I'd predictably end up with the version from forge; without --verbose, I end up with the version from github about 2/3rds of the time, but the forge version the rest of the time.

Aethylred commented 12 years ago

In the instance I tried, where I've used a module from Puppet Forge with a modified dependency from GitHub, you're describing the reverse. Hence why I raised it as a separate issue.

Your other comment about a race condition in the --verbose issue would fit all three scenarios.

carlossg commented 11 years ago

I have fixed this issue in our fork adding a test https://github.com/maestrodev/librarian-puppet/commit/5b7fd954f0b008124238918aca49ebdbfbef3a19

Depends on other patches that I submitted, so I didn't create a pull request yet. You can try using the gem librarian-puppet-maestrodev 0.9.7.1 https://rubygems.org/gems/librarian-puppet-maestrodev

I think it's the same as https://github.com/rodjek/librarian-puppet/issues/35

beddari commented 11 years ago

I hereby nominate @carlossg ;-)

craigtracey commented 11 years ago

Of course I just noticed @carlossg's fix immediately following my nearly identical pull request: https://github.com/rodjek/librarian-puppet/pull/66.

As he correctly states, this should address both this Issue and https://github.com/rodjek/librarian-puppet/issues/35.

jwhitley commented 11 years ago

+1 I can confirm that @carlossg's fork fixes this issue for us.

richleland commented 11 years ago

Confirmed that the fix in @carlossg's fork works for me as well. @carlossg you mention there are some other patches you are waiting on before submitting a pull request - I'm wondering if it'd be good to list all of those out here along with a pull req for the work in your fork.

@rodjek any chance we could get all of @carlossg's work reviewed/pulled in and a new gem released? Thanks!

craigtracey commented 11 years ago

+1 @richleland

There are a number of issues that have waiting PR's that we require for using librarian-puppet reliably. Right now we are building off a fork and a private gem repo. We would much rather be on master.

carlossg commented 11 years ago

There are several patches, with their pull requests #55 #59 #60 and other ones that are superseeded by them like #65 #66 We keep our fork at https://github.com/maestrodev/librarian-puppet/tree/maestrodev until the pull requests are merged, and a public gem at https://rubygems.org/gems/librarian-puppet-maestrodev

Aethylred commented 11 years ago

The gem published at https://rubygems.org/gems/librarian-puppet-maestrodev is version 0.9.7.2, could it be at least updated to 0.9.7.3?

carlossg commented 11 years ago

0.9.7.2 has everything, there's no new commits on 0.9.7.3 yet https://github.com/maestrodev/librarian-puppet/tree/maestrodev-v0.9.7.2

salimane commented 11 years ago

I have the same problem with the latest version. https://github.com/maestrodev/librarian-puppet/tree/maestrodev-v0.9.7.2 fixed the problem.

So are his changes getting merged ? Thanks

llwt commented 11 years ago

Any news on this getting merged/fixed?

paulruiz commented 11 years ago

Does this still happen for you with version 0.9.9? I haven't seen this error since upgrading.

llwt commented 11 years ago

0.9.9 seems to fix it!

salimane commented 11 years ago

I'm not getting any error on 0.9.9

carlossg commented 10 years ago

Fixes are in master already

bechampion commented 10 years ago

Guys , I've tried everything without a fix , i finally removed a module from a not trustworthy source now everything works fine . Error needs to be descriptive