hdiutil not responsive when installing DMG files using homebrew-cask

652 Views Asked by At

I encountered a weird problem installing DMG packaged apps on MacOS. Below is what I know, but I still have no clue what is wrong.

I tried to install things like skype or inkscape on MacOS (10.13.4) using

brew cask install skype --debug

But it hangs, with the following output.

==> Hbc::Installer#install
==> Printing caveats
==> Hbc::Installer#fetch
==> Satisfying dependencies
==> Downloading
==> Downloading https://inkscape.org/gallery/item/11269/Inkscape-0.92.2-1-x11-10.7-x86_64.dmg
Already downloaded: /Users/hwwu/Library/Caches/Homebrew/Cask/inkscape--0.92.2-1,11269.dmg
==> Downloaded to -> /Users/hwwu/Library/Caches/Homebrew/Cask/inkscape--0.92.2-1,11269.dmg
==> Verifying download
==> Determining which verifications to run for Cask inkscape
==> Checking for verification class Hbc::Verify::Checksum
==> 1 verifications defined
Hbc::Verify::Checksum
==> Running verification of class Hbc::Verify::Checksum
==> Verifying checksum for Cask inkscape
==> SHA256 checksums match
==> Installing Cask inkscape
==> Hbc::Installer#stage
==> Extracting primary container
==> Determining which containers to use based on filetype
==> Checking container class Hbc::Container::Pkg
==> Checking container class Hbc::Container::Ttf
==> Checking container class Hbc::Container::Otf
==> Checking container class Hbc::Container::Air
==> Checking container class Hbc::Container::Cab
==> Checking container class Hbc::Container::Dmg
==> Executing: ["/usr/bin/hdiutil", "imageinfo", "/Users/hwwu/Library/Caches/Homebrew/Cask/inkscape--0.92.2-1,11269.dmg"]
==> Using container class Hbc::Container::Dmg for /Users/hwwu/Library/Caches/Homebrew/Cask/inkscape--0.92.2-1,11269.dmg
==> Executing: ["/usr/bin/hdiutil", "attach", "-plist", "-nobrowse", "-readonly", "-noidme", "-mountrandom", "/var/tmp/d20180606-25779-z2yt24", "/Users/hwwu/Library/Caches/Homebrew/Cask/inkscape--0.92.2-1,11269.dmg"]

So I tried the last line manually

/usr/bin/hdiutil attach -verbose -debug -plist -nobrowse -readonly -noidme -mountrandom /var/tmp/ /Users/hwwu/Library/Caches/Homebrew/Cask/skype--8.22.0.2.dmg

And it hangs and shows

calling DIHLDiskImageAttach with
mount-type: randomized
drive-options:
force-idme: false
quiet: false
mount-point: file:///var/tmp/
verbose: true
debug: true
read-only: true
agent: hdiutil
skip-idme: true
image-options:
main-url: file:///Users/hwwu/Library/Caches/Homebrew/Cask/skype--8.22.0.2.dmg
2018-06-06 11:14:26.858 hdiutil[27659:45934024] DIHLDiskImageAttach: input dictionary {
    agent = hdiutil;
    debug = 1;
    "drive-options" =     {
    };
    "force-idme" = 0;
    "image-options" =     {
    };
    "main-url" = "file:///Users/hwwu/Library/Caches/Homebrew/Cask/skype--8.22.0.2.dmg";
    "mount-point" = "file:///var/tmp/";
    "mount-type" = randomized;
    quiet = 0;
    "read-only" = 1;
    "skip-idme" = 1;
    verbose = 1;
}
2018-06-06 11:14:26.859 hdiutil[27659:45934024] DIHLDiskImageAttach: disabling legacy image format attach
2018-06-06 11:14:26.859 hdiutil[27659:45934024] DIHLDiskImageAttach: newImagekeys = {
    "legacy-disabled" = 1;
}
2018-06-06 11:14:26.859 hdiutil[27659:45934024] DIHLDiskImageAttach: creating DIHelperProxy
2018-06-06 11:14:26.859 hdiutil[27659:45934024] with dictionary: {
    agent = hdiutil;
    debug = 1;
    "drive-options" = <62706c69 73743030 d0080000 00000000 01010000 00000000 00010000 00000000 00000000 00000000 0009>;
    "force-idme" = 0;
    "image-options" = <62706c69 73743030 d101025f 100f6c65 67616379 2d646973 61626c65 6409080b 1d000000 00000001 01000000 00000000 03000000 00000000 00000000 00000000 1e>;
    "main-url" = "file:///Users/hwwu/Library/Caches/Homebrew/Cask/skype--8.22.0.2.dmg";
    "mount-point" = "file:///var/tmp/";
    "mount-type" = randomized;
    operation = DIHelperAttach;
    quiet = 0;
    "read-only" = 1;
    "skip-idme" = 1;
    verbose = 1;
}
2018-06-06 11:14:26.859 hdiutil[27659:45934024] [DIHelperProxy alloc]
2018-06-06 11:14:26.863 hdiutil[27659:45934024] [DIHelperProxy alloc] returning self 0x7fddcf407ba0, retainCount 1
2018-06-06 11:14:26.863 hdiutil[27659:45934024] DIHLDiskImageAttach: running DIHelperProxy
2018-06-06 11:14:26.864 hdiutil[27659:45934024] [DIHelperProxy performOperationReturning] entry
2018-06-06 11:14:26.864 hdiutil[27659:45934024] [DIHelperProxy performOperationReturning] detaching thread
2018-06-06 11:14:26.865 hdiutil[27659:45934029] [DIHelperProxy workerThread] entry
2018-06-06 11:14:26.865 hdiutil[27659:45934029] [DIHelperProxy workerThread] setting up server
2018-06-06 11:14:26.865 hdiutil[27659:45934029] [DIHelperProxy threadSetupServer] entry
2018-06-06 11:14:26.865 hdiutil[27659:45934029] XPC: created intermediaryConnection connection
2018-06-06 11:14:26.865 hdiutil[27659:45934029] XPC: creating helperconnection connection

Both brew doctor and brew cask doctor show no sign of problem. I also disabled LittleSnitch firewall. I have no anti-virus programs installed. Installing other DMG related packages all have this problem. I haven't been able to install anything for sometime. It seems to me that this is a hdiutil or system problem, instead of any homebrew bug. sudo doesn't help, it somehow shows "Unknown UID".

However, by double clicking on a downloaded DMG, it just works as it should be, and installation is just fine.

Please help.

1

There are 1 best solutions below

0
On

Sigh...

It turns out that I was using an outdated iTerms window, where the user id is obsolete. hdiutil fails silently because of this wrong uid.

It is the sudo wrong uid that rings the bell. Hope whoever read this question don't run into my problem.