grahampugh / jamf-upload

Scripts for uploading packages to Jamf Cloud
Apache License 2.0
150 stars 39 forks source link

Package upload stuck on Availability Pending #20

Closed lighterless closed 3 years ago

lighterless commented 3 years ago

I am having issues uploading a package using the JamfPackageUploader processor. It looks like everything uploads correctly but then the package stays in the Pending state on JamfCloud and if I look in Jamf Admin, it says the package is missing.

image

I have tried with several different packages, different recipes. Always the same issue. If I upload the file manually, it works. I'm happy to provide whatever logs you need.

grahampugh commented 3 years ago

Hi Ben, I've read in Macadmins Slack that many people are having problems uploading packages to Jamf Cloud at the moment (not a thing specific to this processor).

As an experiment, you can try uploading via Jamf Admin. Are your uploads always successful?

If yes, you can also experiment using my standalone jamf-pkg-upload.py script. This is a bit more involved, but you would need to clone the following repository: https://github.com/grahampugh/jamf-upload

git clone https://github.com/grahampugh/jamf-upload

Then, run the script as follows:

/usr/local/autopkg/python ./jamf-pkg-upload.py --prefs /Users/YOURUSERNAME/Library/Preferences/com.github.autopkg.plist --pkg /path/to/Google_Drive_intel.pkg --replace_pkg

This uses the same upload method as the JamfPackageUploader processor (it uses curl). But, with this standalone you can try four different methods; nscurl, requests and "direct" (web-emulation):

/usr/local/autopkg/python ./jamf-pkg-upload.py --prefs /Users/YOURUSERNAME/Library/Preferences/com.github.autopkg.plist --pkg /path/to/Google_Drive_intel.pkg --replace_pkg --nscurl

/usr/local/autopkg/python ./jamf-pkg-upload.py --prefs /Users/YOURUSERNAME/Library/Preferences/com.github.autopkg.plist --pkg /path/to/Google_Drive_intel.pkg --replace_pkg --requests

/usr/local/autopkg/python ./jamf-pkg-upload.py --prefs /Users/YOURUSERNAME/Library/Preferences/com.github.autopkg.plist --pkg /path/to/Google_Drive_intel.pkg --replace_pkg --direct

Note that for the last two options, the python requests module has to be installed, so if you don't already have JSSImporter installed, you'll have to install it using pip (or pip3 most likely). This command would install it in your AutoPkg environment, but if you're testing this on another machine you might be using a different python. Adjust accordingly:

/Library/AutoPkg/Python3/Python.framework/Versions/3.7/bin/pip3 install requests --user
lighterless commented 3 years ago

Thanks for the quick reply @grahampugh. I think I found the issue. As it turns out, the pkg_name parameter is actually looking for the value of pkg_path and here I thought it was just a string for the package name on Jamf. Appending .pkg to the end of the pkg_name results in a successful upload using autopkg. Thanks!