jssimporter / JSSImporter

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

Smartgroup doesn't get updated #49

Closed teamidkem closed 9 years ago

teamidkem commented 9 years ago

I have a few overrides that I've created to handle computers that need to be updated or don't have an application. The smartgroups get created on the initial run, on subsequent runs, it fails to update and autopkg crashes. If I delete the smartgroup, it gets recreated properly.

The typical output is below (no disrespect to the original recipe poster, this happens to every recipe):

       'groups': (
    {
    name = "Missing-Adobe AIR-smart";
    smart = 1;
    "template_path" = "/Volumes/DataHD/Users/autopkguser/Library/AutoPkg/RecipeOverrides/eosd.SmartGroupTemplate.xml";
}

), 'pkg_path': '/Users/autopkguser/Library/AutoPkg/Cache/local.missing.jss.Adobe Air/Adobe AIR-18.0.0.199.pkg', 'policy_category': u'Internet', 'policy_template': u'eosd.PolicyTemplate.xml', 'prod_name': u'Adobe AIR', 'self_service_description': u'Install the latest version of Adobe AIR.', 'self_service_icon': u'Adobe AIR.png', 'version': u'18.0.0.199'}} JSSImporter: No value supplied for package_info, setting default value of: JSSImporter: No value supplied for package_notes, setting default value of: JSSImporter: No value supplied for JSS_MIGRATED, setting default value of: False JSSImporter: No value supplied for os_requirements, setting default value of: JSSImporter: Category type: category-'Plugins and Frameworks' already exists according to JSS, moving on... JSSImporter: Category type: policy_category-'Internet' already exists according to JSS, moving on... JSSImporter: Pkg-object already exists according to JSS, moving on... JSSImporter: Package upload not needed. JSSImporter: Found file: /Users/autopkguser/Library/AutoPkg/RecipeRepos/com.github.autopkg.novaksam-recipes/Adobe AIR/Adobe AIRExtensionAttribute.xml JSSImporter: ComputerExtensionAttribute: Adobe AIR updated. JSSImporter: Found file: /Volumes/DataHD/Users/autopkguser/Library/AutoPkg/RecipeOverrides/eosd.SmartGroupTemplate.xml Traceback (most recent call last): File "/usr/local/bin/autopkg", line 1651, in sys.exit(main(sys.argv)) File "/usr/local/bin/autopkg", line 1645, in main exit(subcommands[verb]'function') File "/usr/local/bin/autopkg", line 1458, in run_recipes autopackager.process(recipe) File "/Library/AutoPkg/autopkglib/init.py", line 470, in process self.env = processor.process() File "/Library/AutoPkg/autopkglib/init.py", line 299, in process self.main() File "/Library/AutoPkg/autopkglib/JSSImporter.py", line 919, in main self.groups = self.handle_groups() File "/Library/AutoPkg/autopkglib/JSSImporter.py", line 431, in handle_groups computer_group = self._add_or_update_smart_group(group) File "/Library/AutoPkg/autopkglib/JSSImporter.py", line 472, in _add_or_update_smart_group update_env="jss_group_updated", added_env="jss_group_added") File "/Library/AutoPkg/autopkglib/JSSImporter.py", line 526, in _update_or_create_new self.j.put(url, recipe_object) File "/Library/Python/2.7/site-packages/python_jss-1.2.0-py2.7.egg/jss/jss.py", line 270, in put self._error_handler(JSSPutError, response) File "/Library/Python/2.7/site-packages/python_jss-1.2.0-py2.7.egg/jss/jss.py", line 185, in _error_handler raise exception jss.exceptions.JSSPutError: Response Code: 500 Response: Internal Server Error. The server encountered an unexpected condition which prevented it from fulfilling the request

teamidkem commented 9 years ago

Here is the contents of the smartgroup xml:

<computer_group>
    <name>%group_name%</name>
    <is_smart>true</is_smart>
    <criteria>
        <criterion>
            <name>Application Title</name>
            <priority>0</priority>
            <and_or>and</and_or>
            <search_type>does not have</search_type>
            <value>%JSS_INVENTORY_NAME%</value>
        </criterion>
    </criteria>
</computer_group>
teamidkem commented 9 years ago

Closing this ticket. Issue was caused by corrupted computer records in the database.