jssimporter / JSSImporter

JSSImporter is deprecated. Please see the wiki for alternatives
Apache License 2.0
145 stars 38 forks source link

STOP_IF_NO_JSS_UPLOAD doesn't work right #188

Closed user1233445 closed 3 years ago

user1233445 commented 3 years ago

Hi,

I have several recipes in which I use the STOP_IF_NO_JSS_UPLOUD function. Unfortunately, it appears that the JSSImporter ignores the item:

JSSImporter: Category, type 'category', name 'Apps', already exists on the Jamf Pro server, moving on...
JSSImporter: Category, type 'policy_category', name '0-patchoo-dev', already exists on the Jamf Pro server, moving on...
JSSImporter: Checking if DP already mounted...
JSSImporter: Package object already exists on the Jamf Pro server.
JSSImporter: Package ID: 2344
JSSImporter: Package upload not required.
JSSImporter: Not overwriting policy as upload requirement is determined as False, and STOP_IF_NO_JSS_UPLOAD is not set to False.
JSSImporter: Unmounting DP...
Unmount successful for /Volumes/p01

Although I have added the following parameters in my JSS recipe:

        <key>STOP_IF_NO_JSS_UPLOAD</key>
        <string>False</string>

When I use autopkg run -vv local.jss.ownCloudDesktopClient --key STOP_IF_NO_JSS_UPLOAD=False instead of autopkg run -vv local.jss.ownCloudDesktopClient it works.

grahampugh commented 3 years ago

Hi anonymous. Are you on the latest version of JSSImporter?

user1233445 commented 3 years ago

Hi grahampugh,

Yes I installed the current version 1.1.3 Version because the error happened also in Version 1.1.2: image

grahampugh commented 3 years ago

It's working for me (I use this in many recipes). I wonder if you have a conflict? You say you have False set in your "recipe". Do you mean your JSS recipe or your recipe override, or both? Is the setting also in your AutoPkg Prefs?

user1233445 commented 3 years ago

I have the option in my JSS recipe and also in my override. Could you explain what do you mean with AutoPkg Prefs?

grahampugh commented 3 years ago

I mean your AutoPkg preferences. ~/Library/Preferences/com.github.autopkg.plist is the default location for these. I'm not sure about AutoPkgr as I'm not a regular user of it.

There are multiple places in which keys can be set:

I think I would need to see the complete verbose output of your AutoPkg run to try and pinpoint the problem:

autopkg run -vvvv ownCloudDesktopClient.jss

Please can you post it here, removing any sensitive information such as passwords and URLs.

Also, are you adding the key into your Input array or in the Processor dict?

user1233445 commented 3 years ago

I think I found my mistake. In the recipe the STOP_IF_NO_JSS_UPLOAD is set to false. If I change it to False and create a new override, it works again. Is it case sensitive? In the past it worked with STOP_IF_NO_JSS_UPLOAD=false.

Please see the attached output:

pcx0101:~ mpiadmin$ autopkg run -vv local.jss.ownCloudDesktopClient
Processing local.jss.ownCloudDesktopClient...
URLTextSearcher
{'Input': {'re_pattern': 'href=\\"(?P<url>https://download.owncloud.com/desktop/ownCloud/stable/[0-9\\.]+/mac/ownCloud-(?P<version>[0-9\\.]+).pkg)\\"',
           'url': 'https://owncloud.com/desktop-app/'}}
URLTextSearcher: No value supplied for result_output_var_name, setting default value of: match
URLTextSearcher: Found matching text (url): https://download.owncloud.com/desktop/ownCloud/stable/2.7.3.2877/mac/ownCloud-2.7.3.2877.pkg
URLTextSearcher: Found matching text (version): 2.7.3.2877
URLTextSearcher: Found matching text (match): https://download.owncloud.com/desktop/ownCloud/stable/2.7.3.2877/mac/ownCloud-2.7.3.2877.pkg
{'Output': {'match': 'https://download.owncloud.com/desktop/ownCloud/stable/2.7.3.2877/mac/ownCloud-2.7.3.2877.pkg',
            'url': 'https://download.owncloud.com/desktop/ownCloud/stable/2.7.3.2877/mac/ownCloud-2.7.3.2877.pkg',
            'version': '2.7.3.2877'}}
