Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE #5431

Closed
EdmarPereira opened this issue Nov 19, 2020 · 43 comments
Closed

hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE #5431

EdmarPereira opened this issue Nov 19, 2020 · 43 comments

Comments

@EdmarPereira
Copy link

EdmarPereira commented Nov 19, 2020

I'm not able to generate builds for MacOs, I've made several attempts to change versions and the error persists:

⨯ hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE stackTrace= Error: hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE at ChildProcess.<anonymous> (/.../node_modules/builder-util/src/util.ts:243:14) at Object.onceWrapper (events.js:417:26) at ChildProcess.emit (events.js:310:20) at maybeClose (internal/child_process.js:1021:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

I did the tests with the following combinations
electron-builder: 20.36.2
electron: 3.0.9

electron-builder: 21.1.6
electron: 7.15.0

electron-builder: 21.1.5
electron: 5.0.8

and also with the latest version for both
electron-builder: 22.9.1
electron: 11.0.2

All tests were done using a Macbook Air Catalina version 10.15.7 and Node version 12.16.3. Sometimes I have some success using debug mode with DEBUG=electron-builder node_modules/.bin/electron-builder build -m
Additional information: I do not use any kind of antivirus.

Please help me, I create a big project but in every version released I have problems building versions for MacOs.

@ahmetuysal
Copy link

I have the same issue.

@btzsoft
Copy link

btzsoft commented Nov 23, 2020

having the same issue, also it says:

Error output:
- Searching dependency tree
rm: ./Release/.deps/Release/obj.target/validation/src/validation.o.d.raw: No such file or directory
make: *** [Release/obj.target/validation/src/validation.o] Error 1
✖ Rebuild Failed
An unhandled error occurred inside electron-rebuild
node-gyp failed t

@EdmarPereira
Copy link
Author

I ask for help because in the company where we work we have created a very large project using electron, if we cannot solve this problem we will have to look for another option. I don't know what else to do, the only problem we found is to generate builds for MacOs, we bought a Macbook just for that, we don't have anything else installed to avoid conflicts, please if anyone has a solution for this I would really appreciate it.
Thank you.

@mmaietta
Copy link
Collaborator

mmaietta commented Dec 2, 2020

What version of xcode are you guys using? What version of python?

Also, @btzsoft, thanks for adding. electron-rebuild is a different project, but I think it points to this being a node-gyp env issue. I found these in a quick search for validation.o.d.raw
Kurento/bugtracker#362
OpenSOC/opensoc-ui#23

My best guess is that there's an issue with xcode and node-gyp. Can you try troubleshooting with this?
https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md#the-acid-test

Still failing? Then this is the ultimate brute force reset:
nodejs/node-gyp#1861 (comment)

Link: nodejs/node-gyp#1927

@EdmarPereira
Copy link
Author

EdmarPereira commented Dec 3, 2020

For python --> 2.7.16
For xCode --> 11.4
Build version 11E146

and also follow the instructions:

I run sudo rm -rf /Library/Developer/CommandLineTools
and then xcode-select --install

With acid test:
curl -sL https://github.com/nodejs/node-gyp/raw/master/macOS_Catalina_acid_test.sh | bash
the result: --> Command Line Tools version: 12.2.0.0.1.1604628099

But without success the error persists.

@chokladmal
Copy link
Contributor

chokladmal commented Dec 10, 2020

I've been struggling with this problem as well. After debugging I got to createStageDmg

await spawn("hdiutil", imageArgs)
where hdiutil seems to be failing randomly.

I still haven't figured out the root cause but by simply repeating that line, spawning hdiutil, until it it returns with a successful status code (for me it usually takes two or three attempts) the entire chain starts working. My quick and dirty hack solves my immediate problem of not being able to build my application but of course I'd like to get to the bottom of what is actually causing this.

@EdmarPereira
Copy link
Author

EdmarPereira commented Dec 10, 2020

I really don't know what to do, as I mentioned above I had a problem generating a build for the Mac on the day of the application release. We are about to lose the project because we cannot trust when the module will work, I have already done almost 20 builds without success, sometimes I can create the build the second time. I am working on this project that I created from the beginning a year ago and now I am no longer able to deliver the project ready to the client because we do several builds.

chokladmal added a commit to chokladmal/electron-builder that referenced this issue Dec 10, 2020
…5431)

For unknown reasons hdiutil fails randomly when trying to create the dmg in
the tmp location. This workaround simply retries until it works or throws
the latest error if it fails ten times.
@chokladmal
Copy link
Contributor

I just pushed the workaround I've tried here master...chokladmal:workaround-for-hdiutil-failing
Perhaps you could try it out? I wish I had the answer to why it's failing but right now this is what is saving me.

@chokladmal
Copy link
Contributor

Would something like that be accepted for merging until a better solution can be found?

@EdmarPereira
Copy link
Author

How can I use this ? Just update the latest version of electron-builder and it will be there ?

@mmaietta
Copy link
Collaborator

