question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

hdiutil unmount issue blocks dmg creation for MacOS builds

See original GitHub issue

Versions in use:

  • electron-builder: 21.2.0
  • electron: 5.0.2
  • node: 12.0.0

Building for MacOS

Issue:

We recently upgraded our technical stack to allow for the notarization of our app. We are using electron-notarize and for the most part, everything works as expected. Unfortunately, when building our application for distribution we are running into a problem with MacOS where the dmg creation fails about 90% of the time (you can check the supplied logs in the issue for more information). We thought that the problem might be something with our setup and we spent a significant amount of time digging into that but to no avail.

After checking things over we decided to look into electron-builder and after setting the debug flags DEBUG=electron-builder DEBUG_DMG=true we see that there is a problem when running the hdiutil command in electron-builder. I did some research and the only references to this error are back from 2016 here: https://github.com/electron-userland/electron-builder/issues/854. Unfortunately, we have no antivirus running and none of the comments in that thread have helped.

The problem we are facing really slows us down and we often have to build 10 or more times before we get a successful build. Has anyone else faced this issue? Is there something silly I am overlooking? Any help would be really appreciated. If more logs are useful then please let me know and I can post a more detailed logging output. Thanks for the help in advance.

Relevant logs:

[20:05:03] 2020-01-21 20:04:58.562 diskimages-helper[94927:334169] *useEffectiveIDs**** euid/egid changed to 501,20 (uid/gid is 501,20)
[20:05:03] DIHLDiskImageCreate() returned 49168
[20:05:03] hdiutil: create: returning 49168
[20:05:03] hdiutil: create failed - Resource busy

[20:05:03] • exited command=hdiutil code=1 pid=94924
[20:05:03] • async task error error=hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
[20:05:26] • building embedded block map file=dist/App.zip
[20:05:26] • spawning command=/Users/builder/buildslave/app/build/node_modules/app-builder-bin/mac/app-builder blockmap --input /Users/builder/buildslave/app/build/dist/App.zip --compression deflate
[20:05:26] • exited command=app-builder code=0 pid=95022 out={"size":71064404,"sha512":"T9qUijiL5hlbvHQDF8dY8os8yKj/uTGeVmq060HtN+/MJy7ryuAxiOjq+aTXHb17h88vh7bl+yZ8LpQFFcyLDQ=="

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:51 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
manderson-tecommented, Aug 3, 2020

I wrestled with this exact issue for several hours tonight until I came across this post on superuser.com, which led me to try disabling Spotlight indexing: https://electrictoolbox.com/disable-spotlight-indexing-mac-osx/. After running sudo mdutil -a -i off the build started working immediately. If you’re still struggling with this issue, then I’d try doing the same.

As for why Sophos could have been material to other folks’ problems, I figure that’s because Sophos must scan your disk in the same problematic way that Spotlight does. That’s just speculation, though.

EDIT: changed the mdutil command to disable indexing to all stores on all volumes.

4reactions
alexpelancommented, Nov 19, 2020

I believe the underlying issue here is fixed by this pull request: https://github.com/LinusU/node-appdmg/pull/190

Read more comments on GitHub >

github_iconTop Results From Across the Web

hdiutil unmount issue blocks dmg creation for MacOS builds
node : 12.0.0. Building for MacOS. Issue: We recently upgraded our technical stack to allow for the notarization of our app. We are...
Read more >
macOS Error Opening .dmg Disk Image - No Mountable File ...
Type hdiutil attach -verbose into the terminal. Add a space at the end, but don't press enter yet. Drag the dmg file from...
Read more >
hdiutil Man Page - macOS - SS64.com
Mount a Disk Image: $ hdiutil attach /path/to/diskimage.dmg ; Unmount a Disk Image: $ hdiutil detach /dev/disk2s1 ; Create a Disk Image from...
Read more >
hdiutil attach/detach/convert results to "resource temporarily ...
dmg " behaves the same like hdiutil detach -> a conversion breaks with "resource temporarily unavailable". So there is still a difference between ......
Read more >
Can't unmount GoogleDrive (Resource busy) - Ask Different
I have a problem to unmount Google Drive volume. ... hdiutil unmount -force /Volumes/GoogleDrive hdiutil: unmount: "/Volumes/GoogleDrive" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found