URLDownloader
{'Input': {'filename': 'ownCloud.pkg',
           'url': 'https://download.owncloud.com/desktop/ownCloud/stable/2.7.3.2877/mac/ownCloud-2.7.3.2877.pkg'}}
URLDownloader: No value supplied for prefetch_filename, setting default value of: False
URLDownloader: No value supplied for CHECK_FILESIZE_ONLY, setting default value of: False
URLDownloader: Storing new Last-Modified header: Fri, 11 Dec 2020 15:53:19 GMT
URLDownloader: Storing new ETag header: "ql6msvfohf8"
URLDownloader: Downloaded /Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/downloads/ownCloud.pkg
{'Output': {'download_changed': True,
            'etag': '"ql6msvfohf8"',
            'last_modified': 'Fri, 11 Dec 2020 15:53:19 GMT',
            'pathname': '/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/downloads/ownCloud.pkg',
            'url_downloader_summary_result': {'data': {'download_path': '/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/downloads/ownCloud.pkg'},
                                              'summary_text': 'The following '
                                                              'new items were '
                                                              'downloaded:'}}}
EndOfCheckPhase
{'Input': {}}
{'Output': {}}
CodeSignatureVerifier
{'Input': {'expected_authority_names': ['Developer ID Installer: ownCloud GmbH '
                                        '(4AP2STM4H5)',
                                        'Developer ID Certification Authority',
                                        'Apple Root CA'],
           'input_path': '/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/downloads/ownCloud.pkg'}}
CodeSignatureVerifier: Verifying installer package signature...
CodeSignatureVerifier: Package "ownCloud.pkg":
CodeSignatureVerifier:    Status: signed by a certificate trusted by Mac OS X
CodeSignatureVerifier:    Certificate Chain:
CodeSignatureVerifier: Signature is valid
CodeSignatureVerifier: Authority name chain is valid
{'Output': {}}
StopProcessingIf
{'Input': {'predicate': 'download_changed == False'}}
StopProcessingIf: (download_changed == False) is False
{'Output': {}}
FlatPkgUnpacker
{'Input': {'destination_path': '/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/unpack',
           'flat_pkg_path': '/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/downloads/ownCloud.pkg'}}
FlatPkgUnpacker: Unpacked /Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/downloads/ownCloud.pkg to /Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/unpack
{'Output': {}}
PkgPayloadUnpacker
{'Input': {'destination_path': '/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/payload',
           'pkg_payload_path': '/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/unpack/ownCloud.pkg/Payload'}}
PkgPayloadUnpacker: Unpacked /Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/unpack/ownCloud.pkg/Payload to /Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/payload
{'Output': {}}
Versioner
{'Input': {'input_plist_path': '/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/payload/Applications/owncloud.app/Contents/Info.plist',
           'plist_version_key': 'CFBundleVersion'}}
Versioner: Found version 2.7.3.2877 in file /Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/payload/Applications/owncloud.app/Contents/Info.plist
{'Output': {'version': '2.7.3.2877'}}
PkgCopier
{'Input': {'pkg_path': '/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/ownCloud-2.7.3.2877.pkg',
           'source_pkg': '/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/downloads/ownCloud.pkg'}}
PkgCopier: Copied /Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/downloads/ownCloud.pkg to /Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/ownCloud-2.7.3.2877.pkg
{'Output': {'pkg_copier_summary_result': {'data': {'pkg_path': '/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/ownCloud-2.7.3.2877.pkg'},
                                          'summary_text': 'The following '
                                                          'packages were '
                                                          'copied:'},
            'pkg_path': '/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/ownCloud-2.7.3.2877.pkg'}}
