puppetlabs/puppet · error · Puppet::Error

No disk entities returned by mount at %{path}

Error message

No disk entities returned by mount at %{path}

What it means

Raised in `installpkgdmg` (lib/puppet/provider/package/pkgdmg.rb:110) after `hdiutil mount -plist` on a downloaded .dmg. Puppet parses the returned plist and requires a `system-entities` key enumerating mounted volumes; its absence means the mount effectively failed (hdiutil still exited 0 with a minimal plist), so Puppet raises instead of installing from nothing.

Source

Thrown at lib/puppet/provider/package/pkgdmg.rb:110

          args << "--proxy" << "#{http_proxy_host}:#{http_proxy_port}"
        elsif http_proxy_host and !http_proxy_port
          args << "--proxy" << http_proxy_host
        end
        begin
          curl(*args)
          Puppet.debug "Success: curl transferred [#{name}] (via: curl #{args.join(' ')})"
        rescue Puppet::ExecutionFailure
          Puppet.debug "curl #{args.join(' ')} did not transfer [#{name}].  Falling back to local file." # This used to fall back to open-uri. -NF
          cached_source = source
        end
      end

      if source =~ /\.dmg$/i
        # If you fix this to use open-uri again, you must update the docs above. -NF
        File.open(cached_source) do |dmg|
          xml_str = hdiutil "mount", "-plist", "-nobrowse", "-readonly", "-mountrandom", "/tmp", dmg.path
          hdiutil_info = Puppet::Util::Plist.parse_plist(xml_str)
          raise Puppet::Error, _("No disk entities returned by mount at %{path}") % { path: dmg.path } unless hdiutil_info.has_key?("system-entities")

          mounts = hdiutil_info["system-entities"].filter_map { |entity|
            entity["mount-point"]
          }
          begin
            mounts.each do |mountpoint|
              Dir.entries(mountpoint).select { |f|
                f =~ /\.m{0,1}pkg$/i
              }.each do |pkg|
                installpkg("#{mountpoint}/#{pkg}", name, source)
              end
            end
          ensure
            mounts.each do |mountpoint|
              hdiutil "eject", mountpoint
            end
          end
        end

View on GitHub (pinned to e227c27540)

Solutions

  1. Download the same URL with curl on the node and run `hdiutil verify <file>.dmg` to confirm integrity.
  2. Run `hdiutil mount -plist -nobrowse -readonly -mountrandom /tmp <file>.dmg` by hand and inspect the plist for system-entities.
  3. Fix the serving side: correct checksum/length, no intercepting proxy, resumable URL.
  4. Rebuild the DMG with standard options (UDZO) if it was produced by unusual tooling.
Defensive patterns

Strategy: validation

Validate before calling

# Verify the dmg mounts cleanly before Puppet touches it
curl -fsSLo /tmp/check.dmg "$SOURCE_URL" && hdiutil verify /tmp/check.dmg >/dev/null && hdiutil mount -plist -nobrowse -readonly -mountrandom /tmp /tmp/check.dmg | grep -q system-entities && echo OK || echo "dmg unusable"

Prevention

When it happens

Trigger: Corrupt or truncated .dmg (partial download, or the curl-fallback path writing an HTML error page to disk), an unsupported/encrypted image format, DiskArbitration being unusable in the run context (some CI/SSH sessions).

Common situations: A proxy or captive portal mangling the download; artifact cut off mid-transfer; DMGs created with options this hdiutil cannot attach; headless runners lacking a mount context.

Related errors


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/140c94f207df7950. Report an issue: GitHub.