mmaietta commented Dec 10, 2020

@EdmarPereira you can use patch-package to get it working in your current repo without waiting for a fix upstream to be applied.

@chokladmal can you add your mac build configuration? I'm curious what config your build is failing with. Can you describe/log what imageArgs it's failing with? Perhaps add a console log in the npm module code?
I recall hitting an issue during hdiutil unmount a volume back when I didn't have electron-builder, it needed a few seconds delay in order for MacOS to deem it as no longer being used.

Even better would be an explicit error code number for us to run with. I found this ref but I don't know what imageArgs are failing right now
https://discussions.apple.com/thread/5667409

@chokladmal
Copy link
Contributor

macOS Catalina, version 10.15.7
Python 2.7.16
Xcode 12.1, Build version 12A7403
macOS_Catalina_acid_test.sh returns Command Line Tools not found

Relevant logs:
* spawning command=hdiutil create -srcfolder /Users/myuser/projects/myapp/dist/mac/MyApp.app -volname MyApp 0.8.2 -anyowners -nospotlight -format UDRW -quiet -fs HFS+ -fsargs -c c=64,a=16,e=16 /private/var/folders/y6/qfhlwpld35q1gvpm6qm1j5580000gr/T/t-4w7RLH/0.dmg
• exited command=hdiutil code=1 pid=2736
• hdiutil create failed error=Error: hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE

Setting a breakpoint in handleProcess gives nothing more than the log: exit code 1 and no output on stdout or stderr (empty strings).

I've tried various things to try to figure out what is going on, including creating the full path to where the dmg would be created prior to spawning hdiutil and "sleeping" for a few seconds before spawning in case of race condition. No luck in finding any leads so far.

I will keep investigating and also check with my other team members if they can spot anything else. Not too long ago this used to work so I hope I can find a machine where it still builds and do some comparisons.

@chokladmal
Copy link
Contributor

And the obvious thing that I should have tried from the beginning: running hdiutil with -debug

@EdmarPereira Looks like it might be related to what you had discovered before. The debug output reveals some unmounting problems:

detachTempimageFile: synchronous unmount /dev/disk3s1 returned 49168

and

2020-12-11 02:46:45.163 diskimages-helper[3922:2771162] detachTempImageFile: synchronous unmount /dev/disk3s1 [temp] returned 0x0000C010 (49168)
2020-12-11 02:46:45.165 diskimages-helper[3922:2771162] detachTempImageFile: synchronous eject /dev/disk3s1 [temp] returned 0x0000C010 (49168)
2020-12-11 02:46:45.165 diskimages-helper[3922:2771162] _detachTempImageFile: returning 49168

and finally

DIHLDiskImageCreate() returned 49168
hdiutil: create failed - Resource busy

@mmaietta
Copy link
Collaborator

mmaietta commented Dec 11, 2020

Check your antivirus that's installed as it may be the blocker. Half the time my builder fails when creating dmgs, even if signed. My Sophos Antivirus quarantines it lol

This may be a repeat of an old issue then: #854 (comment)

If hdituil unmount is explicitly being used (as opposed to just hdiutil create), then we can try a fix using a --force flag. Note, calling this also requires your cwd to not be within the dmg itself too.

@chokladmal
Copy link
Contributor

In this case it's unmounting as part of hdiutil create that fails so not sure if we can force it in any way. I will try to get my antivirus to not touch the file but being a company laptop that may turn out to be somewhat complicated. We'll see...

@EdmarPereira
Copy link
Author

EdmarPereira commented Dec 11, 2020

About the antivirus problems I am not using for generate the dmg.

@chokladmal is the any possibility to fix this include this workaround on next versions ?

@mmaietta
Copy link
Collaborator

mmaietta commented Dec 14, 2020

Left a comment on the PR to tidy it up.

Regarding a proper solution, I noticed on the hdiutil man page that the create command has an -attach option.

-attach
attach the image after creating it. If no filesystem is specified via -fs, the attach will fail per the default attach -mount required behavior.

I'm not able to repro this problem locally, so I'm wondering if you could test this approach of using hdiutil create -attach -debug <imageArgs> and see if it still fails.
If it doesn't fail, then maybe we just need to split "create" into steps and the 2nd (delayed) step be an explicit hdiutil detach <pathToVolume>. If the latter still fails, then let's see what adding -verbose to both steps reveal.

I have a hunch that there are still open files on the mounted volume, so the unmount fails since it isn't forced. At least, that's how I'm interpreting from the detach -force and unmount -force docs right now 🤞🏻

@chokladmal
Copy link
Contributor

chokladmal commented Dec 17, 2020 via email

@chokladmal
Copy link
Contributor

I've done some tests on the suggested -attach arg and it looks promising. With that arg it seems to succeed every time (at least the few times I've tried). Next step is to actually unmount it. When running hdiutil unmoun separately I'm getting:

hdiutil: unmount: "/private/var/folders/y6/qfhlwpld35q1gvpm6qm1j5580000gr/T/t-xz5mms/0.dmg" failed to unmount due to error 49168.
hdiutil: unmount: result: 49168
hdiutil: unmount failed - Resource busy

@mmaietta
Copy link
Collaborator

mmaietta commented Dec 17, 2020

Can you please try detach instead of unmount? Might be worth a try adding it behind await setTimeout(async () => { <detach> }, 1000) too to force the call to the end of the execution queue?

You need to always detach the disk image -- unmounting it unmounts the filesystem, but leaves disk image attached to a /dev/disk* entry, with a diskimages-helper process running to handle it. Note that hdiutil detach will take care of unmounting the volume for you (provided Disk Arbitration is running), so you can just skip the unmount step.

Ref: https://stackoverflow.com/a/4047528

@lutzroeder
Copy link
Contributor

lutzroeder commented Dec 17, 2020

ERR_ELECTRON_BUILDER_CANNOT_EXECUTE is a generic error. It would be helpful to see the actual error from hdiutil which should be written to console when running with export DEBUG_DMG=true. Do we understand the underlying issue down to running the hdiutil command in isolation and why it is failing?

@chokladmal
Copy link
Contributor

I'm afraid I'll have to take back my previous happy comment about -attach. I'm back to getting the same error again. :(

@chokladmal
Copy link
Contributor

chokladmal commented Dec 18, 2020

ERR_ELECTRON_BUILDER_CANNOT_EXECUTE is a generic error. It would be helpful to see the actual error from hdiutil which should be written to console when running with export DEBUG_DMG=true. Do we understand the underlying issue down to running the hdiutil command in isolation and why it is failing?

We know that "hdiutil create", when it fails, always fail due to failing to unmount (resource busy). Why that is is hard to say though. Could perhaps be antivirus or something else touching the files while the volume is mounted as has been suggested before. I can't really tell if that's the case. It seems to succeed eventually if retrying. For me that seldom requires more than three attempts.

I've tried running it in isolation quite a few times now with about the same result: it sometimes succeeds and sometimes fail. The success-error ratio seems to be much better though with failures happening less than half the time.

@lutzroeder
Copy link
Contributor

@chokladmal thank you for the additional info. There is another hdiutil related issue added in 22.10.3 which repros reliably and is different. See #5488.

