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.

JamfPolicyUploader processor failing with errors when updating policies

See original GitHub issue

I’m seeing a problem with the JamfPolicyUploader processor when running various policies which use it. An example is posted below:

JamfPolicyUploader: No value supplied for icon, setting default value of: 
JamfPolicyUploader: No value supplied for replace_icon, setting default value of: False
JamfPolicyUploader: File found at: /Users/ec2-user/Library/AutoPkg/RecipeRepos/com.github.rtrouton.autopkg_recipes/Jamf_Upload/PolicyTemplate-autoupdate.xml
JamfPolicyUploader: ("Replacing any instances of 'POLICY_NAME' with", "'Auto Update CiscoUmbrella'")
JamfPolicyUploader: ("Replacing any instances of 'POLICY_CATEGORY' with", "'Apps-AutoUpdate'")
JamfPolicyUploader: ("Replacing any instances of 'POLICY_TRIGGER' with", "'autoupdate-CiscoUmbrella'")
JamfPolicyUploader: ("Replacing any instances of 'pkg_name' with", "'Cisco_Umbrella_3.0.9.pkg'")
JamfPolicyUploader: Policy data:
JamfPolicyUploader: <?xml version="1.0" encoding="UTF-8"?>
<policy>
   <general>
      <name>Auto Update CiscoUmbrella</name>
      <enabled>true</enabled>
      <frequency>Ongoing</frequency>
      <category>
         <name>Apps-AutoUpdate</name>
      </category>
      <trigger_other>autoupdate-CiscoUmbrella</trigger_other>
   </general>
   <scope>
      <all_computers>true</all_computers>
   </scope>
   <package_configuration>
      <packages>
         <size>1</size>
         <package>
            <name>Cisco_Umbrella_3.0.9.pkg</name>
            <action>Install</action>
         </package>
      </packages>
   </package_configuration>
   <scripts>
      <size>0</size>
   </scripts>
   <maintenance>
      <recon>true</recon>
   </maintenance>
</policy>
JamfPolicyUploader: Checking for existing 'Auto Update CiscoUmbrella' on https://jamf.pro.server.here
JamfPolicyUploader: Checking for existing authentication token
JamfPolicyUploader: Checking https://jamf.pro.server.here against https://jamf.pro.server.here
JamfPolicyUploader: URL for token matches current request
JamfPolicyUploader: Existing token is valid
JamfPolicyUploader: No existing cookie found - starting new session
JamfPolicyUploader: curl command: /usr/bin/curl --silent --show-error -D /tmp/jamf_upload/curl_headers_from_jamf_upload.txt --output /tmp/jamf_upload/curl_output_from_jamf_upload.txt https://jamf.pro.server.here/api/v1/jamf-pro-version --request GET --header authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdXRoZW50aWNhdGVkLWFwcCI6IkdFTkVSSUMiLCJhdXRoZW50aWNhdGlvbi10eXBlIjoiSlNTIiwiZ3JvdXBzIjpbXSwic3ViamVjdC10eXBlIjoiSlNTX1VTRVJfSUQiLCJ0b2tlbi11dWlkIjoiMzE3ZTcyMWQtMzBjYi00ZjM3LWE3MDEtMDhhN2QyMWJhYzM1IiwibGRhcC1zZXJ2ZXItaWQiOi0xLCJzdWIiOiIyMCIsImV4cCI6MTY0Njk0MDc2M30.g4Cv9b7TOPyZP1zWPNK1SMO5c-9LxnUGTMBGnuuyY0k --header Accept: application/json
JamfPolicyUploader: Jamf Pro Version: 10.37.0-b.2.t1645716981
JamfPolicyUploader: Token auth will be used, 
JamfPolicyUploader: No existing cookie found - starting new session
JamfPolicyUploader: curl command: /usr/bin/curl --silent --show-error -D /tmp/jamf_upload/curl_headers_from_jamf_upload.txt --output /tmp/jamf_upload/curl_output_from_jamf_upload.txt https://jamf.pro.server.here/JSSResource/policies --request GET --header authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdXRoZW50aWNhdGVkLWFwcCI6IkdFTkVSSUMiLCJhdXRoZW50aWNhdGlvbi10eXBlIjoiSlNTIiwiZ3JvdXBzIjpbXSwic3ViamVjdC10eXBlIjoiSlNTX1VTRVJfSUQiLCJ0b2tlbi11dWlkIjoiMzE3ZTcyMWQtMzBjYi00ZjM3LWE3MDEtMDhhN2QyMWJhYzM1IiwibGRhcC1zZXJ2ZXItaWQiOi0xLCJzdWIiOiIyMCIsImV4cCI6MTY0Njk0MDc2M30.g4Cv9b7TOPyZP1zWPNK1SMO5c-9LxnUGTMBGnuuyY0k --header Accept: application/json
JamfPolicyUploader: Policy 'Auto Update CiscoUmbrella' already exists: ID 2459
JamfPolicyUploader: Replacing existing policy as 'replace_policy' is set to True
JamfPolicyUploader: Uploading Policy...
JamfPolicyUploader: Policy upload attempt 1
JamfPolicyUploader: No existing cookie found - starting new session
JamfPolicyUploader: curl command: /usr/bin/curl --silent --show-error -D /tmp/jamf_upload/curl_headers_from_jamf_upload.txt --output /tmp/jamf_upload/curl_output_from_jamf_upload.txt https://jamf.pro.server.here/JSSResource/policies/id/2459 --request PUT --header authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdXRoZW50aWNhdGVkLWFwcCI6IkdFTkVSSUMiLCJhdXRoZW50aWNhdGlvbi10eXBlIjoiSlNTIiwiZ3JvdXBzIjpbXSwic3ViamVjdC10eXBlIjoiSlNTX1VTRVJfSUQiLCJ0b2tlbi11dWlkIjoiMzE3ZTcyMWQtMzBjYi00ZjM3LWE3MDEtMDhhN2QyMWJhYzM1IiwibGRhcC1zZXJ2ZXItaWQiOi0xLCJzdWIiOiIyMCIsImV4cCI6MTY0Njk0MDc2M30.g4Cv9b7TOPyZP1zWPNK1SMO5c-9LxnUGTMBGnuuyY0k --upload-file /tmp/jamf_upload/jamf_upload_d7e5facc-6b51-4a4a-8b17-25a51698654a.txt --header Content-type: application/xml
JamfPolicyUploader: b'<html>\n<head>\n   <title>Status page</title>\n</head>\n<body style="font-family: sans-serif;">\n<p style="font-size: 1.2em;font-weight: bold;margin: 1em 0px;">Conflict</p>\n<p>Error: Problem with package</p>\n<p>You can get technical details <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10">here</a>.<br>\nPlease continue your visit at our <a href="/">home page</a>.\n</p>\n</body>\n</html>\n'
Traceback (most recent call last):
  File "/Library/AutoPkg/autopkglib/__init__.py", line 840, in process
    self.env = processor.process()
  File "/Library/AutoPkg/autopkglib/__init__.py", line 626, in process
    self.main()
  File "/Users/ec2-user/Library/AutoPkg/RecipeRepos/com.github.autopkg.grahampugh-recipes/JamfUploaderProcessors/JamfPolicyUploader.py", line 304, in main
    token=token,
  File "/Users/ec2-user/Library/AutoPkg/RecipeRepos/com.github.autopkg.grahampugh-recipes/JamfUploaderProcessors/JamfPolicyUploader.py", line 134, in upload_policy
    if self.status_check(r, "Policy", policy_name, request) == "break":
  File "/Users/ec2-user/Library/AutoPkg/RecipeRepos/com.github.autopkg.grahampugh-recipes/JamfUploaderProcessors/JamfUploaderLib/JamfUploaderBase.py", line 396, in status_check
    f"WARNING: {endpoint_type} '{obj_name}' {action} failed due to a conflict"
