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

Error incorrect when "Ignore ownership on this volume" set on an APFS Volume #917

Open
jazzace opened this issue Nov 22, 2023 · 0 comments

Comments

@jazzace
Copy link
Member

jazzace commented Nov 22, 2023

Describe the problem
In autopkgserver/packager.py, the code documents that if you are using an external volume for the Cache, the "Ignore ownership on this volume" option must be off to create a package. On a volume formatted as HFS+, the code correctly traps for this condition and provides a specific error message. On an APFS volume, it does not correctly detect when "Ignore ownership on this volume" has been turned on and instead provides an error message that points the user in the wrong direction for the source of the problem. This specifically affects recipes that use the PkgCreator or AppPkgCreator processors.

Relevant Preferences contents
CACHE_DIR set to an external volume formatted as APFS.

AutoPkg output
End of verbose run of ClipGrabMac.pkg (jazzace-recipes) quoted in examples below, using AppPkgCreator and AutoPkg 3.0RC2.

With "Ignore ownership on this volume" selected on Volume AutoPkgLibrary (APFS format), Cache built from scratch:

[...]
AppPkgCreator
{'Input': {}}
AppPkgCreator: Mounted disk image /Users/tech/Downloads/ClipGrab-3.9.7-cpython-1010.dmg
AppPkgCreator: Using path '/private/tmp/dmg.Qb6tTL/ClipGrab.app' matched from globbed '/private/tmp/dmg.Qb6tTL/*.app'.
AppPkgCreator: Version: 3.9.7
AppPkgCreator: BundleID: de.clipgrab.ClipGrab
AppPkgCreator: Copied /private/tmp/dmg.Qb6tTL/ClipGrab.app to /Volumes/AutoPkgLibrary/Cache/com.github.jazzace.pkg.ClipGrabMac/payload/Applications/ClipGrab.app
AppPkgCreator: Connecting
AppPkgCreator: Sending packaging request
AppPkgCreator: Disconnecting
AppPkgCreator: Failed to close socket: [Errno 9] Bad file descriptor
/Volumes/AutoPkgLibrary/Cache/com.github.jazzace.pkg.ClipGrabMac/payload isn't owned by 601
Failed.
Receipt written to /Volumes/AutoPkgLibrary/Cache/com.github.jazzace.pkg.ClipGrabMac/receipts/ClipGrabMac-receipt-20231122-094406.plist

The following recipes failed:
    ClipGrabMac.pkg
        Error in com.github.jazzace.pkg.ClipGrabMac: Processor: AppPkgCreator: Error: /Volumes/AutoPkgLibrary/Cache/com.github.jazzace.pkg.ClipGrabMac/payload isn't owned by 601

Nothing downloaded, packaged or imported.

With "Ignore ownership on this volume" selected on Volume HD2272 (HFS+ Journaled format), Cache built from scratch:

AppPkgCreator
{'Input': {}}
AppPkgCreator: Mounted disk image /Users/tech/Downloads/ClipGrab-3.9.7-cpython-1010.dmg
AppPkgCreator: Using path '/private/tmp/dmg.m32F1n/ClipGrab.app' matched from globbed '/private/tmp/dmg.m32F1n/*.app'.
AppPkgCreator: Version: 3.9.7
AppPkgCreator: BundleID: de.clipgrab.ClipGrab
AppPkgCreator: Copied /private/tmp/dmg.m32F1n/ClipGrab.app to /Volumes/HD2272/Cache/com.github.jazzace.pkg.ClipGrabMac/payload/Applications/ClipGrab.app
AppPkgCreator: Connecting
AppPkgCreator: Sending packaging request
AppPkgCreator: Disconnecting
AppPkgCreator: Failed to close socket: [Errno 9] Bad file descriptor
'Ignore ownerships' is set on the disk where pkgroot '/Volumes/HD2272/Cache/com.github.jazzace.pkg.ClipGrabMac/payload' was set, and packaging cannot continue. Ownerships must be enabled on the volume where a package is to be built.
Failed.
Receipt written to /Volumes/HD2272/Cache/com.github.jazzace.pkg.ClipGrabMac/receipts/ClipGrabMac-receipt-20231122-095345.plist

The following recipes failed:
    ClipGrabMac.pkg
        Error in com.github.jazzace.pkg.ClipGrabMac: Processor: AppPkgCreator: Error: 'Ignore ownerships' is set on the disk where pkgroot '/Volumes/HD2272/Cache/com.github.jazzace.pkg.ClipGrabMac/payload' was set, and packaging cannot continue. Ownerships must be enabled on the volume where a package is to be built.

Nothing downloaded, packaged or imported.

Expected behaviour
Behaviour exhibited by HFS+ Journaled volume should also apply to APFS external volume.

Additional Note
The (correct) error message uses the word "Ownerships" twice when "Ownership" (no trailing "s") is the correct term. The code comments also have this semantic error. If this Issue is fixed, this wording should be cleaned up at the same time.

Version (please complete the following information):

  • OS version: tested on 12.7.1, 14.1.1
  • AutoPkg Version: tested on 3.0RC2 but believe to be an issue on 2.7.2
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

1 participant