PathDeleter
{'Input': {'path_list': ['/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/unpack',
                         '/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/payload']}}
PathDeleter: Deleted /Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/unpack
PathDeleter: Deleted /Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/payload
{'Output': {}}
JSSImporter
{'
          'JSS_VERIFY_SSL': True,
           'STOP_IF_NO_JSS_UPLOAD': 'false',
           'category': 'Apps',
           'groups': [{'name': 'updateownCloud',
                       'smart': True,
                       'template_path': 'SmartGroupTemplate-patchoo.xml'}],
           'jss_inventory_name': 'owncloud.app',
           'package_boot_volume_required': 'false',
           'package_info': 'ownCloud 2.7.3.2877',
           'pkg_path': '/Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/ownCloud-2.7.3.2877.pkg',
           'policy_action_type': 'Cache',
           'policy_category': '0-patchoo-dev',
           'policy_template': 'PolicyTemplate-patchoo.xml',
           'prod_name': 'ownCloud',
           'version': '2.7.3.2877'}}
JSSImporter: No value supplied for JSS_SUPPRESS_WARNINGS, setting default value of: True
JSSImporter: No value supplied for force_policy_state, setting default value of: True
JSSImporter: No value supplied for os_requirements, setting default value of: 
JSSImporter: No value supplied for package_notes, setting default value of: 
JSSImporter: No value supplied for package_priority, setting default value of: 10
JSSImporter: No value supplied for package_reboot, setting default value of: False
JSSImporter: No value supplied for self_service_description, setting default value of: 
JSSImporter: No value supplied for self_service_icon, setting default value of: 
JSSImporter: No value supplied for skip_scope, setting default value of: False
JSSImporter: No value supplied for skip_scripts, setting default value of: False
JSSImporter: python-jss version: 2.1.1.
JSSImporter: JSSImporter version: 1.1.3.
JSSImporter: Category, type 'category', name 'Apps', already exists on the Jamf Pro server, moving on...
JSSImporter: Category, type 'policy_category', name '0-patchoo-dev', already exists on the Jamf Pro server, moving on...
JSSImporter: Checking if DP already mounted...
JSSImporter: Package object already exists on the Jamf Pro server.
JSSImporter: Package ID: 2344
JSSImporter: Package upload not required.
JSSImporter: Not overwriting policy as upload requirement is determined as False, and STOP_IF_NO_JSS_UPLOAD is not set to False.
JSSImporter: Unmounting DP...
Unmount successful for /Volumes/dp01
{'Output': {'jss_changed_objects': {'jss_category_added': [],
                                    'jss_extension_attribute_added': [],
                                    'jss_extension_attribute_updated': [],
                                    'jss_group_added': [],
                                    'jss_group_updated': [],
                                    'jss_icon_uploaded': [],
                                    'jss_package_added': [],
                                    'jss_package_updated': [],
                                    'jss_policy_added': [],
                                    'jss_policy_updated': [],
                                    'jss_repo_updated': [],
                                    'jss_script_added': [],
                                    'jss_script_updated': []}}}
Receipt written to /Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/receipts/local.jss-receipt-20201214-140750.plist

The following new items were downloaded:
    Download Path                                                                    
    -------------                                                                    
    /Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/downloads/ownCloud.pkg  

The following packages were copied:
    Pkg Path                                                                          
    --------                                                                          
    /Packaging/Autopkg/Cache/local.jss.ownCloudDesktopClient/ownCloud-2.7.3.2877.pkg  
grahampugh commented 3 years ago

Yes, it's case sensitive. Sorry!

user1233445 commented 3 years ago

Okay, thank you for your help. I will change my recipes.

grahampugh commented 3 years ago

I've updated the wiki to make the correct options clear: https://github.com/jssimporter/JSSImporter/wiki/FAQ#the-recipe-isnt-creating-a-policy-if-there-is-already-a-package-on-the-server