autopkglib.ProcessorError: WARNING: Policy 'Auto Update CiscoUmbrella' update failed due to a conflict
  File "/Library/AutoPkg/autopkglib/__init__.py", line 840, in process
    self.env = processor.process()
Receipt written to /Users/ec2-user/Library/AutoPkg/Cache/local.jamf.CiscoUmbrella-App-AutoUpdate/receipts/local.jamf-receipt-20220310-190539.plist

As far as I can tell, the XML for the policy template is formatted correctly (please see below):

<?xml version="1.0" encoding="UTF-8"?>
<policy>
   <general>
      <name>%POLICY_NAME%</name>
      <enabled>true</enabled>
      <frequency>Ongoing</frequency>
      <category>
         <name>%POLICY_CATEGORY%</name>
      </category>
      <trigger_other>%POLICY_TRIGGER%</trigger_other>
   </general>
   <scope>
      <all_computers>true</all_computers>
   </scope>
   <package_configuration>
      <packages>
         <size>1</size>
         <package>
            <name>%pkg_name%</name>
            <action>Install</action>
         </package>
      </packages>
   </package_configuration>
   <scripts>
      <size>0</size>
   </scripts>
   <maintenance>
      <recon>true</recon>
   </maintenance>
</policy>

Full sanitized verbose output of the AutoPkg run is attached as “JamfPolicyUploader_error_processor.txt.” JamfPolicyUploader_error_processor.txt

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:32 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
grahampughcommented, May 25, 2022

This is basically resolved, but I’ll leave the issue open until the Sleep processor is released, as a reminder to put that in the wiki once it’s done. (Hint: if it’s done before July 14 I can also mention the solution in our MacAdmins Campfire Talk…)

0reactions
rtroutoncommented, Aug 25, 2022

My issue appears solved, so I’m closing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JamfPolicyUploader Conflict "Error: Problem with script" · Issue #59 ...
n</p>\n</body>\n</html>\n' WARNING: Policy 'Install_Firefox' update failed due to a conflict Failed. Receipt written to /path/to/cached/recipe.
Read more >
JamfUploader AutoPkg Processors - Jamf Marketplace
New AutoPkg processors for automating package upload and deployment via Jamf ... create or update a script; JamfPolicyUploader - create or modify a...
Read more >
Making package uploading and deployment easier with ...
Update the pkg info for the policy. 8. Trigger as required. Steps to Update. JamfUploader. This session will focus on using the group...
Read more >
Making package uploading and deployment easier ... - YouTube
Whether you use the custom processors created for AutoPkg (as a new ... From uploading a single package to updating several policies and ......
Read more >
Demystifying JamfUploader - Anthony's Mac Labs Blog - jazzace.ca
JamfPackageUploader. JamfPolicyUploader. If you also want to create a policy when a package is uploaded, you add the JamfPolicyUploader processor.
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