Puppet: System Administration Automated

Support

Ticket #1083 (closed defect: fixed)

Opened 7 months ago

Last modified 6 months ago

0.24.2.rc1 plugins mount broken

Reported by: machpo Assigned to: luke
Priority: highest Milestone: 0.24.2
Component: library Version: 0.24.1
Severity: blocker Keywords: plugins mount
Cc: Triage Stage: Ready for checkin
Attached Patches: Code Complexity: Unknown

Description

After upgrading to 0.24.2.rc1, the plugins mount breaks with the error: "err: Could not call: Paths must be fully qualified", due to the plugins mount not actually having a path. DavidS provided a patch, which seems to solve the problem for several of us:

--- a/lib/puppet/network/handler/fileserver.rb
+++ b/lib/puppet/network/handler/fileserver.rb
@@ -409,8 +409,9 @@ class Puppet::Network::Handler
                 # Remove any double slashes that might have occurred
                 path = URI.unescape(path.gsub(/\/\//, "/"))
             end
-
-            return mount, path
+
+            path = mount.file_path(path, client)
+            return mount, path.sub(/^#{mount.path(client)}/, "")
         end

         def to_s
@@ -756,7 +757,7 @@ class Puppet::Network::Handler
         #
         class PluginMount < Mount
             def path(client)
-                ''
+                '/'
             end

             def mod_path_exists?(mod, relpath, client = nil)

Change History

02/24/08 23:13:45 changed by Fujin

  • severity changed from normal to blocker.
  • stage changed from Unreviewed to Needs more info.

Tested patch, resolves issue. Fileserver test fails with this patch. Need to either fix the test or fix the code which breaks it (something I'm not skilled enough to do)

  1) Failure:
test_fileserver_expansion(TestFileServer)
    [./fileserver.rb:997:in `test_fileserver_expansion'
     ./fileserver.rb:985:in `each'
     ./fileserver.rb:985:in `test_fileserver_expansion'
     /srv/git/puppet.upstream/lib/../vendor/gems/mocha-0.5.6/lib/mocha/test_case_adapter.rb:19:in `__send__'
     /srv/git/puppet.upstream/lib/../vendor/gems/mocha-0.5.6/lib/mocha/test_case_adapter.rb:19:in `run']:
Exception raised:
Class: <Mocha::ExpectationError>
Message: <"#<Mock:0xb73c7168>.value(:kernel) - expected calls: 0, actual calls: 1\nSimilar expectations:\n#<Mock:0xb73c7168>.value(:ipaddress)\n#<Mock:0xb73c7168>.value()\n#<Mock:0xb73c7168>.value()\n#<Mock:0xb73c7168>.value(:domain)">
---Backtrace---
(eval):1:in `value'
/usr/local/lib/site_ruby/1.8/facter/util/ip.rb:24:in `get_interface_value'
/usr/local/lib/site_ruby/1.8/facter/ipmess.rb:36
/usr/local/lib/site_ruby/1.8/facter.rb:510:in `call'
/usr/local/lib/site_ruby/1.8/facter.rb:510:in `value'
/usr/local/lib/site_ruby/1.8/facter.rb:355:in `value'
/usr/local/lib/site_ruby/1.8/facter.rb:352:in `each'
/usr/local/lib/site_ruby/1.8/facter.rb:352:in `value'
/usr/local/lib/site_ruby/1.8/facter.rb:189:in `to_hash'
/usr/local/lib/site_ruby/1.8/facter.rb:187:in `each'
/usr/local/lib/site_ruby/1.8/facter.rb:187:in `inject'
/usr/local/lib/site_ruby/1.8/facter.rb:187:in `to_hash'
/srv/git/puppet.upstream/lib/puppet/indirector/facts/facter.rb:59:in `find'
/srv/git/puppet.upstream/lib/puppet/indirector/indirection.rb:170:in `find'
/srv/git/puppet.upstream/lib/puppet/indirector.rb:42:in `find'
/srv/git/puppet.upstream/lib/puppet/node.rb:154:in `fact_merge'
/srv/git/puppet.upstream/lib/puppet/indirector/node/plain.rb:16:in `find'
/srv/git/puppet.upstream/lib/puppet/indirector/indirection.rb:170:in `find'
/srv/git/puppet.upstream/lib/puppet/indirector.rb:42:in `find'
/srv/git/puppet.upstream/lib/puppet/network/handler/fileserver.rb:248:in `modules_mount'
/srv/git/puppet.upstream/lib/puppet/network/handler/fileserver.rb:397:in `splitpath'
/srv/git/puppet.upstream/lib/puppet/network/handler/fileserver.rb:234:in `convert'
/srv/git/puppet.upstream/lib/puppet/network/handler/fileserver.rb:131:in `list'
./fileserver.rb:998:in `test_fileserver_expansion'
./fileserver.rb:997:in `test_fileserver_expansion'
./fileserver.rb:985:in `each'
./fileserver.rb:985:in `test_fileserver_expansion'

02/24/08 23:17:51 changed by Fujin

Ergh. Forget that last output from the fileserver test - the test is failing here even without the patch. Somethign else has broken it (looks like facter?)

02/26/08 12:02:32 changed by DavidS

It turns out that the first hunk is not neccessary, but breaks when trying to list() a directory. Since others had luck, I presume this is caused by my non-standard modulepath.

02/26/08 14:07:34 changed by luke

  • stage changed from Needs more info to Accepted.

03/01/08 04:36:04 changed by Fujin

  • owner changed from community to luke.
  • priority changed from normal to highest.
  • patch changed from None to Code.
  • stage changed from Accepted to Ready for checkin.
  • milestone set to 0.24.2.

Code available at git://git.junglist.gen.nz/puppet.upstream branch: bug1083

03/01/08 11:16:47 changed by DavidS

damn, damn, damn. Sorry for slipping up on this. Here's the patch that actually works for me:

diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb
index a9a95bc..751a772 100755
--- a/lib/puppet/network/handler/fileserver.rb
+++ b/lib/puppet/network/handler/fileserver.rb
@@ -69,8 +69,8 @@ class Puppet::Network::Handler

             mount.debug("Describing %s for %s" % [url, client]) if client

-            # Remove any leading slashes, since Metadata doesn't like them, yo.
-            metadata = Puppet::FileServing::Metadata.new(url, :path => mount.path(client), :relative_path => path.sub(/^\//, ''), :links => links)
+            # use the mount to resolve the path for us.
+            metadata = Puppet::FileServing::Metadata.new(url, :path => mount.file_path(path, client), :links => links)

             return "" unless metadata.exist?

This is against [ba803a1fb819099], current 0.24.x HEAD.

03/02/08 01:48:05 changed by Fujin

So is the other patches not necessary?

03/02/08 10:59:17 changed by Fujin

22:53 < fujin> DavidS: so uh, what's going on with 1083?
22:53 < fujin> DavidS: that's a blocker for 0.24.2
22:54 < fujin> is your final patch the correct one
22:54 < fujin> or is it your final patch + the other two hunks
22:55 < DavidS> fujin: The final patch is the only modification I currently
                have in my local puppetmaster
22:55 < fujin> right
22:55 < fujin> thanks

Updated patch available in branch: bug1083 @ git://git.junglist.gen.nz/puppet.upstream / http://git.junglist.gen.nz/?p=puppet.upstream;a=commitdiff;h=a12d7610a655e5e1d5052b152502176c2fa47fb7

03/03/08 17:31:05 changed by luke

  • status changed from new to closed.
  • resolution set to fixed.

Applied in [ee88c58546c2ca2bf7d77fd36d6443777eb0965f].

Sorry fujin, I'd already applied it myself.