develar pushed a commit that referenced this issue Jan 15, 2021
* fix(mac): Workaround for hdiutil randomly failing (#5431)

For unknown reasons hdiutil fails randomly when trying to create the dmg in
the tmp location. This workaround simply retries until it works or throws
the latest error if it fails ten times.

* fix(mac): Exporting and using retry from builder-util

Instead of having a similar implementation in createStageDmg as
the already existing "retry" function in builder-util it is now
exported from that package and used to handle the rerun-on-failure
in createStageDmg.

Co-authored-by: Eric Isoniemi <eric.isoniemi@kindredgroup.com>
@TongDaDa
Copy link

TongDaDa commented Feb 9, 2021

This may be a PROBLEM of BigSur system.

Adding the DEBUG_DMG=true env to the process could check out the ERROR.

In my case, the outputted ERROR was Operation not permitted when hdiutil create which is first step for creating dmg file.

SOLUTION: removing this line will always works well.

The -fs is one of HFS+, HFS+J (JHFS+), HFSX, JHFS+X, MS-DOS, or UDF. -fs causes a filesystem of the specified type to be written to the image. -fs can change the partition scheme and type appropriately. -fs will not make any size adjustments: if the image is the wrong size for the specified filesystem, create will fail. -fs is invalid and ignored when using -srcdevice.

@lutzroeder
Copy link
Contributor

See #5322. Root cause is often copying an .app that contains incorrectly signed files to the DMG file.

@EdmarPereira
Copy link
Author

Hey all,
yesterday I did some tests and running this command sudo mdutil -a -i off it works !!!

@rizwan92
Copy link

just kill terminal and start fresh one i am sure it will work

@mmaietta
Copy link
Collaborator

Nice finds @TongDaDa !

Curious, can you try commenting out just the args section ( "-fsargs", "-c c=64,a=16,e=16") and still force imageArgs.push("-fs", "HFS+")? I'm wondering if suppressing the journal is the culprit.

Suppressing the journal with -fs HFS+ and passing argu-
ments such as -c c=64,a=16,e=16 to -fsargs will min-
imize gaps at the front of the filesystem, allowing
resize to squeeze more space from the filesystem.
https://ss64.com/osx/hdiutil.html

Side note, do you know what filesystem type that hdiutil uses as its default on Big Sur?
I'm wondering when it'll be time to update the filesystem that the EB images are created with. APFS is backward compatible to 2016.

@Suhail
Copy link

Suhail commented Feb 23, 2021

sudo mdutil -a -i off

For those wondering what this does: https://ss64.com/osx/mdutil.html

I still encountered the error after running that.

@EdmarPereira
Copy link
Author

Tested with the latest version 22.10.5, and it works !!!
https://github.com/electron-userland/electron-builder/releases/tag/v22.10.5

@mmaietta
Copy link
Collaborator

mmaietta commented Mar 5, 2021

Closing per comment above 🙂

@mmaietta mmaietta closed this as completed Mar 5, 2021
facebook-github-bot pushed a commit to facebook/flipper that referenced this issue Mar 23, 2021
Summary:
allow-large-files
Bumps [app-builder-lib](https://github.com/electron-userland/electron-builder) from 22.9.1 to 22.10.5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/electron-userland/electron-builder/releases">app-builder-lib's releases</a>.</em></p>
<blockquote>
<h2>22.10.5</h2>
<p>We have a new maintainer — welcome Mike Maietta (<a href="https://github.com/mmaietta"><code>@​mmaietta</code></a>)!</p>
<p><strong>electron-updater</strong>  4.3.8 contains fix for <a href="https://github.com/electron-userland/electron-builder/issues/5595">#5595</a>. This version is a pre-release.</p>
<h3>Bug Fixes</h3>
<ul>
<li>Look for the Amazon cred header to remove auth header (<a href="https://github.com/electron-userland/electron-builder/issues/5594">#5594</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/46a8840bb4b3ed9b81ac65d3351debc4e34f30ce">46a8840</a>)</li>
<li><strong>mac:</strong> fix &quot;Contents/Info.plist&quot; don't have identical SHAs when creating a universal build (<a href="https://github.com/electron-userland/electron-builder/issues/5550">#5550</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/0ba839b72b6a13178ad5bc4b03a47f9aca980650">0ba839b</a>)</li>
<li>updating nsis script to properly identify arm64 vs x64 vs ia32 package files within universal installers. (<a href="https://github.com/electron-userland/electron-builder/issues/5558">#5558</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/60f7fe367c54f7c1274e2628534f43cb9a93fcf6">60f7fe3</a>)</li>
<li><strong>mac:</strong> Allow arm64 macs to update to x64 version if no arm64 version available (<a href="https://github.com/electron-userland/electron-builder/issues/5524">#5524</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/dc5c2f8e772da4a9e6f1cf9578c70f60ddc36b37">dc5c2f8</a>)</li>
<li><strong>mac:</strong> Pass platformName and options in doPack (<a href="https://github.com/electron-userland/electron-builder/issues/5511">#5511</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/f78e3f48d7cde71fd52fe1024c114bbe23f83562">f78e3f4</a>)</li>
<li><strong>mac:</strong> Workaround for hdiutil randomly failing (<a href="https://github.com/electron-userland/electron-builder/issues/5431">#5431</a>) (<a href="https://github.com/electron-userland/electron-builder/issues/5464">#5464</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/53270cfe4eb2de1ac55e4b281c2c53483d4d1f2e">53270cf</a>)</li>
<li>binary detection signing (<a href="https://github.com/electron-userland/electron-builder/issues/5493">#5493</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/a6e86b593048b4eb3047b7c3a54d02d0521b02d2">a6e86b5</a>), closes <a href="https://github.com/electron-userland/electron-builder/issues/5465">#5465</a></li>
<li>ci-tests (<a href="https://github.com/electron-userland/electron-builder/issues/5523">#5523</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/ced6e50b93c621de5de07838205d739010e2526b">ced6e50</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li><strong>electron-updater:</strong> follow <code>autoInstallOnAppQuit = false</code> on macOS (<a href="https://github.com/electron-userland/electron-builder/issues/5271">#5271</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/1643d569600a197858585e895e3176948d3eec85">1643d56</a>)</li>
<li>add support for executableName to non-Linux Platforms (<a href="https://github.com/electron-userland/electron-builder/issues/5409">#5409</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/106b68010f2daa0fb7d370c889b4a5494fa2887f">106b680</a>)</li>
<li>Custom electronDist callback (<a href="https://github.com/electron-userland/electron-builder/issues/5527">#5527</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/4f4e0187715a57a358ab8ccfefef3fd0f8186584">4f4e018</a>)</li>
<li>macOS default architecture (<a href="https://github.com/electron-userland/electron-builder/issues/5495">#5495</a>) (<a href="https://github.com/electron-userland/electron-builder/issues/5504">#5504</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/5203d7eb15726605e8987aeed7a5ccedc8152e04">5203d7e</a>)</li>
</ul>
<h2>22.10.4</h2>
<h3>Bug Fixes</h3>
<ul>
<li>CI unit tests (<a href="https://github.com/electron-userland/electron-builder/issues/5489">#5489</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/637334ddbadebf503a45f79adf0b481fcba98679">637334d</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li>Apple Silicon Universal Support (<a href="https://github.com/electron-userland/electron-builder/issues/5481">#5481</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/ca20151c3416324d2413f451dea0c9e3853bab79">ca20151</a>)</li>
<li><strong>mas:</strong> Apple Silicon support (<a href="https://github.com/electron-userland/electron-builder/issues/5484">#5484</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/6b7d30555d8f88a3a908a25adb3e8836ccdf5bc8">6b7d305</a>)</li>
</ul>
<h3>Reverts</h3>
<ul>
<li>Revert &quot;fix: codesign all binary-like files (<a href="https://github.com/electron-userland/electron-builder/issues/5322">#5322</a>)&quot; (<a href="https://github.com/electron-userland/electron-builder/issues/5488">#5488</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/026227888f8c537855abf6d6aa2141a692a6bc8e">0262278</a>), closes <a href="https://github.com/electron-userland/electron-builder/issues/5322">#5322</a> <a href="https://github.com/electron-userland/electron-builder/issues/5488">#5488</a></li>
</ul>
<h2>22.10.3</h2>
<h3>Bug Fixes</h3>
<ul>
<li>signing of playwright (<a href="https://github.com/electron-userland/electron-builder/issues/5451">#5451</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/50750683b11d5670a182bd72f7cab14023e2b030">5075068</a>)</li>
<li><strong>dmg:</strong> new version of mac_alias (<a href="https://github.com/electron-userland/electron-builder/issues/5460">#5460</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/a8acb583bc3c6fb1ff0dca2f07d1eefa26b1780a">a8acb58</a>)</li>
<li>compiler error and test updates (<a href="https://github.com/electron-userland/electron-builder/issues/5449">#5449</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/0dec1b8c198f1f9ca0124649883945ba561d11d3">0dec1b8</a>)</li>
<li><strong>AppImage:</strong> Add default argument --no-sandbox (<a href="https://github.com/electron-userland/electron-builder/issues/4496">#4496</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/ede6d50ddb6c23fe6bbb056bd80509c8f2ea0116">ede6d50</a>)</li>
<li><strong>linux:</strong> Linux icon is not set if path is not explicitly defined in config (<a href="https://github.com/electron-userland/electron-builder/issues/5385">#5385</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/9fd950bc046ca1748950f63894993947da8185c5">9fd950b</a>)</li>
<li><strong>nsis:</strong> cs locale typos in messages (<a href="https://github.com/electron-userland/electron-builder/issues/5358">#5358</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/0fb69b5d11e5c8aa707b7af709a0ab52f5019a9f">0fb69b5</a>)</li>
<li>codesign all binary-like files (<a href="https://github.com/electron-userland/electron-builder/issues/5322">#5322</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/27ea1b2b9ce47a234e82772e09adf0bc7931e0df">27ea1b2</a>)</li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/electron-userland/electron-builder/commit/79940292bdd1a5de45b33453be492ea67529434b"><code>7994029</code></a> Cannot read property 'log' of undefined (<a href="https://github.com/electron-userland/electron-builder/issues/5622">#5622</a>)</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/1643d569600a197858585e895e3176948d3eec85"><code>1643d56</code></a> feat(electron-updater): follow <code>autoInstallOnAppQuit = false</code> on macOS (<a href="https://github.com/electron-userland/electron-builder/issues/5271">#5271</a>)</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/0360cd1705c7deab2e07f2a9abf8cdb652f945ff"><code>0360cd1</code></a> chore(build-utils): remove unreachable useless statement in createMessage (<a href="https://github.com/electron-userland/electron-builder/issues/5">https://github.com/facebook/flipper/issues/5</a>...</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/c348e318ce6e9a1d67febe40003aeb6badedea8f"><code>c348e31</code></a> Add &quot;open&quot; guard for AsarUtil to fix concurrent builds (<a href="https://github.com/electron-userland/electron-builder/issues/5567">#5567</a>)</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/11aa06c701a2ff091139a8bf8277151f7172efbb"><code>11aa06c</code></a> Detect CI tag for Bitbucket pipelines</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/8decc1867428ef532e81466e239a8b3ad04e4d9c"><code>8decc18</code></a> (fix) master branch depCheck + tests (<a href="https://github.com/electron-userland/electron-builder/issues/5630">#5630</a>)</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/46a8840bb4b3ed9b81ac65d3351debc4e34f30ce"><code>46a8840</code></a> fix: Look for the Amazon cred header to remove auth header (<a href="https://github.com/electron-userland/electron-builder/issues/5594">#5594</a>)</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/0ba839b72b6a13178ad5bc4b03a47f9aca980650"><code>0ba839b</code></a> fix(mac): fix &quot;Contents/Info.plist&quot; don't have identical SHAs when creating a...</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/60f7fe367c54f7c1274e2628534f43cb9a93fcf6"><code>60f7fe3</code></a> fix: updating nsis script to properly identify arm64 vs x64 vs ia32 package f...</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/5de0db981d069584933e88781a41a411e87ff1cd"><code>5de0db9</code></a> chore: lint</li>
<li>Additional commits viewable in <a href="https://github.com/electron-userland/electron-builder/compare/v22.9.1...v22.10.5">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=app-builder-lib&package-manager=npm_and_yarn&previous-version=22.9.1&new-version=22.10.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

Pull Request resolved: #2072

Reviewed By: passy

Differential Revision: D27230105

Pulled By: priteshrnandgaonkar

fbshipit-source-id: e53e942319a15d982797f7ce3af128a8b25b357f
facebook-github-bot pushed a commit to facebook/flipper that referenced this issue Mar 23, 2021
Summary:
Bumps [electron-builder](https://github.com/electron-userland/electron-builder) from 22.9.1 to 22.10.5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/electron-userland/electron-builder/releases">electron-builder's releases</a>.</em></p>
<blockquote>
<h2>22.10.5</h2>
<p>We have a new maintainer — welcome Mike Maietta (<a href="https://github.com/mmaietta"><code>@​mmaietta</code></a>)!</p>
<p><strong>electron-updater</strong>  4.3.8 contains fix for <a href="https://github.com/electron-userland/electron-builder/issues/5595">#5595</a>. This version is a pre-release.</p>
<h3>Bug Fixes</h3>
<ul>
<li>Look for the Amazon cred header to remove auth header (<a href="https://github.com/electron-userland/electron-builder/issues/5594">#5594</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/46a8840bb4b3ed9b81ac65d3351debc4e34f30ce">46a8840</a>)</li>
<li><strong>mac:</strong> fix &quot;Contents/Info.plist&quot; don't have identical SHAs when creating a universal build (<a href="https://github.com/electron-userland/electron-builder/issues/5550">#5550</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/0ba839b72b6a13178ad5bc4b03a47f9aca980650">0ba839b</a>)</li>
<li>updating nsis script to properly identify arm64 vs x64 vs ia32 package files within universal installers. (<a href="https://github.com/electron-userland/electron-builder/issues/5558">#5558</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/60f7fe367c54f7c1274e2628534f43cb9a93fcf6">60f7fe3</a>)</li>
<li><strong>mac:</strong> Allow arm64 macs to update to x64 version if no arm64 version available (<a href="https://github.com/electron-userland/electron-builder/issues/5524">#5524</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/dc5c2f8e772da4a9e6f1cf9578c70f60ddc36b37">dc5c2f8</a>)</li>
<li><strong>mac:</strong> Pass platformName and options in doPack (<a href="https://github.com/electron-userland/electron-builder/issues/5511">#5511</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/f78e3f48d7cde71fd52fe1024c114bbe23f83562">f78e3f4</a>)</li>
<li><strong>mac:</strong> Workaround for hdiutil randomly failing (<a href="https://github.com/electron-userland/electron-builder/issues/5431">#5431</a>) (<a href="https://github.com/electron-userland/electron-builder/issues/5464">#5464</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/53270cfe4eb2de1ac55e4b281c2c53483d4d1f2e">53270cf</a>)</li>
<li>binary detection signing (<a href="https://github.com/electron-userland/electron-builder/issues/5493">#5493</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/a6e86b593048b4eb3047b7c3a54d02d0521b02d2">a6e86b5</a>), closes <a href="https://github.com/electron-userland/electron-builder/issues/5465">#5465</a></li>
<li>ci-tests (<a href="https://github.com/electron-userland/electron-builder/issues/5523">#5523</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/ced6e50b93c621de5de07838205d739010e2526b">ced6e50</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li><strong>electron-updater:</strong> follow <code>autoInstallOnAppQuit = false</code> on macOS (<a href="https://github.com/electron-userland/electron-builder/issues/5271">#5271</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/1643d569600a197858585e895e3176948d3eec85">1643d56</a>)</li>
<li>add support for executableName to non-Linux Platforms (<a href="https://github.com/electron-userland/electron-builder/issues/5409">#5409</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/106b68010f2daa0fb7d370c889b4a5494fa2887f">106b680</a>)</li>
<li>Custom electronDist callback (<a href="https://github.com/electron-userland/electron-builder/issues/5527">#5527</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/4f4e0187715a57a358ab8ccfefef3fd0f8186584">4f4e018</a>)</li>
<li>macOS default architecture (<a href="https://github.com/electron-userland/electron-builder/issues/5495">#5495</a>) (<a href="https://github.com/electron-userland/electron-builder/issues/5504">#5504</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/5203d7eb15726605e8987aeed7a5ccedc8152e04">5203d7e</a>)</li>
</ul>
<h2>22.10.4</h2>
<h3>Bug Fixes</h3>
<ul>
<li>CI unit tests (<a href="https://github.com/electron-userland/electron-builder/issues/5489">#5489</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/637334ddbadebf503a45f79adf0b481fcba98679">637334d</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li>Apple Silicon Universal Support (<a href="https://github.com/electron-userland/electron-builder/issues/5481">#5481</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/ca20151c3416324d2413f451dea0c9e3853bab79">ca20151</a>)</li>
<li><strong>mas:</strong> Apple Silicon support (<a href="https://github.com/electron-userland/electron-builder/issues/5484">#5484</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/6b7d30555d8f88a3a908a25adb3e8836ccdf5bc8">6b7d305</a>)</li>
</ul>
<h3>Reverts</h3>
<ul>
<li>Revert &quot;fix: codesign all binary-like files (<a href="https://github.com/electron-userland/electron-builder/issues/5322">#5322</a>)&quot; (<a href="https://github.com/electron-userland/electron-builder/issues/5488">#5488</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/026227888f8c537855abf6d6aa2141a692a6bc8e">0262278</a>), closes <a href="https://github.com/electron-userland/electron-builder/issues/5322">#5322</a> <a href="https://github.com/electron-userland/electron-builder/issues/5488">#5488</a></li>
</ul>
<h2>22.10.3</h2>
<h3>Bug Fixes</h3>
<ul>
<li>signing of playwright (<a href="https://github.com/electron-userland/electron-builder/issues/5451">#5451</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/50750683b11d5670a182bd72f7cab14023e2b030">5075068</a>)</li>
<li><strong>dmg:</strong> new version of mac_alias (<a href="https://github.com/electron-userland/electron-builder/issues/5460">#5460</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/a8acb583bc3c6fb1ff0dca2f07d1eefa26b1780a">a8acb58</a>)</li>
<li>compiler error and test updates (<a href="https://github.com/electron-userland/electron-builder/issues/5449">#5449</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/0dec1b8c198f1f9ca0124649883945ba561d11d3">0dec1b8</a>)</li>
<li><strong>AppImage:</strong> Add default argument --no-sandbox (<a href="https://github.com/electron-userland/electron-builder/issues/4496">#4496</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/ede6d50ddb6c23fe6bbb056bd80509c8f2ea0116">ede6d50</a>)</li>
<li><strong>linux:</strong> Linux icon is not set if path is not explicitly defined in config (<a href="https://github.com/electron-userland/electron-builder/issues/5385">#5385</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/9fd950bc046ca1748950f63894993947da8185c5">9fd950b</a>)</li>
<li><strong>nsis:</strong> cs locale typos in messages (<a href="https://github.com/electron-userland/electron-builder/issues/5358">#5358</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/0fb69b5d11e5c8aa707b7af709a0ab52f5019a9f">0fb69b5</a>)</li>
<li>codesign all binary-like files (<a href="https://github.com/electron-userland/electron-builder/issues/5322">#5322</a>) (<a href="https://github.com/electron-userland/electron-builder/commit/27ea1b2b9ce47a234e82772e09adf0bc7931e0df">27ea1b2</a>)</li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/electron-userland/electron-builder/commit/79940292bdd1a5de45b33453be492ea67529434b"><code>7994029</code></a> Cannot read property 'log' of undefined (<a href="https://github.com/electron-userland/electron-builder/issues/5622">#5622</a>)</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/1643d569600a197858585e895e3176948d3eec85"><code>1643d56</code></a> feat(electron-updater): follow <code>autoInstallOnAppQuit = false</code> on macOS (<a href="https://github.com/electron-userland/electron-builder/issues/5271">#5271</a>)</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/0360cd1705c7deab2e07f2a9abf8cdb652f945ff"><code>0360cd1</code></a> chore(build-utils): remove unreachable useless statement in createMessage (<a href="https://github.com/electron-userland/electron-builder/issues/5">https://github.com/facebook/flipper/issues/5</a>...</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/c348e318ce6e9a1d67febe40003aeb6badedea8f"><code>c348e31</code></a> Add &quot;open&quot; guard for AsarUtil to fix concurrent builds (<a href="https://github.com/electron-userland/electron-builder/issues/5567">#5567</a>)</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/11aa06c701a2ff091139a8bf8277151f7172efbb"><code>11aa06c</code></a> Detect CI tag for Bitbucket pipelines</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/8decc1867428ef532e81466e239a8b3ad04e4d9c"><code>8decc18</code></a> (fix) master branch depCheck + tests (<a href="https://github.com/electron-userland/electron-builder/issues/5630">#5630</a>)</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/46a8840bb4b3ed9b81ac65d3351debc4e34f30ce"><code>46a8840</code></a> fix: Look for the Amazon cred header to remove auth header (<a href="https://github.com/electron-userland/electron-builder/issues/5594">#5594</a>)</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/0ba839b72b6a13178ad5bc4b03a47f9aca980650"><code>0ba839b</code></a> fix(mac): fix &quot;Contents/Info.plist&quot; don't have identical SHAs when creating a...</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/60f7fe367c54f7c1274e2628534f43cb9a93fcf6"><code>60f7fe3</code></a> fix: updating nsis script to properly identify arm64 vs x64 vs ia32 package f...</li>
<li><a href="https://github.com/electron-userland/electron-builder/commit/5de0db981d069584933e88781a41a411e87ff1cd"><code>5de0db9</code></a> chore: lint</li>
<li>Additional commits viewable in <a href="https://github.com/electron-userland/electron-builder/compare/v22.9.1...v22.10.5">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=electron-builder&package-manager=npm_and_yarn&previous-version=22.9.1&new-version=22.10.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

Pull Request resolved: #2068

Reviewed By: passy

Differential Revision: D27230125

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 775e8d532b0516bf485b95e7057544d1d5a91e59
@zander-indo-bose
Copy link

Since updating to Big Sur 11.3.1 I am receiving this same error message and I am unable to build a dmg file.

Xcode: Version 12.5 (12E262)
Python: 2.7.16
electron: "~11.4.5"
electron-builder: "^22.11.1"

@StupidRepo
Copy link

StupidRepo commented May 18, 2021

Since updating to Big Sur 11.3.1 I am receiving this same error message and I am unable to build a dmg file.

Xcode: Version 12.5 (12E262)
Python: 2.7.16
electron: "~11.4.5"
electron-builder: "^22.11.1"

Try sudo rm -rf /Library/Developer/CommandLineTools && xcode-select --install, worked for me... or not. Hmm, I seems I am having this issue too.

@StupidRepo
Copy link

StupidRepo commented May 18, 2021

Solution (I guess): Don't package as DMG, just use the .app file itself and get a separate app for dmg building.

@nazamov
Copy link

nazamov commented Mar 9, 2022

I had same problem. Give all permissions to terminal and IDE in mac settings.
Screenshot 2022-03-09 at 19 44 32

@waabid
Copy link

waabid commented Apr 6, 2022

Unfortunately, I'm still seeing this issue. I've tried disabling spotlight and giving terminal permissions possible.

MacOS: 12.3/12.3.1
electron-builder: 22.14.13
Intel Mac

@louismorgner
Copy link

Also getting this error. Perhaps interesting: the build works without any problems if no signing certificates are added to the keychain. Once I add them, this issues appears. Maybe helps someone debugging. Any hints?

@yaddran
Copy link

yaddran commented Nov 11, 2022

On Ventura 13.0.1 managed to solve it by allowing application (in my case the terminal I was using to run the build) to update or delete other applications. It is in Privacy & Security -> App Management.
Screenshot 2022-11-11 at 21 49 08

I would suggest the Full Disc Access, as well, for Terminal.

@michaelwbarry
Copy link
Contributor

On Ventura 13.0.1 managed to solve it by allowing application (in my case the terminal I was using to run the build) to update or delete other applications. It is in Privacy & Security -> App Management. Screenshot 2022-11-11 at 21 49 08

This worked for me, thanks.

@ahmadsdn
Copy link

ahmadsdn commented Mar 6, 2023

I'm having this issue too, tried all suggestions mentioned above but none helped.
The first time I tried building, everything went smoothly and I got all the output formats.
Strange that it worked the first time but not anymore. I also tried wiping the node_modules and dist folders but no luck.

@SpektacleFR
Copy link

On Ventura 13.0.1 managed to solve it by allowing application (in my case the terminal I was using to run the build) to update or delete other applications. It is in Privacy & Security -> App Management. Screenshot 2022-11-11 at 21 49 08

I would suggest the Full Disc Access, as well, for Terminal.

Worked for me on ver. 23.6.0

Thanks for this.

@direvus
Copy link

direvus commented Sep 11, 2023

I'm getting this. MacOS 13.5.2, electron-react-boilerplate with electron-builder ^24.2.1.

[UPDATE] Upgraded to electron-builder 24.6.4 and the problem went away after a full removal of node_modules and fresh npm install

npm run package shows the error in the title of this issue. Digging deeper with export DEBUG_DMG=true, I see:

                                                                                         detachTempimageFile: synchronous unmount /dev/disk3 returned 49168
retrying unmount (#1)...
detachTempImageFile: synchronous retry (#1) unmount /Volumes/ElectronReact 4.6.0 (/dev/disk3) returned 49168
retrying unmount (#2)...
detachTempImageFile: synchronous retry (#1) unmount /Volumes/ElectronReact 4.6.0 (/dev/disk3) returned 49168
retrying unmount (#3)...
detachTempImageFile: synchronous retry (#1) unmount /Volumes/ElectronReact 4.6.0 (/dev/disk3) returned 49168
2023-09-11 10:24:08.334 diskimages-helper[10884:99392] -processKernelRequest: flush received
2023-09-11 10:24:08.365 diskimages-helper[10884:99288] *useEffectiveIDs**** euid/egid changed to 501,20 (uid/gid is 501,20)
DIHLDiskImageCreate() returned 49168
hdiutil: create: returning 49168
hdiutil: create failed - Resource busy

Things I've tried:

  • shutting down my dev instance of the app
  • disabling real-time protection in Microsoft Defender
  • adding an exclusion for my repo directory in Microsoft Defender
  • granting Full Disk Access and App Management privileges to my terminal app (iTerm 2)
  • restarting my terminal app
  • disabling disk indexing with sudo mdutil -a -i off
  • [edit] and preventing code signing with export CSC_IDENTITY_AUTO_DISCOVERY=false

Unlike some others in the thread, it doesn't seem to randomly work some of the time. So far all attempts have failed. I've never had a successful build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests