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.

Operation not permitted during dmg building on macOS 11 Big Sur

See original GitHub issue
  • Version: electron-builder@22.9.1
  • Electron Version:electron@11.0.4
  • Electron Type (current, beta, nightly):current
  • Electron updater: electron-updater@4.3.1
  • Target: dmg for macOS

After setting DEBUG=electron-builder DEBUG_DMG=true, the console logs error during copy:

2020-12-10 11:45:43.585 copy-helper[54295:350710] About to copy "/path/app.app".
2020-12-10 11:45:44.255 copy-helper[54295:350710] copy error (canceling): /Volumes/img/app.app/Contents/Resources/app.asar.unpacked/node_modules/npm/node_modules/libnpmorg/.BC.T_K9LSTf: Operation not permitted
2020-12-10 11:45:44.255 copy-helper[54295:350710] Copy finished with error 1 (Operation not permitted).
................................Error 1 (Operation not permitted).
could not access /Volumes/img/app.app/Contents/Resources/app.asar.unpacked/node_modules/npm/node_modules/libnpmorg/.BC.T_K9LSTf - Operation not permitted

Then building ultimately failed with:

2020-12-10 11:45:45.386 diskimages-helper[54280:350655] *useEffectiveIDs**** euid/egid changed to 501,20 (uid/gid is 501,20)
DIHLDiskImageCreate() returned 1
hdiutil: create: returning 1
hdiutil: create failed - Operation not permitted

...

 ⨯ hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE  stackTrace=
                                                                    Error: hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
                                                                        at ChildProcess.<anonymous> (/Users/gnattu/src/poi/node_modules/builder-util/src/util.ts:243:14)
                                                                        at Object.onceWrapper (node:events:483:26)
                                                                        at ChildProcess.emit (node:events:376:20)
                                                                        at maybeClose (node:internal/child_process:1063:16)
                                                                        at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5)

I can create an image with appdmg for the same app.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:25 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
gnattucommented, Dec 11, 2020

By removing “-fs”, “HFS+”, “-fsargs”, “-c c=64,a=16,e=16”, dmg creation does work on Big Sur. Looks like HFS+ image creation is broken.

1reaction
gnattucommented, Dec 17, 2020

@lutzroeder Yes, I can confirm that some files are incorrectly signed:

xattr PULL_REQUEST_TEMPLATE 
com.apple.cs.CodeDirectory
com.apple.cs.CodeEntitlements
com.apple.cs.CodeRequirements
com.apple.cs.CodeRequirements-1
com.apple.cs.CodeSignature

The file is just a text file indicating a PR template, but it is detected as a binary and got signed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Operation not permitted during dmg… | Apple Developer Forums
By removing "-fs", "HFS+", "-fsargs", "-c c=64,a=16,e=16", dmg creation does work on Big Sur. Looks like HFS+ image creation is broken.
Read more >
operation not permitted Mac Terminal - iBoysoft Data Recovery
Unable to run command in Mac Terminal with the Operation not permitted error message? Here, we will explain why and provides solutions to...
Read more >
Seeing Error "Operation Not Permitted" in macOS Catalina or ...
Steps to fix “operation not permitted” by giving full disk access · Close the app you need to grant full disk access to...
Read more >
Can't run app because of permission in macOS v11 (Big Sur)
I had this problem with the error "Termination Reason: Namespace CODESIGNING, Code 0x1" and I managed to open the application after I signed ......
Read more >
Fix Terminal “Operation not permitted” Error in macOS ...
The “Operation not permitted” error in the Terminal can be seen after issuing even simple commands like using 'ls' 'mv' and 'cp' within...
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