Skip to content

[BUG] Corrupted uploads #296

@magnusviri

Description

@magnusviri

Describe the bug

Randomly some uploaded packages are corrupted. Here's an example:

Version on autopkg server:

> sha1sum /Users/autopkg/Library/autopkg/Cache/local.pkg.R-arm64/downloads/R_arm64-4.5.1.pkg 
0db802faf0e544168794a6d648c73a48c2b51a5d  /Users/autopkg/Library/autopkg/Cache/local.pkg.R-arm64/downloads/R_arm64-4.5.1.pkg

Version on Jamf DP:

> sha1sum /Volumes/jamf/Packages/R_arm64-4.5.1.pkg 
3d8dbf072f3fbb23d57dda52633466f3714f7546  /Volumes/jamf/Packages/R_arm64-4.5.1.pkg

In this case, /Volumes/jamf/Packages/R_arm64-4.5.1.pkg is nothing but null chars.

> hexdump -C /Volumes/jamf/Packages/R_arm64-4.5.1.pkg 
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
060c6d90  00 00 00 00                                       |....|
060c6d94

In the case of iMovie, a different corrupted upload, the first 3GB is correct, but then it just corrupts.

Heres' the good iMovie (from where the differences start).

> hexdump -C good/iMovie-10.4.3.pkg | grep -A 100 "h....bdI....>"

b637fff0  68 a8 cc ce fa 62 64 49  e7 7f bb e9 3e 9d d3 11  |h....bdI....>...|
b6380000  c2 de b8 ba 3f e2 ab ea  d5 d9 18 4a eb 9a 47 41  |....?......J..GA|
b6380010  47 53 4d 1b 2b e7 c5 c4  c2 9f 0f ef f3 6b 5a 1f  |GSM.+........kZ.|
b6380020  5b 9a 2c 95 eb 47 18 5d  ac 52 9d eb d4 55 15 20  |[.,..G.].R...U. |
b6380030  bc 0a cd 1f e4 f2 bc 53  0a de 5b eb 05 6a f9 24  |.......S..[..j.$|
b6380040  4d 2d 5a c5 33 cb 55 44  1d e5 66 5c e1 95 20 ac  |M-Z.3.UD..f\.. .|
b6380050  7d e2 68 e1 d5 de 24 b2  d4 ab 3f a8 c8 b1 b2 77  |}.h...$...?....w|
b6380060  88 0d 3f e8 a4 36 f5 69  89 18 80 7b 81 5d ba 1f  |..?..6.i...{.]..|
b6380070  5a b0 0e 4b f4 68 1a af  bf f2 8b 75 65 b4 fb 3b  |Z..K.h.....ue..;|
b6380080  af 2b d3 85 21 3f 2e 26  b7 35 93 20 9f 57 06 65  |.+..!?.&.5. .W.e|
b6380090  05 a9 c3 e9 9c 8e 00 e6  45 7d b2 a8 67 3b d3 f4  |........E}..g;..|
b63800a0  48 76 4e 43 f2 04 b6 c4  9d ad ad e0 2b 83 07 3d  |HvNC........+..=|

Here's the bad iMovie (from where the differences start). You can see there's a lot of null chars.

> hexdump -C bad/iMovie-10.4.3.pkg | grep -A 100 "h....bdI....>"

b637fff0  68 a8 cc ce fa 62 64 49  e7 7f bb e9 3e 9d d3 11  |h....bdI....>...|
b6380000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
b6400000  47 eb 09 fb 49 9a b8 18  a0 33 dc d0 45 fe 51 e8  |G...I....3..E.Q.|
b6400010  97 43 fd 38 db a1 b8 77  f7 3a d3 5b 77 f6 2f 35  |.C.8...w.:.[w./5|
b6400020  59 e4 c2 b3 aa 30 4a bf  12 e5 ea 80 25 f6 df 2b  |Y....0J.....%..+|

To Reproduce

Not sure why it's happening. Some uploads are ok, some aren't. Deleting the file on the Jamf server and then re-running autopkg sometimes works, sometimes not. Here's my recipe override.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Identifier</key>
	<string>local.pkg.R-arm64</string>
	<key>Input</key>
	<dict>
		<key>ARCH</key>
		<string>arm64</string>
		<key>NAME</key>
		<string>R</string>
	</dict>
	<key>ParentRecipe</key>
	<string>com.github.homebysix.pkg.R</string>
	<key>ParentRecipeTrustInfo</key>
	<dict>
		<key>non_core_processors</key>
		<dict>
			<key>RProjectURLProvider</key>
			<dict>
				<key>path</key>
				<string>~/Library/AutoPkg/RecipeRepos/com.github.autopkg.homebysix-recipes/R/RProjectURLProvider.py</string>
				<key>sha256_hash</key>
				<string>4e8ae3fa3cf58d6b7ed47a897fde402dbcf1fdf39937bfd53fe71ca529a8453e</string>
			</dict>
		</dict>
		<key>parent_recipes</key>
		<dict>
			<key>com.github.homebysix.download.R</key>
			<dict>
				<key>path</key>
				<string>~/Library/AutoPkg/RecipeRepos/com.github.autopkg.homebysix-recipes/R/R.download.recipe</string>
				<key>sha256_hash</key>
				<string>2555cce1ed912c339cdf3e27804fec3cd99b118553958ff09928c89cec47f4b9</string>
			</dict>
			<key>com.github.homebysix.pkg.R</key>
			<dict>
				<key>path</key>
				<string>~/Library/AutoPkg/RecipeRepos/com.github.autopkg.homebysix-recipes/R/R.pkg.recipe</string>
				<key>sha256_hash</key>
				<string>fd0ebe7a9d727791e3da3e30663aa674c19c71ee5653002e984a4edc2eeeb587</string>
			</dict>
		</dict>
	</dict>
	<key>Process</key>
	<array>
		<dict>
			<key>Arguments</key>
			<dict>
				<key>pkg_category</key>
				<string>Packages - AutoPkg Upload</string>
			</dict>
			<key>Processor</key>
			<string>com.github.grahampugh.jamf-upload.processors/JamfPackageUploader</string>
		</dict>
	</array>
</dict>
</plist>

Log output

See attached.

output.txt
autopkg_results.plist.txt

Environment (please complete the following information):

  • OS: macOS 15.6, running in a VM using tart (with bridge networking and a mounted volume from the host to the client).
    • /Applications/tart.app/Contents/MacOS/tart run --net-bridged="en0" --dir=autopkg:~/autopkg autopkg15 &
    • I thought maybe the mounted directory was the problem so I tried it without the mount and it still randomly corrupts.
  • AutoPkg 2.7.6
% git remote show origin
* remote origin
  Fetch URL: https://github.com/autopkg/grahampugh-recipes
  Push  URL: https://github.com/autopkg/grahampugh-recipes
  HEAD branch: main
  Remote branches:
    legacy-ea                     tracked
    main                          tracked
    refs/remotes/origin/jcds_mode stale (use 'git remote prune' to remove)
  Local branch configured for 'git pull':
    main merges with remote main
  Local ref configured for 'git push':
    main pushes to main (up to date)
% git branch
* main
% git log
commit 73d5ed5465ef7d1e0abd0e1e72772830e9175b9d (HEAD -> main, origin/main, origin/HEAD)
Merge: 9abb6d6 63609f5
Author: Graham Pugh <[email protected]>
Date:   Tue Aug 12 14:20:18 2025 +0200

    Merge pull request #172 from nlopezUA/main
    
    Cisco renamed the .pkg the choices.xml option around 5.1

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions