The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #10986

"Failed to mount" in appdmg/pkgdmg provider

Added by Matthias Pigulla over 2 years ago. Updated 6 months ago.

Status:Code InsufficientStart date:11/21/2011
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:package
Target version:-
Affected Puppet version:2.6.8 Branch:https://github.com/puppetlabs/puppet/pull/56
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket may be automatically exported to the PUP project on JIRA using the button below:


Description

Mac OS X’s mount command sometimes complains “failed to mount – not recognized” for the downloaded file, and even if I haven’t fully understood when/why this happens, using a .dmg or .pkg file extension for the temporary file seems to be a working solution.

The pull req is over there: https://github.com/puppetlabs/puppet/pull/56/


Related issues

Related to Puppet - Bug #11108: The pkgdmg provider is functionally dependent on the reso... Closed 11/30/2011

History

#1 Updated by Josh Cooper over 2 years ago

  • Target version set to 3.x
  • Branch set to https://github.com/puppetlabs/puppet/pull/56

Hi Mattias,

Which version of puppet were you seeing this issue? I tried reproducing on 2.7.x, but wasn’t able to get mount to fail. If you find any more info about why this happens, please let us know.

#2 Updated by Matthias Pigulla over 2 years ago

Puppet 2.6.8.

However, I am sure it’s not related to the Puppet version itself. When I digged into this I manually downloaded the .dmg file in question with the same wget command (taken from puppet’s —debug) and tried to mount it.

As I said, I don’t really know why this happens (or if it happens on all recent versions of OS X). But if the mount fails, simply renaming the file and trying the mount again works…

#3 Updated by Josh Cooper over 2 years ago

  • Status changed from Unreviewed to Accepted
  • Target version changed from 3.x to 2.7.x
  • Affected Puppet version set to 2.6.8

#4 Updated by Gary Larizza over 2 years ago

  • Assignee set to Gary Larizza

#5 Updated by Kelsey Hightower almost 2 years ago

  • Status changed from Accepted to Code Insufficient

So the code needs tests, which I’m happy to pair. Also we need to rebase this pull request before it can be merged.

#6 Updated by Gary Larizza over 1 year ago

  • Assignee deleted (Gary Larizza)

#7 Updated by Andrew Parker over 1 year ago

  • Target version deleted (2.7.x)

#8 Updated by Matthias Pigulla 6 months ago

The above PR at GitHub has been closed because it needs a rebase and lacks tests. Honestly, I am not a Ruby developer and afraid I won’t be able to contribute these.

What I can tell is that the following patch solves the problem at least in the appdmg provider and will probably work in a similar fashion for pkgdmg. (The issue still persists on OS X 10.8.5).

--- a/modules/puppet/lib/puppet/provider/package/appdmg.rb
+++ b/modules/puppet/lib/puppet/provider/package/appdmg.rb
@@ -58,7 +58,7 @@
     tmpdir = Dir.mktmpdir
     begin
       if %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://} =~ cached_source
-        cached_source = File.join(tmpdir, name)
+        cached_source = File.join(tmpdir, name) + '.dmg'
         begin
           curl "-o", cached_source, "-C", "-", "-k", "-L", "-s", "--url", source
           Puppet.debug "Success: curl transfered [#{name}]"

Also available in: Atom PDF